diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2016-06-20 11:21:27 +0200 |
---|---|---|
committer | Bjoern Schiessle <bjoern@schiessle.org> | 2016-06-20 11:21:27 +0200 |
commit | f9fd7093c0195ff03121bc19b9613ea49766dac7 (patch) | |
tree | d7914fca8750aad252ff9a5bc30450e30fea2473 /apps/admin_audit | |
parent | e4996305fc04c6c0662ba5b6597460cf425eb4d0 (diff) | |
download | nextcloud-server-f9fd7093c0195ff03121bc19b9613ea49766dac7.tar.gz nextcloud-server-f9fd7093c0195ff03121bc19b9613ea49766dac7.zip |
don't try to log the currently logged in user, this fails on cronjobs. The users are logged anyway
Diffstat (limited to 'apps/admin_audit')
-rw-r--r-- | apps/admin_audit/lib/actions/trashbin.php | 34 | ||||
-rw-r--r-- | apps/admin_audit/lib/auditlogger.php | 2 |
2 files changed, 5 insertions, 31 deletions
diff --git a/apps/admin_audit/lib/actions/trashbin.php b/apps/admin_audit/lib/actions/trashbin.php index 2cd3189d064..f665698678e 100644 --- a/apps/admin_audit/lib/actions/trashbin.php +++ b/apps/admin_audit/lib/actions/trashbin.php @@ -28,41 +28,15 @@ use OCP\IUserSession; class Trashbin extends Action { - /** @var IUserSession */ - private $userSession; - - /** - * Trashbin constructor. - * - * @param ILogger $logger - * @param IUserSession $userSession - */ - public function __construct(ILogger $logger, IUserSession $userSession) { - parent::__construct($logger); - $this->userSession = $userSession; - } - public function delete($params) { - $this->log('File "%s" deleted from trash bin by "%s"', - [ - 'path' => $params['path'], - 'user' => $this->userSession->getUser()->getUID() - ], - [ - 'path', 'user' - ] + $this->log('File "%s" deleted from trash bin.', + ['path' => $params['path']], ['path'] ); } public function restore($params) { - $this->log('File "%s" restored from trash bin by "%s"', - [ - 'path' => $params['filePath'], - 'user' => $this->userSession->getUser()->getUID() - ], - [ - 'path', 'user' - ] + $this->log('File "%s" restored from trash bin.', + ['path' => $params['filePath']], ['path'] ); } diff --git a/apps/admin_audit/lib/auditlogger.php b/apps/admin_audit/lib/auditlogger.php index f7dae10701f..050dc9c475d 100644 --- a/apps/admin_audit/lib/auditlogger.php +++ b/apps/admin_audit/lib/auditlogger.php @@ -178,7 +178,7 @@ class AuditLogger { * connect to trash bin hooks */ private function trashbinHooks() { - $trashActions = new Trashbin($this->logger, $this->userSession); + $trashActions = new Trashbin($this->logger); Util::connectHook('\OCP\Trashbin', 'preDelete', $trashActions, 'delete'); Util::connectHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', $trashActions, 'restore'); } |