summaryrefslogtreecommitdiffstats
path: root/apps/admin_audit
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-08-26 17:30:07 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-08-26 17:30:07 +0200
commit72e9a2ce57ee88503db83614cec5ccda71f0b58e (patch)
tree8bc301ca22d9ca08ea54426bcb61f62bd1c1cb75 /apps/admin_audit
parent32bad688bdb4fea55eba9d4255fc55f1c60a0aca (diff)
downloadnextcloud-server-72e9a2ce57ee88503db83614cec5ccda71f0b58e.tar.gz
nextcloud-server-72e9a2ce57ee88503db83614cec5ccda71f0b58e.zip
moved to apps repository
Diffstat (limited to 'apps/admin_audit')
-rw-r--r--apps/admin_audit/appinfo/app.php21
-rw-r--r--apps/admin_audit/appinfo/info.xml11
-rw-r--r--apps/admin_audit/lib/hooks_handlers.php73
3 files changed, 0 insertions, 105 deletions
diff --git a/apps/admin_audit/appinfo/app.php b/apps/admin_audit/appinfo/app.php
deleted file mode 100644
index 2cbed5bf572..00000000000
--- a/apps/admin_audit/appinfo/app.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-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');
-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');
-
-//FIXME OC_Share does no longer exist
-/*
-OCP\Util::connectHook('OC_Share', 'public', 'OC_Admin_Audit_Hooks_Handlers', 'share_public');
-OCP\Util::connectHook('OC_Share', 'public-download', 'OC_Admin_Audit_Hooks_Handlers', 'share_public_download');
-OCP\Util::connectHook('OC_Share', 'user', 'OC_Admin_Audit_Hooks_Handlers', 'share_user');
-*/ \ No newline at end of file
diff --git a/apps/admin_audit/appinfo/info.xml b/apps/admin_audit/appinfo/info.xml
deleted file mode 100644
index 4fa013162f3..00000000000
--- a/apps/admin_audit/appinfo/info.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?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>4</require>
- <description>Audit user actions in Owncloud</description>
- <shipped>true</shipped>
-</info>
diff --git a/apps/admin_audit/lib/hooks_handlers.php b/apps/admin_audit/lib/hooks_handlers.php
deleted file mode 100644
index 17a553837da..00000000000
--- a/apps/admin_audit/lib/hooks_handlers.php
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-
-class OC_Admin_Audit_Hooks_Handlers {
- static public function pre_login($params) {
- $path = $params['uid'];
- self::log('Trying login '.$user);
- }
- static public function post_login($params) {
- $path = $params['uid'];
- self::log('Login '.$user);
- }
- static public function logout($params) {
- $user = OCP\User::getUser();
- self::log('Logout '.$user);
- }
-
- static public function rename($params) {
- $oldpath = $params[OC_Filesystem::signal_param_oldpath];
- $newpath = $params[OC_Filesystem::signal_param_newpath];
- $user = OCP\User::getUser();
- self::log('Rename "'.$oldpath.'" to "'.$newpath.'" by '.$user);
- }
- static public function create($params) {
- $path = $params[OC_Filesystem::signal_param_path];
- $user = OCP\User::getUser();
- self::log('Create "'.$path.'" by '.$user);
- }
- static public function copy($params) {
- $oldpath = $params[OC_Filesystem::signal_param_oldpath];
- $newpath = $params[OC_Filesystem::signal_param_newpath];
- $user = OCP\User::getUser();
- self::log('Copy "'.$oldpath.'" to "'.$newpath.'" by '.$user);
- }
- static public function write($params) {
- $path = $params[OC_Filesystem::signal_param_path];
- $user = OCP\User::getUser();
- self::log('Write "'.$path.'" by '.$user);
- }
- static public function read($params) {
- $path = $params[OC_Filesystem::signal_param_path];
- $user = OCP\User::getUser();
- self::log('Read "'.$path.'" by '.$user);
- }
- static public function delete($params) {
- $path = $params[OC_Filesystem::signal_param_path];
- $user = OCP\User::getUser();
- self::log('Delete "'.$path.'" by '.$user);
- }
- static public function share_public($params) {
- $path = $params['source'];
- $token = $params['token'];
- $user = OCP\User::getUser();
- self::log('Shared "'.$path.'" with public, token="'.$token.'" by '.$user);
- }
- static public function share_public_download($params) {
- $path = $params['source'];
- $token = $params['token'];
- $user = $_SERVER['REMOTE_ADDR'];
- self::log('Download of shared "'.$path.'" token="'.$token.'" by '.$user);
- }
- static public function share_user($params) {
- $path = $params['source'];
- $permissions = $params['permissions'];
- $with = $params['with'];
- $user = OCP\User::getUser();
- //$rw = $permissions & OC_Share::WRITE ? 'w' : 'o'; //FIXME OC_Share no longer exists, hack to check permissions
- $rw = $permissions & 1 ? 'w' : 'o';
- self::log('Shared "'.$path.'" (r'.$rw.') with user "'.$with.'" by '.$user);
- }
- static protected function log($msg) {
- OCP\Util::writeLog('admin_audit', $msg, OCP\Util::INFO);
- }
-}