Completed
Push — stable10 ( d1b390...0bd063 )
by Lukas
27:03 queued 26:40
created
apps/admin_audit/lib/auditlogger.php 1 patch
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -40,149 +40,149 @@
 block discarded – undo
40 40
 
41 41
 class AuditLogger {
42 42
 
43
-	/** @var ILogger */
44
-	private $logger;
43
+    /** @var ILogger */
44
+    private $logger;
45 45
 
46
-	/** @var IUserSession */
47
-	private $userSession;
46
+    /** @var IUserSession */
47
+    private $userSession;
48 48
 	
49
-	/** @var IGroupManager */
50
-	private $groupManager;
51
-
52
-	/**
53
-	 * AuditLogger constructor.
54
-	 *
55
-	 * @param ILogger $logger
56
-	 * @param IUserSession $userSession
57
-	 * @param IGroupManager $groupManager
58
-	 */
59
-	public function __construct(ILogger $logger,
60
-								IUserSession $userSession, 
61
-								IGroupManager $groupManager) {
62
-		$this->logger = $logger;
63
-		$this->userSession = $userSession;
64
-		$this->groupManager = $groupManager;
65
-	}
66
-
67
-	/**
68
-	 * register hooks in order to log them
69
-	 */
70
-	public function registerHooks() {
71
-		$this->userManagementHooks();
72
-		$this->groupHooks();
73
-		$this->sharingHooks();
74
-		$this->authHooks();
75
-		$this->fileHooks();
76
-		$this->trashbinHooks();
77
-		$this->versionsHooks();
78
-	}
79
-
80
-	/**
81
-	 * connect to user management hooks
82
-	 */
83
-	private function userManagementHooks() {
84
-		$userActions = new UserManagement($this->logger);
85
-
86
-		Util::connectHook('OC_User', 'post_createUser',	$userActions, 'create');
87
-		Util::connectHook('OC_User', 'post_deleteUser',	$userActions, 'delete');
88
-		$this->userSession->listen('\OC\User', 'postSetPassword', [$userActions, 'setPassword']);
89
-	}
49
+    /** @var IGroupManager */
50
+    private $groupManager;
51
+
52
+    /**
53
+     * AuditLogger constructor.
54
+     *
55
+     * @param ILogger $logger
56
+     * @param IUserSession $userSession
57
+     * @param IGroupManager $groupManager
58
+     */
59
+    public function __construct(ILogger $logger,
60
+                                IUserSession $userSession, 
61
+                                IGroupManager $groupManager) {
62
+        $this->logger = $logger;
63
+        $this->userSession = $userSession;
64
+        $this->groupManager = $groupManager;
65
+    }
66
+
67
+    /**
68
+     * register hooks in order to log them
69
+     */
70
+    public function registerHooks() {
71
+        $this->userManagementHooks();
72
+        $this->groupHooks();
73
+        $this->sharingHooks();
74
+        $this->authHooks();
75
+        $this->fileHooks();
76
+        $this->trashbinHooks();
77
+        $this->versionsHooks();
78
+    }
79
+
80
+    /**
81
+     * connect to user management hooks
82
+     */
83
+    private function userManagementHooks() {
84
+        $userActions = new UserManagement($this->logger);
85
+
86
+        Util::connectHook('OC_User', 'post_createUser',	$userActions, 'create');
87
+        Util::connectHook('OC_User', 'post_deleteUser',	$userActions, 'delete');
88
+        $this->userSession->listen('\OC\User', 'postSetPassword', [$userActions, 'setPassword']);
89
+    }
90 90
 	
91
-	private function groupHooks()  {
92
-		$groupActions = new GroupManagement($this->logger);
93
-		$this->groupManager->listen('\OC\Group', 'postRemoveUser',  [$groupActions, 'removeUser']);
94
-		$this->groupManager->listen('\OC\Group', 'postAddUser',  [$groupActions, 'addUser']);
95
-	}
96
-
97
-	/**
98
-	 * connect to sharing events
99
-	 */
100
-	private function sharingHooks() {
101
-		$shareActions = new Sharing($this->logger);
102
-
103
-		Util::connectHook('OCP\Share', 'post_shared', $shareActions, 'shared');
104
-		Util::connectHook('OCP\Share', 'post_unshare', $shareActions, 'unshare');
105
-		Util::connectHook('OCP\Share', 'post_update_permissions', $shareActions, 'updatePermissions');
106
-		Util::connectHook('OCP\Share', 'post_update_password', $shareActions, 'updatePassword');
107
-		Util::connectHook('OCP\Share', 'post_set_expiration_date', $shareActions, 'updateExpirationDate');
108
-		Util::connectHook('OCP\Share', 'share_link_access', $shareActions, 'shareAccessed');
109
-	}
110
-
111
-	/**
112
-	 * connect to authentication event and related actions
113
-	 */
114
-	private function authHooks() {
115
-		$authActions = new Auth($this->logger);
116
-
117
-		Util::connectHook('OC_User', 'pre_login', $authActions, 'loginAttempt');
118
-		Util::connectHook('OC_User', 'post_login', $authActions, 'loginSuccessful');
119
-		Util::connectHook('OC_User', 'logout', $authActions, 'logout');
120
-	}
121
-
122
-
123
-	/**
124
-	 * connect to file hooks
125
-	 */
126
-	private function fileHooks() {
127
-		$fileActions = new Files($this->logger);
128
-
129
-		Util::connectHook(
130
-			Filesystem::CLASSNAME,
131
-			Filesystem::signal_post_rename,
132
-			$fileActions,
133
-			'rename'
134
-		);
135
-		Util::connectHook(
136
-			Filesystem::CLASSNAME,
137
-			Filesystem::signal_post_create,
138
-			$fileActions,
139
-			'create'
140
-		);
141
-		Util::connectHook(
142
-			Filesystem::CLASSNAME,
143
-			Filesystem::signal_post_copy,
144
-			$fileActions,
145
-			'copy'
146
-		);
147
-		Util::connectHook(
148
-			Filesystem::CLASSNAME,
149
-			Filesystem::signal_post_write,
150
-			$fileActions,
151
-			'write'
152
-		);
153
-		Util::connectHook(
154
-			Filesystem::CLASSNAME,
155
-			Filesystem::signal_post_update,
156
-			$fileActions,
157
-			'update'
158
-		);
159
-		Util::connectHook(
160
-			Filesystem::CLASSNAME,
161
-			Filesystem::signal_read,
162
-			$fileActions,
163
-			'read'
164
-		);
165
-		Util::connectHook(
166
-			Filesystem::CLASSNAME,
167
-			Filesystem::signal_delete,
168
-			$fileActions,
169
-			'delete'
170
-		);
171
-	}
172
-
173
-	public function versionsHooks() {
174
-		$versionsActions = new Versions($this->logger);
175
-		Util::connectHook('\OCP\Versions', 'rollback', $versionsActions, 'rollback');
176
-		Util::connectHook('\OCP\Versions', 'delete',$versionsActions, 'delete');
177
-	}
178
-
179
-	/**
180
-	 * connect to trash bin hooks
181
-	 */
182
-	private function trashbinHooks() {
183
-		$trashActions = new Trashbin($this->logger);
184
-		Util::connectHook('\OCP\Trashbin', 'preDelete', $trashActions, 'delete');
185
-		Util::connectHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', $trashActions, 'restore');
186
-	}
91
+    private function groupHooks()  {
92
+        $groupActions = new GroupManagement($this->logger);
93
+        $this->groupManager->listen('\OC\Group', 'postRemoveUser',  [$groupActions, 'removeUser']);
94
+        $this->groupManager->listen('\OC\Group', 'postAddUser',  [$groupActions, 'addUser']);
95
+    }
96
+
97
+    /**
98
+     * connect to sharing events
99
+     */
100
+    private function sharingHooks() {
101
+        $shareActions = new Sharing($this->logger);
102
+
103
+        Util::connectHook('OCP\Share', 'post_shared', $shareActions, 'shared');
104
+        Util::connectHook('OCP\Share', 'post_unshare', $shareActions, 'unshare');
105
+        Util::connectHook('OCP\Share', 'post_update_permissions', $shareActions, 'updatePermissions');
106
+        Util::connectHook('OCP\Share', 'post_update_password', $shareActions, 'updatePassword');
107
+        Util::connectHook('OCP\Share', 'post_set_expiration_date', $shareActions, 'updateExpirationDate');
108
+        Util::connectHook('OCP\Share', 'share_link_access', $shareActions, 'shareAccessed');
109
+    }
110
+
111
+    /**
112
+     * connect to authentication event and related actions
113
+     */
114
+    private function authHooks() {
115
+        $authActions = new Auth($this->logger);
116
+
117
+        Util::connectHook('OC_User', 'pre_login', $authActions, 'loginAttempt');
118
+        Util::connectHook('OC_User', 'post_login', $authActions, 'loginSuccessful');
119
+        Util::connectHook('OC_User', 'logout', $authActions, 'logout');
120
+    }
121
+
122
+
123
+    /**
124
+     * connect to file hooks
125
+     */
126
+    private function fileHooks() {
127
+        $fileActions = new Files($this->logger);
128
+
129
+        Util::connectHook(
130
+            Filesystem::CLASSNAME,
131
+            Filesystem::signal_post_rename,
132
+            $fileActions,
133
+            'rename'
134
+        );
135
+        Util::connectHook(
136
+            Filesystem::CLASSNAME,
137
+            Filesystem::signal_post_create,
138
+            $fileActions,
139
+            'create'
140
+        );
141
+        Util::connectHook(
142
+            Filesystem::CLASSNAME,
143
+            Filesystem::signal_post_copy,
144
+            $fileActions,
145
+            'copy'
146
+        );
147
+        Util::connectHook(
148
+            Filesystem::CLASSNAME,
149
+            Filesystem::signal_post_write,
150
+            $fileActions,
151
+            'write'
152
+        );
153
+        Util::connectHook(
154
+            Filesystem::CLASSNAME,
155
+            Filesystem::signal_post_update,
156
+            $fileActions,
157
+            'update'
158
+        );
159
+        Util::connectHook(
160
+            Filesystem::CLASSNAME,
161
+            Filesystem::signal_read,
162
+            $fileActions,
163
+            'read'
164
+        );
165
+        Util::connectHook(
166
+            Filesystem::CLASSNAME,
167
+            Filesystem::signal_delete,
168
+            $fileActions,
169
+            'delete'
170
+        );
171
+    }
172
+
173
+    public function versionsHooks() {
174
+        $versionsActions = new Versions($this->logger);
175
+        Util::connectHook('\OCP\Versions', 'rollback', $versionsActions, 'rollback');
176
+        Util::connectHook('\OCP\Versions', 'delete',$versionsActions, 'delete');
177
+    }
178
+
179
+    /**
180
+     * connect to trash bin hooks
181
+     */
182
+    private function trashbinHooks() {
183
+        $trashActions = new Trashbin($this->logger);
184
+        Util::connectHook('\OCP\Trashbin', 'preDelete', $trashActions, 'delete');
185
+        Util::connectHook('\OCA\Files_Trashbin\Trashbin', 'post_restore', $trashActions, 'restore');
186
+    }
187 187
 
188 188
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/groupmanagement.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -37,40 +37,40 @@
 block discarded – undo
37 37
  */
38 38
 class GroupManagement extends Action {
39 39
 
40
-	/**
41
-	 * log add user to group event
42
-	 *
43
-	 * @param IGroup $group
44
-	 * @param IUser $user
45
-	 */
46
-	public function addUser(IGroup $group, IUser $user) {
47
-		$this->log('User "%s" added to group "%s"',
48
-			[
49
-				'group' => $group->getGID(),
50
-				'user' => $user->getUID()
51
-			],
52
-			[
53
-				'user', 'group'
54
-			]
55
-		);
56
-	}
40
+    /**
41
+     * log add user to group event
42
+     *
43
+     * @param IGroup $group
44
+     * @param IUser $user
45
+     */
46
+    public function addUser(IGroup $group, IUser $user) {
47
+        $this->log('User "%s" added to group "%s"',
48
+            [
49
+                'group' => $group->getGID(),
50
+                'user' => $user->getUID()
51
+            ],
52
+            [
53
+                'user', 'group'
54
+            ]
55
+        );
56
+    }
57 57
 
58
-	/**
59
-	 * log remove user from group event
60
-	 *
61
-	 * @param IGroup $group
62
-	 * @param IUser $user
63
-	 */
64
-	public function removeUser(IGroup $group, IUser $user) {
65
-		$this->log('User "%s" removed from group "%s"',
66
-			[
67
-				'group' => $group->getGID(),
68
-				'user' => $user->getUID()
69
-			],
70
-			[
71
-				'user', 'group'
72
-			]
73
-		);
74
-	}
58
+    /**
59
+     * log remove user from group event
60
+     *
61
+     * @param IGroup $group
62
+     * @param IUser $user
63
+     */
64
+    public function removeUser(IGroup $group, IUser $user) {
65
+        $this->log('User "%s" removed from group "%s"',
66
+            [
67
+                'group' => $group->getGID(),
68
+                'user' => $user->getUID()
69
+            ],
70
+            [
71
+                'user', 'group'
72
+            ]
73
+        );
74
+    }
75 75
 
76 76
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/usermanagement.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -30,52 +30,52 @@
 block discarded – undo
30 30
  * @package OCA\Admin_Audit\Actions
31 31
  */
32 32
 class UserManagement extends Action {
33
-	/**
34
-	 * Log creation of users
35
-	 *
36
-	 * @param array $params
37
-	 */
38
-	public function create(array $params) {
39
-		$this->log(
40
-			'User created: "%s"',
41
-			$params,
42
-			[
43
-				'uid',
44
-			]
45
-		);
46
-	}
33
+    /**
34
+     * Log creation of users
35
+     *
36
+     * @param array $params
37
+     */
38
+    public function create(array $params) {
39
+        $this->log(
40
+            'User created: "%s"',
41
+            $params,
42
+            [
43
+                'uid',
44
+            ]
45
+        );
46
+    }
47 47
 
48
-	/**
49
-	 * Log deletion of users
50
-	 *
51
-	 * @param array $params
52
-	 */
53
-	public function delete(array $params) {
54
-		$this->log(
55
-			'User deleted: "%s"',
56
-			$params,
57
-			[
58
-				'uid',
59
-			]
60
-		);
61
-	}
48
+    /**
49
+     * Log deletion of users
50
+     *
51
+     * @param array $params
52
+     */
53
+    public function delete(array $params) {
54
+        $this->log(
55
+            'User deleted: "%s"',
56
+            $params,
57
+            [
58
+                'uid',
59
+            ]
60
+        );
61
+    }
62 62
 
63
-	/**
64
-	 * Logs changing of the user scope
65
-	 *
66
-	 * @param IUser $user
67
-	 */
68
-	public function setPassword(IUser $user) {
69
-		if($user->getBackendClassName() === 'Database') {
70
-			$this->log(
71
-				'Password of user "%s" has been changed',
72
-				[
73
-					'user' => $user->getUID(),
74
-				],
75
-				[
76
-					'user',
77
-				]
78
-			);
79
-		}
80
-	}
63
+    /**
64
+     * Logs changing of the user scope
65
+     *
66
+     * @param IUser $user
67
+     */
68
+    public function setPassword(IUser $user) {
69
+        if($user->getBackendClassName() === 'Database') {
70
+            $this->log(
71
+                'Password of user "%s" has been changed',
72
+                [
73
+                    'user' => $user->getUID(),
74
+                ],
75
+                [
76
+                    'user',
77
+                ]
78
+            );
79
+        }
80
+    }
81 81
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/action.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -25,64 +25,64 @@
 block discarded – undo
25 25
 use OCP\ILogger;
26 26
 
27 27
 class Action {
28
-	/** @var ILogger */
29
-	private $logger;
28
+    /** @var ILogger */
29
+    private $logger;
30 30
 
31
-	/**
32
-	 * @param ILogger $logger
33
-	 */
34
-	public function __construct(ILogger $logger) {
35
-		$this->logger = $logger;
36
-	}
31
+    /**
32
+     * @param ILogger $logger
33
+     */
34
+    public function __construct(ILogger $logger) {
35
+        $this->logger = $logger;
36
+    }
37 37
 
38
-	/**
39
-	 * Log a single action with a log level of info
40
-	 *
41
-	 * @param string $text
42
-	 * @param array $params
43
-	 * @param array $elements
44
-	 * @param bool $obfuscateParameters
45
-	 */
46
-	public function log($text,
47
-						array $params,
48
-						array $elements,
49
-						$obfuscateParameters = false) {
50
-		foreach($elements as $element) {
51
-			if(!isset($params[$element])) {
52
-				if ($obfuscateParameters) {
53
-					$this->logger->critical(
54
-						'$params["'.$element.'"] was missing.',
55
-						['app' => 'admin_audit']
56
-					);
57
-				} else {
58
-					$this->logger->critical(
59
-						sprintf(
60
-							'$params["'.$element.'"] was missing. Transferred value: %s',
61
-							print_r($params, true)
62
-						),
63
-						['app' => 'admin_audit']
64
-					);
65
-				}
66
-				return;
67
-			}
68
-		}
38
+    /**
39
+     * Log a single action with a log level of info
40
+     *
41
+     * @param string $text
42
+     * @param array $params
43
+     * @param array $elements
44
+     * @param bool $obfuscateParameters
45
+     */
46
+    public function log($text,
47
+                        array $params,
48
+                        array $elements,
49
+                        $obfuscateParameters = false) {
50
+        foreach($elements as $element) {
51
+            if(!isset($params[$element])) {
52
+                if ($obfuscateParameters) {
53
+                    $this->logger->critical(
54
+                        '$params["'.$element.'"] was missing.',
55
+                        ['app' => 'admin_audit']
56
+                    );
57
+                } else {
58
+                    $this->logger->critical(
59
+                        sprintf(
60
+                            '$params["'.$element.'"] was missing. Transferred value: %s',
61
+                            print_r($params, true)
62
+                        ),
63
+                        ['app' => 'admin_audit']
64
+                    );
65
+                }
66
+                return;
67
+            }
68
+        }
69 69
 
70
-		$replaceArray = [];
71
-		foreach($elements as $element) {
72
-			if($params[$element] instanceof \DateTime) {
73
-				$params[$element] = $params[$element]->format('Y-m-d H:i:s');
74
-			}
75
-			$replaceArray[] = $params[$element];
76
-		}
70
+        $replaceArray = [];
71
+        foreach($elements as $element) {
72
+            if($params[$element] instanceof \DateTime) {
73
+                $params[$element] = $params[$element]->format('Y-m-d H:i:s');
74
+            }
75
+            $replaceArray[] = $params[$element];
76
+        }
77 77
 
78
-		$this->logger->info(
79
-			vsprintf(
80
-				$text,
81
-				$replaceArray
82
-			),
83
-			[
84
-				'app' => 'admin_audit'
85
-			]
86
-		);
87
-	}
78
+        $this->logger->info(
79
+            vsprintf(
80
+                $text,
81
+                $replaceArray
82
+            ),
83
+            [
84
+                'app' => 'admin_audit'
85
+            ]
86
+        );
87
+    }
88 88
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/files.php 1 patch
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -28,110 +28,110 @@
 block discarded – undo
28 28
  * @package OCA\Admin_Audit\Actions
29 29
  */
30 30
 class Files extends Action {
31
-	/**
32
-	 * Logs file read actions
33
-	 *
34
-	 * @param array $params
35
-	 */
36
-	public function read(array $params) {
37
-		$this->log(
38
-			'File accessed: "%s"',
39
-			$params,
40
-			[
41
-				'path',
42
-			]
43
-		);
44
-	}
31
+    /**
32
+     * Logs file read actions
33
+     *
34
+     * @param array $params
35
+     */
36
+    public function read(array $params) {
37
+        $this->log(
38
+            'File accessed: "%s"',
39
+            $params,
40
+            [
41
+                'path',
42
+            ]
43
+        );
44
+    }
45 45
 
46
-	/**
47
-	 * Logs rename actions of files
48
-	 *
49
-	 * @param array $params
50
-	 */
51
-	public function rename(array $params) {
52
-		$this->log(
53
-			'File renamed: "%s" to "%s"',
54
-			$params,
55
-			[
56
-				'oldpath',
57
-				'newpath',
58
-			]
59
-		);
60
-	}
46
+    /**
47
+     * Logs rename actions of files
48
+     *
49
+     * @param array $params
50
+     */
51
+    public function rename(array $params) {
52
+        $this->log(
53
+            'File renamed: "%s" to "%s"',
54
+            $params,
55
+            [
56
+                'oldpath',
57
+                'newpath',
58
+            ]
59
+        );
60
+    }
61 61
 
62
-	/**
63
-	 * Logs creation of files
64
-	 *
65
-	 * @param array $params
66
-	 */
67
-	public function create(array $params) {
68
-		$this->log(
69
-			'File created: "%s"',
70
-			$params,
71
-			[
72
-				'path',
73
-			]
74
-		);
75
-	}
62
+    /**
63
+     * Logs creation of files
64
+     *
65
+     * @param array $params
66
+     */
67
+    public function create(array $params) {
68
+        $this->log(
69
+            'File created: "%s"',
70
+            $params,
71
+            [
72
+                'path',
73
+            ]
74
+        );
75
+    }
76 76
 
77
-	/**
78
-	 * Logs copying of files
79
-	 *
80
-	 * @param array $params
81
-	 */
82
-	public function copy(array $params) {
83
-		$this->log(
84
-			'File copied: "%s" to "%s"',
85
-			$params,
86
-			[
87
-				'oldpath',
88
-				'newpath',
89
-			]
90
-		);
91
-	}
77
+    /**
78
+     * Logs copying of files
79
+     *
80
+     * @param array $params
81
+     */
82
+    public function copy(array $params) {
83
+        $this->log(
84
+            'File copied: "%s" to "%s"',
85
+            $params,
86
+            [
87
+                'oldpath',
88
+                'newpath',
89
+            ]
90
+        );
91
+    }
92 92
 
93
-	/**
94
-	 * Logs writing of files
95
-	 *
96
-	 * @param array $params
97
-	 */
98
-	public function write(array $params) {
99
-		$this->log(
100
-			'File written to: "%s"',
101
-			$params,
102
-			[
103
-				'path',
104
-			]
105
-		);
106
-	}
93
+    /**
94
+     * Logs writing of files
95
+     *
96
+     * @param array $params
97
+     */
98
+    public function write(array $params) {
99
+        $this->log(
100
+            'File written to: "%s"',
101
+            $params,
102
+            [
103
+                'path',
104
+            ]
105
+        );
106
+    }
107 107
 
108
-	/**
109
-	 * Logs update of files
110
-	 *
111
-	 * @param array $params
112
-	 */
113
-	public function update(array $params) {
114
-		$this->log(
115
-			'File updated: "%s"',
116
-			$params,
117
-			[
118
-				'path',
119
-			]
120
-		);
121
-	}
108
+    /**
109
+     * Logs update of files
110
+     *
111
+     * @param array $params
112
+     */
113
+    public function update(array $params) {
114
+        $this->log(
115
+            'File updated: "%s"',
116
+            $params,
117
+            [
118
+                'path',
119
+            ]
120
+        );
121
+    }
122 122
 
123
-	/**
124
-	 * Logs deletions of files
125
-	 *
126
-	 * @param array $params
127
-	 */
128
-	public function delete(array $params) {
129
-		$this->log(
130
-			'File deleted: "%s"',
131
-			$params,
132
-			[
133
-				'path',
134
-			]
135
-		);
136
-	}
123
+    /**
124
+     * Logs deletions of files
125
+     *
126
+     * @param array $params
127
+     */
128
+    public function delete(array $params) {
129
+        $this->log(
130
+            'File deleted: "%s"',
131
+            $params,
132
+            [
133
+                'path',
134
+            ]
135
+        );
136
+    }
137 137
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/auth.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -28,33 +28,33 @@
 block discarded – undo
28 28
  * @package OCA\Admin_Audit\Actions
29 29
  */
30 30
 class Auth extends Action {
31
-	public function loginAttempt(array $params) {
32
-		$this->log(
33
-			'Login attempt: "%s"',
34
-			$params,
35
-			[
36
-				'uid',
37
-			],
38
-			true
39
-		);
40
-	}
31
+    public function loginAttempt(array $params) {
32
+        $this->log(
33
+            'Login attempt: "%s"',
34
+            $params,
35
+            [
36
+                'uid',
37
+            ],
38
+            true
39
+        );
40
+    }
41 41
 
42
-	public function loginSuccessful(array $params) {
43
-		$this->log(
44
-			'Login successful: "%s"',
45
-			$params,
46
-			[
47
-				'uid',
48
-			],
49
-			true
50
-		);
51
-	}
42
+    public function loginSuccessful(array $params) {
43
+        $this->log(
44
+            'Login successful: "%s"',
45
+            $params,
46
+            [
47
+                'uid',
48
+            ],
49
+            true
50
+        );
51
+    }
52 52
 
53
-	public function logout(array $params) {
54
-		$this->log(
55
-			'Logout occurred',
56
-			[],
57
-			[]
58
-		);
59
-	}
53
+    public function logout(array $params) {
54
+        $this->log(
55
+            'Logout occurred',
56
+            [],
57
+            []
58
+        );
59
+    }
60 60
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/versions.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@
 block discarded – undo
27 27
 
28 28
 class Versions extends Action {
29 29
 
30
-	public function rollback($params) {
31
-		$this->log('Version "%s" of "%s" was restored.',
32
-			[
33
-				'version' => $params['revision'],
34
-				'path' => $params['path']
35
-			],
36
-			['version', 'path']
37
-		);
38
-	}
30
+    public function rollback($params) {
31
+        $this->log('Version "%s" of "%s" was restored.',
32
+            [
33
+                'version' => $params['revision'],
34
+                'path' => $params['path']
35
+            ],
36
+            ['version', 'path']
37
+        );
38
+    }
39 39
 
40
-	public function delete($params) {
41
-		$this->log('Version "%s" was deleted.',
42
-			['path' => $params['path']],
43
-			['path']
44
-		);
45
-	}
40
+    public function delete($params) {
41
+        $this->log('Version "%s" was deleted.',
42
+            ['path' => $params['path']],
43
+            ['path']
44
+        );
45
+    }
46 46
 
47 47
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/actions/sharing.php 1 patch
Indentation   +154 added lines, -154 removed lines patch added patch discarded remove patch
@@ -29,163 +29,163 @@
 block discarded – undo
29 29
  * @package OCA\Admin_Audit\Actions
30 30
  */
31 31
 class Sharing extends Action {
32
-	/**
33
-	 * Logs sharing of data
34
-	 *
35
-	 * @param array $params
36
-	 */
37
-	public function shared(array $params) {
38
-		if($params['shareType'] === Share::SHARE_TYPE_LINK) {
39
-			$this->log(
40
-				'The %s "%s" with ID "%s" has been shared via link with permissions "%s" (Share ID: %s)',
41
-				$params,
42
-				[
43
-					'itemType',
44
-					'itemTarget',
45
-					'itemSource',
46
-					'permissions',
47
-					'id',
48
-				]
49
-			);
50
-		} elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
51
-			$this->log(
52
-				'The %s "%s" with ID "%s" has been shared to the user "%s" with permissions "%s"  (Share ID: %s)',
53
-				$params,
54
-				[
55
-					'itemType',
56
-					'itemTarget',
57
-					'itemSource',
58
-					'shareWith',
59
-					'permissions',
60
-					'id',
61
-				]
62
-			);
63
-		} elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
64
-			$this->log(
65
-				'The %s "%s" with ID "%s" has been shared to the group "%s" with permissions "%s"  (Share ID: %s)',
66
-				$params,
67
-				[
68
-					'itemType',
69
-					'itemTarget',
70
-					'itemSource',
71
-					'shareWith',
72
-					'permissions',
73
-					'id',
74
-				]
75
-			);
76
-		}
77
-	}
32
+    /**
33
+     * Logs sharing of data
34
+     *
35
+     * @param array $params
36
+     */
37
+    public function shared(array $params) {
38
+        if($params['shareType'] === Share::SHARE_TYPE_LINK) {
39
+            $this->log(
40
+                'The %s "%s" with ID "%s" has been shared via link with permissions "%s" (Share ID: %s)',
41
+                $params,
42
+                [
43
+                    'itemType',
44
+                    'itemTarget',
45
+                    'itemSource',
46
+                    'permissions',
47
+                    'id',
48
+                ]
49
+            );
50
+        } elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
51
+            $this->log(
52
+                'The %s "%s" with ID "%s" has been shared to the user "%s" with permissions "%s"  (Share ID: %s)',
53
+                $params,
54
+                [
55
+                    'itemType',
56
+                    'itemTarget',
57
+                    'itemSource',
58
+                    'shareWith',
59
+                    'permissions',
60
+                    'id',
61
+                ]
62
+            );
63
+        } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
64
+            $this->log(
65
+                'The %s "%s" with ID "%s" has been shared to the group "%s" with permissions "%s"  (Share ID: %s)',
66
+                $params,
67
+                [
68
+                    'itemType',
69
+                    'itemTarget',
70
+                    'itemSource',
71
+                    'shareWith',
72
+                    'permissions',
73
+                    'id',
74
+                ]
75
+            );
76
+        }
77
+    }
78 78
 
79
-	/**
80
-	 * Logs unsharing of data
81
-	 *
82
-	 * @param array $params
83
-	 */
84
-	public function unshare(array $params) {
85
-		if($params['shareType'] === Share::SHARE_TYPE_LINK) {
86
-			$this->log(
87
-				'The %s "%s" with ID "%s" has been unshared (Share ID: %s)',
88
-				$params,
89
-				[
90
-					'itemType',
91
-					'fileTarget',
92
-					'itemSource',
93
-					'id',
94
-				]
95
-			);
96
-		} elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
97
-			$this->log(
98
-				'The %s "%s" with ID "%s" has been unshared from the user "%s" (Share ID: %s)',
99
-				$params,
100
-				[
101
-					'itemType',
102
-					'fileTarget',
103
-					'itemSource',
104
-					'shareWith',
105
-					'id',
106
-				]
107
-			);
108
-		} elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
109
-			$this->log(
110
-				'The %s "%s" with ID "%s" has been unshared from the group "%s" (Share ID: %s)',
111
-				$params,
112
-				[
113
-					'itemType',
114
-					'fileTarget',
115
-					'itemSource',
116
-					'shareWith',
117
-					'id',
118
-				]
119
-			);
120
-		}
121
-	}
79
+    /**
80
+     * Logs unsharing of data
81
+     *
82
+     * @param array $params
83
+     */
84
+    public function unshare(array $params) {
85
+        if($params['shareType'] === Share::SHARE_TYPE_LINK) {
86
+            $this->log(
87
+                'The %s "%s" with ID "%s" has been unshared (Share ID: %s)',
88
+                $params,
89
+                [
90
+                    'itemType',
91
+                    'fileTarget',
92
+                    'itemSource',
93
+                    'id',
94
+                ]
95
+            );
96
+        } elseif($params['shareType'] === Share::SHARE_TYPE_USER) {
97
+            $this->log(
98
+                'The %s "%s" with ID "%s" has been unshared from the user "%s" (Share ID: %s)',
99
+                $params,
100
+                [
101
+                    'itemType',
102
+                    'fileTarget',
103
+                    'itemSource',
104
+                    'shareWith',
105
+                    'id',
106
+                ]
107
+            );
108
+        } elseif($params['shareType'] === Share::SHARE_TYPE_GROUP) {
109
+            $this->log(
110
+                'The %s "%s" with ID "%s" has been unshared from the group "%s" (Share ID: %s)',
111
+                $params,
112
+                [
113
+                    'itemType',
114
+                    'fileTarget',
115
+                    'itemSource',
116
+                    'shareWith',
117
+                    'id',
118
+                ]
119
+            );
120
+        }
121
+    }
122 122
 
123
-	/**
124
-	 * Logs the updating of permission changes for shares
125
-	 *
126
-	 * @param array $params
127
-	 */
128
-	public function updatePermissions(array $params) {
129
-		$this->log(
130
-			'The permissions of the shared %s "%s" with ID "%s" have been changed to "%s"',
131
-			$params,
132
-			[
133
-				'itemType',
134
-				'path',
135
-				'itemSource',
136
-				'permissions',
137
-			]
138
-		);
139
-	}
123
+    /**
124
+     * Logs the updating of permission changes for shares
125
+     *
126
+     * @param array $params
127
+     */
128
+    public function updatePermissions(array $params) {
129
+        $this->log(
130
+            'The permissions of the shared %s "%s" with ID "%s" have been changed to "%s"',
131
+            $params,
132
+            [
133
+                'itemType',
134
+                'path',
135
+                'itemSource',
136
+                'permissions',
137
+            ]
138
+        );
139
+    }
140 140
 
141
-	/**
142
-	 * Logs the password changes for a share
143
-	 *
144
-	 * @param array $params
145
-	 */
146
-	public function updatePassword(array $params) {
147
-		$this->log(
148
-			'The password of the publicly shared %s "%s" with ID "%s" has been changed',
149
-			$params,
150
-			[
151
-				'itemType',
152
-				'token',
153
-				'itemSource',
154
-			]
155
-		);
156
-	}
141
+    /**
142
+     * Logs the password changes for a share
143
+     *
144
+     * @param array $params
145
+     */
146
+    public function updatePassword(array $params) {
147
+        $this->log(
148
+            'The password of the publicly shared %s "%s" with ID "%s" has been changed',
149
+            $params,
150
+            [
151
+                'itemType',
152
+                'token',
153
+                'itemSource',
154
+            ]
155
+        );
156
+    }
157 157
 
158
-	/**
159
-	 * Logs the expiration date changes for a share
160
-	 *
161
-	 * @param array $params
162
-	 */
163
-	public function updateExpirationDate(array $params) {
164
-		$this->log(
165
-			'The expiration date of the publicly shared %s with ID "%s" has been changed to "%s"',
166
-			$params,
167
-			[
168
-				'itemType',
169
-				'itemSource',
170
-				'date',
171
-			]
172
-		);
173
-	}
158
+    /**
159
+     * Logs the expiration date changes for a share
160
+     *
161
+     * @param array $params
162
+     */
163
+    public function updateExpirationDate(array $params) {
164
+        $this->log(
165
+            'The expiration date of the publicly shared %s with ID "%s" has been changed to "%s"',
166
+            $params,
167
+            [
168
+                'itemType',
169
+                'itemSource',
170
+                'date',
171
+            ]
172
+        );
173
+    }
174 174
 
175
-	/**
176
-	 * Logs access of shared files
177
-	 *
178
-	 * @param array $params
179
-	 */
180
-	public function shareAccessed(array $params) {
181
-		$this->log(
182
-			'The shared %s with the token "%s" by "%s" has been accessed.',
183
-			$params,
184
-			[
185
-				'itemType',
186
-				'token',
187
-				'uidOwner',
188
-			]
189
-		);
190
-	}
175
+    /**
176
+     * Logs access of shared files
177
+     *
178
+     * @param array $params
179
+     */
180
+    public function shareAccessed(array $params) {
181
+        $this->log(
182
+            'The shared %s with the token "%s" by "%s" has been accessed.',
183
+            $params,
184
+            [
185
+                'itemType',
186
+                'token',
187
+                'uidOwner',
188
+            ]
189
+        );
190
+    }
191 191
 }
Please login to merge, or discard this patch.
apps/admin_audit/appinfo/app.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
-
4 3
  *
5 4
  * @author Bjoern Schiessle <[email protected]>
6 5
  * @author Lukas Reschke <[email protected]>
Please login to merge, or discard this patch.