Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
don't try to log the currently logged in user, this fails on cronjobs…
…. The users are logged anyway
  • Loading branch information
schiessle committed Jun 22, 2016
commit a7766ca72eaa3b8f23e4859cfe18402f5eac9572
34 changes: 4 additions & 30 deletions apps/admin_audit/lib/actions/trashbin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,15 @@

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']
);
}

Expand Down
2 changes: 1 addition & 1 deletion apps/admin_audit/lib/auditlogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public function versionsHooks() {
* 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');
}
Expand Down