diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-03-19 21:56:07 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-05-07 09:04:07 +0200 |
commit | 640ba1828f3edfdd2e71825828c51b734fb19d1c (patch) | |
tree | 065a68d3f08615144eb2b6a1d8b8494b867874b7 /apps/admin_audit | |
parent | 2488cdb8a1066fa7561489dcea687a5bfae936fd (diff) | |
download | nextcloud-server-640ba1828f3edfdd2e71825828c51b734fb19d1c.tar.gz nextcloud-server-640ba1828f3edfdd2e71825828c51b734fb19d1c.zip |
Start of audit app
Audit the filesystem action
Diffstat (limited to 'apps/admin_audit')
-rw-r--r-- | apps/admin_audit/appinfo/app.php | 10 | ||||
-rw-r--r-- | apps/admin_audit/appinfo/info.xml | 10 | ||||
-rw-r--r-- | apps/admin_audit/lib/hooks_handlers.php | 36 |
3 files changed, 56 insertions, 0 deletions
diff --git a/apps/admin_audit/appinfo/app.php b/apps/admin_audit/appinfo/app.php new file mode 100644 index 00000000000..b1b986fb7ba --- /dev/null +++ b/apps/admin_audit/appinfo/app.php @@ -0,0 +1,10 @@ +<?php + +OC::$CLASSPATH['OC_Admin_Audit_Hooks_Handlers'] = 'apps/admin_audit/lib/hooks_handlers.php'; + +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'); +OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_write, 'OC_Admin_Audit_Hooks_Handlers', 'write'); +OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_read, 'OC_Admin_Audit_Hooks_Handlers', 'read'); +OCP\Util::connectHook(OC_Filesystem::CLASSNAME, OC_Filesystem::signal_delete, 'OC_Admin_Audit_Hooks_Handlers', 'delete'); diff --git a/apps/admin_audit/appinfo/info.xml b/apps/admin_audit/appinfo/info.xml new file mode 100644 index 00000000000..6eb62fbbd16 --- /dev/null +++ b/apps/admin_audit/appinfo/info.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<info> + <id>admin_audit</id> + <name>Log audit info</name> + <version>0.1</version> + <licence>AGPL</licence> + <author>Bart Visscher</author> + <require>2</require> + <description>Audit user actions in Owncloud</description> +</info> diff --git a/apps/admin_audit/lib/hooks_handlers.php b/apps/admin_audit/lib/hooks_handlers.php new file mode 100644 index 00000000000..924878840a2 --- /dev/null +++ b/apps/admin_audit/lib/hooks_handlers.php @@ -0,0 +1,36 @@ +<?php + +class OC_Admin_Audit_Hooks_Handlers { + static public function rename($params) { + $oldpath = $params[OC_Filesystem::signal_param_oldpath]; + $newpath = $params[OC_Filesystem::signal_param_newpath]; + $user = OCP\User::getUser(); + OCP\Util::writeLog('admin_audit', 'Rename "'.$oldpath.'" to "'.$newpath.'" by '.$user, OCP\Util::INFO); + } + static public function create($params) { + $path = $params[OC_Filesystem::signal_param_path]; + $user = OCP\User::getUser(); + OCP\Util::writeLog('admin_audit', 'Create "'.$path.'" by '.$user, OCP\Util::INFO); + } + static public function copy($params) { + $oldpath = $params[OC_Filesystem::signal_param_oldpath]; + $newpath = $params[OC_Filesystem::signal_param_newpath]; + $user = OCP\User::getUser(); + OCP\Util::writeLog('admin_audit', 'Copy "'.$oldpath.'" to "'.$newpath.'" by '.$user, OCP\Util::INFO); + } + static public function write($params) { + $path = $params[OC_Filesystem::signal_param_path]; + $user = OCP\User::getUser(); + OCP\Util::writeLog('admin_audit', 'Write "'.$path.'" by '.$user, OCP\Util::INFO); + } + static public function read($params) { + $path = $params[OC_Filesystem::signal_param_path]; + $user = OCP\User::getUser(); + OCP\Util::writeLog('admin_audit', 'Read "'.$path.'" by '.$user, OCP\Util::INFO); + } + static public function delete($params) { + $path = $params[OC_Filesystem::signal_param_path]; + $user = OCP\User::getUser(); + OCP\Util::writeLog('admin_audit', 'Delete "'.$path.'" by '.$user, OCP\Util::INFO); + } +} |