Audit: Add user login/logout logging
This commit is contained in:
parent
640ba1828f
commit
1e12db35ee
2 changed files with 17 additions and 0 deletions
|
@ -2,6 +2,10 @@
|
|||
|
||||
OC::$CLASSPATH['OC_Admin_Audit_Hooks_Handlers'] = 'apps/admin_audit/lib/hooks_handlers.php';
|
||||
|
||||
OCP\Util::connectHook('OCP\User', 'pre_login', 'OC_Admin_Audit_Hooks_Handlers', 'pre_login');
|
||||
OCP\Util::connectHook('OCP\User', 'post_login', 'OC_Admin_Audit_Hooks_Handlers', 'post_login');
|
||||
OCP\Util::connectHook('OCP\User', 'logout', 'OC_Admin_Audit_Hooks_Handlers', 'logout');
|
||||
|
||||
OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_rename, 'OC_Admin_Audit_Hooks_Handlers', 'rename');
|
||||
OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_create, 'OC_Admin_Audit_Hooks_Handlers', 'create');
|
||||
OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_copy, 'OC_Admin_Audit_Hooks_Handlers', 'copy');
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
<?php
|
||||
|
||||
class OC_Admin_Audit_Hooks_Handlers {
|
||||
static public function pre_login($params) {
|
||||
$path = $params['uid'];
|
||||
OCP\Util::writeLog('admin_audit', 'Trying login '.$user, OCP\Util::INFO);
|
||||
}
|
||||
static public function post_login($params) {
|
||||
$path = $params['uid'];
|
||||
OCP\Util::writeLog('admin_audit', 'Login '.$user, OCP\Util::INFO);
|
||||
}
|
||||
static public function logout($params) {
|
||||
$user = OCP\User::getUser();
|
||||
OCP\Util::writeLog('admin_audit', 'Logout '.$user, OCP\Util::INFO);
|
||||
}
|
||||
|
||||
static public function rename($params) {
|
||||
$oldpath = $params[OC_Filesystem::signal_param_oldpath];
|
||||
$newpath = $params[OC_Filesystem::signal_param_newpath];
|
||||
|
|
Loading…
Reference in a new issue