SHARE
TWEET

Untitled

a guest Jun 15th, 2017 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. class Auth extends Model {
  4.  
  5.     function Authenticate($user = array()) {
  6.         $this->load->helper('security');
  7.         $login = $user['login'];
  8.         $password = dohash($user['passwd'], 'md5');
  9.  
  10.         $this->db->where('login', $login);
  11.         $this->db->where('passwd', $password);
  12.  
  13.         if (($this->db->count_all_results('members') < 1)) {
  14.             return FALSE;
  15.         }
  16.  
  17.         $session_data = array(
  18.             'username' => $login,
  19.             'logged_in' => TRUE
  20.         );
  21.  
  22.         $this->session->set_userdata($session_data);
  23.         return TRUE;
  24.     }
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top