Skip to content
This repository has been archived by the owner on Jun 3, 2020. It is now read-only.

Commit

Permalink
Added access logging to auth controller
Browse files Browse the repository at this point in the history
  • Loading branch information
vimofthevine committed Apr 24, 2010
1 parent 883f2e8 commit 3e802b2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions classes/controller/admin/auth.php
Expand Up @@ -23,6 +23,7 @@ public function action_login() {

if ($this->a2->logged_in())
{
Kohana::$log->add('ACCESS', "Attempt to login made by logged-in user");
$message = __('You are already logged in.');

// Return message if an ajax request
Expand Down Expand Up @@ -51,10 +52,12 @@ public function action_login() {

if ( ! $user->loaded())
{
Kohana::$log->add('ACCESS', 'Attempt to login made with unknown username, '.$post['username']);
$post->error('username', 'not_found');
}
elseif ($this->a1->login($post['username'], $post['password'], $remember))
{
Kohana::$log->add('ACCESS', 'Successful login made with username, '.$user->username);
$message = __('Welcome back, :name!', array(':name'=>$user->username));

// Get referring URI, if any
Expand All @@ -76,6 +79,7 @@ public function action_login() {
}
else
{
Kohana::$log->add('ACCESS', 'Unsuccessful login attempt made with username, '.$post['username']);
$post->error('password', 'incorrect');
}
}
Expand Down Expand Up @@ -104,6 +108,7 @@ public function action_logout() {
Kohana::$log->add(Kohana::DEBUG, 'Executing Controller_Auth::action_logout');
$this->a1->logout();

Kohana::$log->add('ACCESS', 'Successful logout made by user.');
$message = __('You have been logged out. Goodbye!');

// Return message if an ajax request
Expand Down

0 comments on commit 3e802b2

Please sign in to comment.