public function action_verify() { $this->template->title = 'Payroll » Verify'; if (!Input::post()) { Response::redirect('login/login'); } $name = Input::post('name'); $password = Input::post('password'); $user = Model_User::find('first', array('where' => array(array('name', $name), array('password', md5($password))))); if (!$user) { Session::set_flash('error', 'Invalid username or password'); return Response::forge(View::forge('login/login')); } else { $data['user'] = $user; View::set_global('current_user', $user); Session::set_flash('Success', 'Login Successful'); $data["subnav"] = array('index' => 'active'); parent::do_login($user); Response::redirect('/'); } }