diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-21 04:18:42 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-21 04:18:42 +0000 |
commit | b3c05b157969e17db53cb2afe6efe58dbc2b2ba9 (patch) | |
tree | 009883a5a12ea51362871c5f5f258364cc131f5f | |
parent | 3ce32dab5517c0774a65da3494b1c84d930818f1 (diff) |
Move logging up to the controllers so that our logging can operate at a more meta level
-rw-r--r-- | modules/user/controllers/login.php | 2 | ||||
-rw-r--r-- | modules/user/controllers/logout.php | 2 | ||||
-rw-r--r-- | modules/user/helpers/user.php | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/modules/user/controllers/login.php b/modules/user/controllers/login.php index 3c1d6542..60ac16c0 100644 --- a/modules/user/controllers/login.php +++ b/modules/user/controllers/login.php @@ -30,6 +30,8 @@ class Login_Controller extends Controller { if ($user->loaded && user::is_correct_password($user, $group->password->value)) { user::login($user); + log::add("user", "User $user->name logged in", + log::INFO, html::anchor("user/$user->id", $user->name)); if ($continue = $this->input->get("continue")) { url::redirect($continue); } diff --git a/modules/user/controllers/logout.php b/modules/user/controllers/logout.php index 60f9ee50..f0feb48d 100644 --- a/modules/user/controllers/logout.php +++ b/modules/user/controllers/logout.php @@ -20,6 +20,8 @@ class Logout_Controller extends Controller { public function index() { user::logout(); + log::add("user", "User $user->name logged out", + log::INFO, html::anchor("user/$user->id", $user->name)); if ($this->input->get("continue")) { url::redirect($this->input->get("continue")); } diff --git a/modules/user/helpers/user.php b/modules/user/helpers/user.php index 962db8a7..8ae4d02a 100644 --- a/modules/user/helpers/user.php +++ b/modules/user/helpers/user.php @@ -187,8 +187,6 @@ class user_Core { user::set_active($user); module::event("user_login", $user); - log::add("user", "User $user->name logged in", - log::INFO, html::anchor("user/$user->id", $user->name)); } public static function logout() { @@ -200,8 +198,6 @@ class user_Core { Kohana::log("error", $e); } module::event("user_logout", $user); - log::add("user", "User $user->name logged out", - log::INFO, html::anchor("user/$user->id", $user->name)); } } |