Employee->is_logged_in()) { redirect('home'); } else { $this->form_validation->set_rules('username', 'lang:login_undername', 'callback_login_check'); $this->form_validation->set_error_delimiters('
', '
'); if($this->form_validation->run() == FALSE) { $this->load->view('login'); } else { if($this->config->item('statistics') == TRUE) { $this->load->library('tracking_lib'); $login_info = $this->config->item('language') . ' | ' . $this->config->item('timezone') . ' | ' . $this->config->item('currency_symbol') . ' | ' . $this->config->item('theme') . ' | ' . $this->config->item('website') . ' | ' . $this->input->ip_address(); $this->tracking_lib->track_page('login', 'login', $login_info); } redirect('home'); } } } public function login_check($username) { $password = $this->input->post('password'); if(!$this->Employee->login($username, $password)) { $this->form_validation->set_message('login_check', $this->lang->line('login_invalid_username_and_password')); return FALSE; } return TRUE; } } ?>