@@ -207,7 +207,7 @@ |
||
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
210 | - public function getRoleConfiguration(){ |
|
210 | + public function getRoleConfiguration() { |
|
211 | 211 | return $this->roleConfiguration; |
212 | 212 | } |
213 | 213 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | $this->assign('currentUser', $currentUser); |
58 | 58 | $this->assign("loggedIn", (!$currentUser->isCommunityUser())); |
59 | 59 | |
60 | - if($this->securityManager !== null) { |
|
60 | + if ($this->securityManager !== null) { |
|
61 | 61 | $this->setupNavMenuAccess($currentUser); |
62 | 62 | } |
63 | 63 |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | foreach ($users as $user) { |
30 | 30 | $toAdd = array('user'); |
31 | 31 | |
32 | - if($user['status'] === 'Admin'){ |
|
32 | + if ($user['status'] === 'Admin') { |
|
33 | 33 | $toAdd[] = 'admin'; |
34 | 34 | } |
35 | 35 | |
36 | - if($user['checkuser'] == 1){ |
|
36 | + if ($user['checkuser'] == 1) { |
|
37 | 37 | $toAdd[] = 'checkuser'; |
38 | 38 | } |
39 | 39 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $log->setComment($logData); |
61 | 61 | $log->save(); |
62 | 62 | |
63 | - if($user['status'] === 'Admin' || $user['status'] === 'User'){ |
|
63 | + if ($user['status'] === 'Admin' || $user['status'] === 'User') { |
|
64 | 64 | $update->execute(array('id' => $user['id'])); |
65 | 65 | } |
66 | 66 | } |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | $this->dbObject->prepare("UPDATE user SET oauthidentitycache = NULL WHERE id = :id;") |
903 | 903 | ->execute(array(":id" => $this->id)); |
904 | 904 | |
905 | - SessionAlert::warning("OAuth error getting identity from MediaWiki: " . $ex->getMessage()); |
|
905 | + SessionAlert::warning("OAuth error getting identity from MediaWiki: ".$ex->getMessage()); |
|
906 | 906 | } |
907 | 907 | } |
908 | 908 | |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | */ |
986 | 986 | public function getForgottenPasswordHash() |
987 | 987 | { |
988 | - return md5($this->username . $this->email . $this->welcome_template . $this->id . $this->password); |
|
988 | + return md5($this->username.$this->email.$this->welcome_template.$this->id.$this->password); |
|
989 | 989 | } |
990 | 990 | |
991 | 991 | /** |
@@ -77,14 +77,14 @@ |
||
77 | 77 | * |
78 | 78 | * @return $this |
79 | 79 | */ |
80 | - public function lastActiveBefore(DateTime $instant){ |
|
80 | + public function lastActiveBefore(DateTime $instant) { |
|
81 | 81 | $this->whereClause .= ' AND origin.lastactive < ?'; |
82 | 82 | $this->parameterList[] = $instant->format("Y-m-d H:i:s"); |
83 | 83 | |
84 | 84 | return $this; |
85 | 85 | } |
86 | 86 | |
87 | - public function getRoleMap(&$roleMap){ |
|
87 | + public function getRoleMap(&$roleMap) { |
|
88 | 88 | $query = <<<SQL |
89 | 89 | SELECT /* UserSearchHelper/roleMap */ |
90 | 90 | r.user user |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $blacklist = array("DCC", "CCTP", "PRIVMSG"); |
90 | 90 | $message = str_replace($blacklist, "(IRC Blacklist)", $message); // Lets stop DCC etc |
91 | 91 | |
92 | - $msg = IrcColourCode::RESET . IrcColourCode::BOLD . "[$instanceName]" . IrcColourCode::RESET . ": $message"; |
|
92 | + $msg = IrcColourCode::RESET.IrcColourCode::BOLD."[$instanceName]".IrcColourCode::RESET.": $message"; |
|
93 | 93 | |
94 | 94 | try { |
95 | 95 | $notification = new Notification(); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function userApproved(User $user) |
129 | 129 | { |
130 | - $this->send("{$user->getUsername()} approved by " . $this->currentUser->getUsername()); |
|
130 | + $this->send("{$user->getUsername()} approved by ".$this->currentUser->getUsername()); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function userPromoted(User $user) |
139 | 139 | { |
140 | - $this->send("{$user->getUsername()} promoted to tool admin by " . $this->currentUser->getUsername()); |
|
140 | + $this->send("{$user->getUsername()} promoted to tool admin by ".$this->currentUser->getUsername()); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function userDeclined(User $user, $reason) |
150 | 150 | { |
151 | - $this->send("{$user->getUsername()} declined by " . $this->currentUser->getUsername() . " ($reason)"); |
|
151 | + $this->send("{$user->getUsername()} declined by ".$this->currentUser->getUsername()." ($reason)"); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function userDemoted(User $user, $reason) |
161 | 161 | { |
162 | - $this->send("{$user->getUsername()} demoted by " . $this->currentUser->getUsername() . " ($reason)"); |
|
162 | + $this->send("{$user->getUsername()} demoted by ".$this->currentUser->getUsername()." ($reason)"); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | public function userSuspended(User $user, $reason) |
172 | 172 | { |
173 | - $this->send("{$user->getUsername()} suspended by " . $this->currentUser->getUsername() . " ($reason)"); |
|
173 | + $this->send("{$user->getUsername()} suspended by ".$this->currentUser->getUsername()." ($reason)"); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function userPrefChange(User $user) |
182 | 182 | { |
183 | - $this->send("{$user->getUsername()}'s preferences were changed by " . $this->currentUser->getUsername()); |
|
183 | + $this->send("{$user->getUsername()}'s preferences were changed by ".$this->currentUser->getUsername()); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function userRenamed(User $user, $old) |
193 | 193 | { |
194 | - $this->send($this->currentUser->getUsername() . " renamed $old to {$user->getUsername()}"); |
|
194 | + $this->send($this->currentUser->getUsername()." renamed $old to {$user->getUsername()}"); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | public function userRolesEdited(User $user, $reason) |
202 | 202 | { |
203 | 203 | $currentUser = $this->currentUser->getUsername(); |
204 | - $this->send("Active roles for {$user->getUsername()} changed by " . $currentUser . " ($reason)"); |
|
204 | + $this->send("Active roles for {$user->getUsername()} changed by ".$currentUser." ($reason)"); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | #endregion |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function siteNoticeEdited() |
215 | 215 | { |
216 | - $this->send("Site notice edited by " . $this->currentUser->getUsername()); |
|
216 | + $this->send("Site notice edited by ".$this->currentUser->getUsername()); |
|
217 | 217 | } |
218 | 218 | #endregion |
219 | 219 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public function welcomeTemplateCreated(WelcomeTemplate $template) |
227 | 227 | { |
228 | - $this->send("Welcome template {$template->getId()} created by " . $this->currentUser->getUsername()); |
|
228 | + $this->send("Welcome template {$template->getId()} created by ".$this->currentUser->getUsername()); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function welcomeTemplateDeleted($templateid) |
237 | 237 | { |
238 | - $this->send("Welcome template {$templateid} deleted by " . $this->currentUser->getUsername()); |
|
238 | + $this->send("Welcome template {$templateid} deleted by ".$this->currentUser->getUsername()); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | */ |
246 | 246 | public function welcomeTemplateEdited(WelcomeTemplate $template) |
247 | 247 | { |
248 | - $this->send("Welcome template {$template->getId()} edited by " . $this->currentUser->getUsername()); |
|
248 | + $this->send("Welcome template {$template->getId()} edited by ".$this->currentUser->getUsername()); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 | #endregion |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | $duration = "indefinitely"; |
263 | 263 | } |
264 | 264 | else { |
265 | - $duration = "until " . date("F j, Y, g:i a", $ban->getDuration()); |
|
265 | + $duration = "until ".date("F j, Y, g:i a", $ban->getDuration()); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | $username = $this->currentUser->getUsername(); |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public function unbanned(Ban $ban, $unbanreason) |
280 | 280 | { |
281 | - $this->send($ban->getTarget() . " unbanned by " . $this->currentUser |
|
282 | - ->getUsername() . " (" . $unbanreason . ")"); |
|
281 | + $this->send($ban->getTarget()." unbanned by ".$this->currentUser |
|
282 | + ->getUsername()." (".$unbanreason.")"); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | #endregion |
@@ -294,15 +294,15 @@ discard block |
||
294 | 294 | public function requestReceived(Request $request) |
295 | 295 | { |
296 | 296 | $this->send( |
297 | - IrcColourCode::DARK_GREY . "[[" |
|
298 | - . IrcColourCode::DARK_GREEN . "acc:" |
|
299 | - . IrcColourCode::ORANGE . $request->getId() |
|
300 | - . IrcColourCode::DARK_GREY . "]]" |
|
301 | - . IrcColourCode::RED . " N " |
|
302 | - . IrcColourCode::DARK_BLUE . $this->baseUrl . "/internal.php/viewRequest?id={$request->getId()} " |
|
303 | - . IrcColourCode::DARK_RED . "* " |
|
304 | - . IrcColourCode::DARK_GREEN . $request->getName() |
|
305 | - . IrcColourCode::DARK_RED . " * " |
|
297 | + IrcColourCode::DARK_GREY."[[" |
|
298 | + . IrcColourCode::DARK_GREEN."acc:" |
|
299 | + . IrcColourCode::ORANGE.$request->getId() |
|
300 | + . IrcColourCode::DARK_GREY."]]" |
|
301 | + . IrcColourCode::RED." N " |
|
302 | + . IrcColourCode::DARK_BLUE.$this->baseUrl."/internal.php/viewRequest?id={$request->getId()} " |
|
303 | + . IrcColourCode::DARK_RED."* " |
|
304 | + . IrcColourCode::DARK_GREEN.$request->getName() |
|
305 | + . IrcColourCode::DARK_RED." * " |
|
306 | 306 | . IrcColourCode::RESET |
307 | 307 | ); |
308 | 308 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | public function emailCreated(EmailTemplate $template) |
464 | 464 | { |
465 | 465 | $username = $this->currentUser->getUsername(); |
466 | - $this->send("Email {$template->getId()} ({$template->getName()}) created by " . $username); |
|
466 | + $this->send("Email {$template->getId()} ({$template->getName()}) created by ".$username); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | /** |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | public function emailEdited(EmailTemplate $template) |
475 | 475 | { |
476 | 476 | $username = $this->currentUser->getUsername(); |
477 | - $this->send("Email {$template->getId()} ({$template->getName()}) edited by " . $username); |
|
477 | + $this->send("Email {$template->getId()} ({$template->getName()}) edited by ".$username); |
|
478 | 478 | } |
479 | 479 | #endregion |
480 | 480 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | continue; |
120 | 120 | } |
121 | 121 | |
122 | - $newValue = WebRequest::postBoolean('role-' . $name) ? 1 : 0; |
|
122 | + $newValue = WebRequest::postBoolean('role-'.$name) ? 1 : 0; |
|
123 | 123 | if ($newValue !== $r['active']) { |
124 | 124 | if ($newValue === 0) { |
125 | 125 | $delete[] = $r['object']; |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $user->save(); |
163 | 163 | |
164 | 164 | $this->getNotificationHelper()->userRolesEdited($user, $reason); |
165 | - SessionAlert::quick('Roles changed for user ' . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
165 | + SessionAlert::quick('Roles changed for user '.htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
166 | 166 | |
167 | 167 | $this->redirect('statistics/users', 'detail', array('user' => $user->getId())); |
168 | 168 | return; |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | Logger::suspendedUser($database, $user, $reason); |
215 | 215 | |
216 | 216 | $this->getNotificationHelper()->userSuspended($user, $reason); |
217 | - SessionAlert::quick('Suspended user ' . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
217 | + SessionAlert::quick('Suspended user '.htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
218 | 218 | |
219 | 219 | // send email |
220 | 220 | $this->sendStatusChangeEmail( |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | Logger::declinedUser($database, $user, $reason); |
276 | 276 | |
277 | 277 | $this->getNotificationHelper()->userDeclined($user, $reason); |
278 | - SessionAlert::quick('Declined user ' . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
278 | + SessionAlert::quick('Declined user '.htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
279 | 279 | |
280 | 280 | // send email |
281 | 281 | $this->sendStatusChangeEmail( |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | Logger::approvedUser($database, $user); |
331 | 331 | |
332 | 332 | $this->getNotificationHelper()->userApproved($user); |
333 | - SessionAlert::quick('Approved user ' . htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
333 | + SessionAlert::quick('Approved user '.htmlentities($user->getUsername(), ENT_COMPAT, 'UTF-8')); |
|
334 | 334 | |
335 | 335 | // send email |
336 | 336 | $this->sendStatusChangeEmail( |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | private function getNameSearchResults($searchTerm) |
93 | 93 | { |
94 | - $padded = '%' . $searchTerm . '%'; |
|
94 | + $padded = '%'.$searchTerm.'%'; |
|
95 | 95 | |
96 | 96 | /** @var Request[] $requests */ |
97 | 97 | $requests = RequestSearchHelper::get($this->getDatabase()) |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | throw new ApplicationLogicException('The search term "@" is not valid for email address searches!'); |
117 | 117 | } |
118 | 118 | |
119 | - $padded = '%' . $searchTerm . '%'; |
|
119 | + $padded = '%'.$searchTerm.'%'; |
|
120 | 120 | |
121 | 121 | /** @var Request[] $requests */ |
122 | 122 | $requests = RequestSearchHelper::get($this->getDatabase()) |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | * @param string $column The required column |
78 | 78 | * @return array |
79 | 79 | */ |
80 | - public function fetchColumn($column){ |
|
80 | + public function fetchColumn($column) { |
|
81 | 81 | $statement = $this->getData(array($column)); |
82 | 82 | |
83 | 83 | return $statement->fetchAll(PDO::FETCH_COLUMN); |
84 | 84 | } |
85 | 85 | |
86 | - public function fetchMap($column){ |
|
86 | + public function fetchMap($column) { |
|
87 | 87 | $statement = $this->getData(array('id', $column)); |
88 | 88 | |
89 | 89 | $data = $statement->fetchAll(PDO::FETCH_ASSOC); |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function getRecordCount(&$count) |
105 | 105 | { |
106 | - $query = 'SELECT /* SearchHelper */ COUNT(*) FROM ' . $this->table . ' origin '; |
|
107 | - $query .= $this->joinClause . $this->whereClause; |
|
106 | + $query = 'SELECT /* SearchHelper */ COUNT(*) FROM '.$this->table.' origin '; |
|
107 | + $query .= $this->joinClause.$this->whereClause; |
|
108 | 108 | |
109 | 109 | $statement = $this->database->prepare($query); |
110 | 110 | $statement->execute($this->parameterList); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | private function applyOrder() |
152 | 152 | { |
153 | 153 | if ($this->orderBy !== null) { |
154 | - return ' ORDER BY ' . $this->orderBy; |
|
154 | + return ' ORDER BY '.$this->orderBy; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | return ''; |
@@ -183,11 +183,11 @@ discard block |
||
183 | 183 | { |
184 | 184 | $colData = array(); |
185 | 185 | foreach ($columns as $c) { |
186 | - $colData[] = 'origin.' . $c; |
|
186 | + $colData[] = 'origin.'.$c; |
|
187 | 187 | } |
188 | 188 | |
189 | - $query = 'SELECT /* SearchHelper */ ' . implode(', ', $colData) . ' FROM ' . $this->table . ' origin '; |
|
190 | - $query .= $this->joinClause . $this->whereClause; |
|
189 | + $query = 'SELECT /* SearchHelper */ '.implode(', ', $colData).' FROM '.$this->table.' origin '; |
|
190 | + $query .= $this->joinClause.$this->whereClause; |
|
191 | 191 | |
192 | 192 | return $query; |
193 | 193 | } |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $valueCount = count($values); |
207 | 207 | |
208 | 208 | // Firstly, let's create a string of question marks, which will do as positional parameters. |
209 | - $inSection = str_repeat('?,', $valueCount - 1) . '?'; |
|
209 | + $inSection = str_repeat('?,', $valueCount - 1).'?'; |
|
210 | 210 | |
211 | 211 | $this->whereClause .= " AND {$column} IN ({$inSection})"; |
212 | 212 | $this->parameterList = array_merge($this->parameterList, $values); |