Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function admin_login_data_check()
- {
- $username = $this->input->post('username');
- $password = md5($this->input->post('password'));
- $role = $this->input->post('role');
- $attribute = array(
- 'username' => $username,
- 'password' => $password,
- 'role' => $role
- );
- $QueryResult = $this->db->get_where('admin', $attribute); // select query for code igniter
- if($QueryResult -> num_rows() == 1){
- $attribute_session = array(
- 'current_admin_id' => $QueryResult->row(0)->admin_id,
- 'current_admin_name' => $username,
- 'session_role' => $role
- );
- $this->session->set_userdata($attribute_session); // session set afte login succeess
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement