2012-03-20 00:56:07 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class OC_Admin_Audit_Hooks_Handlers {
|
2012-03-24 01:34:55 +04:00
|
|
|
static public function pre_login($params) {
|
|
|
|
$path = $params['uid'];
|
2012-03-29 13:24:29 +04:00
|
|
|
self::log('Trying login '.$user);
|
2012-03-24 01:34:55 +04:00
|
|
|
}
|
|
|
|
static public function post_login($params) {
|
|
|
|
$path = $params['uid'];
|
2012-03-29 13:24:29 +04:00
|
|
|
self::log('Login '.$user);
|
2012-03-24 01:34:55 +04:00
|
|
|
}
|
|
|
|
static public function logout($params) {
|
|
|
|
$user = OCP\User::getUser();
|
2012-03-29 13:24:29 +04:00
|
|
|
self::log('Logout '.$user);
|
2012-03-24 01:34:55 +04:00
|
|
|
}
|
|
|
|
|
2012-03-20 00:56:07 +04:00
|
|
|
static public function rename($params) {
|
|
|
|
$oldpath = $params[OC_Filesystem::signal_param_oldpath];
|
|
|
|
$newpath = $params[OC_Filesystem::signal_param_newpath];
|
|
|
|
$user = OCP\User::getUser();
|
2012-03-29 13:24:29 +04:00
|
|
|
self::log('Rename "'.$oldpath.'" to "'.$newpath.'" by '.$user);
|
2012-03-20 00:56:07 +04:00
|
|
|
}
|
|
|
|
static public function create($params) {
|
|
|
|
$path = $params[OC_Filesystem::signal_param_path];
|
|
|
|
$user = OCP\User::getUser();
|
2012-03-29 13:24:29 +04:00
|
|
|
self::log('Create "'.$path.'" by '.$user);
|
2012-03-20 00:56:07 +04:00
|
|
|
}
|
|
|
|
static public function copy($params) {
|
|
|
|
$oldpath = $params[OC_Filesystem::signal_param_oldpath];
|
|
|
|
$newpath = $params[OC_Filesystem::signal_param_newpath];
|
|
|
|
$user = OCP\User::getUser();
|
2012-03-29 13:24:29 +04:00
|
|
|
self::log('Copy "'.$oldpath.'" to "'.$newpath.'" by '.$user);
|
2012-03-20 00:56:07 +04:00
|
|
|
}
|
|
|
|
static public function write($params) {
|
|
|
|
$path = $params[OC_Filesystem::signal_param_path];
|
|
|
|
$user = OCP\User::getUser();
|
2012-03-29 13:24:29 +04:00
|
|
|
self::log('Write "'.$path.'" by '.$user);
|
2012-03-20 00:56:07 +04:00
|
|
|
}
|
|
|
|
static public function read($params) {
|
|
|
|
$path = $params[OC_Filesystem::signal_param_path];
|
|
|
|
$user = OCP\User::getUser();
|
2012-03-29 13:24:29 +04:00
|
|
|
self::log('Read "'.$path.'" by '.$user);
|
2012-03-20 00:56:07 +04:00
|
|
|
}
|
|
|
|
static public function delete($params) {
|
|
|
|
$path = $params[OC_Filesystem::signal_param_path];
|
|
|
|
$user = OCP\User::getUser();
|
2012-03-29 13:24:29 +04:00
|
|
|
self::log('Delete "'.$path.'" by '.$user);
|
|
|
|
}
|
|
|
|
static protected function log($msg) {
|
|
|
|
OCP\Util::writeLog('admin_audit', $msg, OCP\Util::INFO);
|
2012-03-20 00:56:07 +04:00
|
|
|
}
|
|
|
|
}
|