session->set_flashdata('message', $this->message->get_message('success', 'failed')); $this->load->view('webadmin/auth/sign_in'); } public function process_login() { $username = $this->input->post('inpUsername'); $password = md5($this->input->post('inpPassword')); $param = array( 'username' => $username, 'password' => $password ); $count_user = $this->user_model->select('*', $param, null, null, null)->num_rows(); if ($count_user == 1) { $data_user = $this->user_model->select('*', $param, null, null, null)->row(); if ($data_user->status == 0) { $this->session->set_flashdata('message', $this->message->get_message('danger', 'User Belum Aktip' ,'test')); redirect('common/auth'); } else { $sessionData['pps_username'] = $data_user->username; $sessionData['pps_nama'] = $data_user->nama; // $sessionData['hak_akses'] = explode(',', $data_user->hak_akses); $sessionData['pps_id_user'] = $data_user->id_user; $sessionData['pps_type'] = $data_user->type_user; $sessionData['pps_is_login'] = TRUE; $this->session->set_userdata($sessionData); $this->log->add_log('Login ',$param['username']); redirect('common/dash'); } } else { $this->session->set_flashdata('message', $this->message->get_message('danger', 'Username/Password Salah!','login')); // echo $this->message->get_message('danger', 'failed'); redirect('common/auth'); } } public function process_logout() { $this->session->sess_destroy(); $this->log->add_log('Logout'); redirect(''); } }