Welcome Guest, Not a member yet? Register   Sign In
Login from Outlet and Admin Table
#2

Try one of the available authentication libraries for CodeIgniter, like "Ion_auth" or "Community_auth". It will save a lot of time, and you will have better security.
Besides that, learn how to avoid repeating code.
E.g. the part where you determine if the user is a staff member or a customer can be way shorter:

PHP Code:
if ($staff->num_rows() > 0) {
 
 $data $staff->row_array();
 
 $this->session->set_userdata('login'TRUE);
 
 $this->session->set_userdata('akses',$data['level');
 
 $this->session->set_userdata('ses_id'$data['username']);
 
 $this->session->set_userdata('ses-name'$data['name']);
 
 redirect('dashboard');
}
else {
     ...

Reply


Messages In This Thread
RE: Login from Outlet and Admin Table - by Wouter60 - 06-23-2019, 01:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB