daily pastebin goal
40%
SHARE
TWEET

Untitled

lacasera Dec 29th, 2016 140 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //login functiion
  2. public function authenticate()
  3.     {
  4.         $username = $this->input->post('uname');
  5.         $password =  $this->input->post('password');
  6.         $pass =  hash_password($password);
  7.  
  8.         $res = $this->AppModel->fetch($username,$pass,'organisers');
  9.  
  10.        
  11.             if ($res['email']==$username && $res['password']==$pass && $res['status']=='1') {
  12.  
  13.                     $array = array(
  14.                     'logged_in' => true,
  15.                     'user_id'=>$res['id'],
  16.  
  17.                 );
  18.  
  19.            
  20.                 $this->session->set_userdata( $array );
  21.            
  22.                
  23.                 redirect(base_url('home'),'refresh');
  24.             }
  25.             elseif ($res['email']==$username && $res['password']==$pass && $res['status']=='0') {
  26.                 //$data['error'] = "Please verify your account and continue";
  27.                 $data['phone_number'] = $res['phone_number'];
  28.                 $this->load->view('verification_view', $data);
  29.                
  30.             }else {
  31.                 $data['error'] = "Invalid credentials. Please try again";
  32.                 $this->load->view('login_view', $data);
  33.             }
  34.     }
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