mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-05 14:40:44 -04:00
Add a logging facility, and instrument login/logout to use it.
This commit is contained in:
@@ -187,6 +187,22 @@ 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() {
|
||||
$user = user::active();
|
||||
if (!$user->guest) {
|
||||
try {
|
||||
Session::instance()->destroy();
|
||||
} catch (Exception $e) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user