@@ -307,8 +307,9 @@ |
||
| 307 | 307 | * |
| 308 | 308 | * @param string $path The path (relative to the application root) of the file |
| 309 | 309 | */ |
| 310 | - final protected function addJs($path){ |
|
| 311 | - if(in_array($path, $this->extraJs)){ |
|
| 310 | + final protected function addJs($path) |
|
| 311 | + { |
|
| 312 | + if(in_array($path, $this->extraJs)) { |
|
| 312 | 313 | // nothing to do |
| 313 | 314 | return; |
| 314 | 315 | } |
@@ -319,8 +319,8 @@ |
||
| 319 | 319 | * |
| 320 | 320 | * @param string $path The path (relative to the application root) of the file |
| 321 | 321 | */ |
| 322 | - final protected function addJs($path){ |
|
| 323 | - if(in_array($path, $this->extraJs)){ |
|
| 322 | + final protected function addJs($path) { |
|
| 323 | + if (in_array($path, $this->extraJs)) { |
|
| 324 | 324 | // nothing to do |
| 325 | 325 | return; |
| 326 | 326 | } |
@@ -549,7 +549,8 @@ |
||
| 549 | 549 | * |
| 550 | 550 | * @return bool|null |
| 551 | 551 | */ |
| 552 | - public function getForceIdentified() { |
|
| 552 | + public function getForceIdentified() |
|
| 553 | + { |
|
| 553 | 554 | return $this->forceidentified; |
| 554 | 555 | } |
| 555 | 556 | |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | $oauth = new OAuthUserHelper($user, $database, $this->getOAuthProtocolHelper(), $this->getSiteConfiguration()); |
| 148 | 148 | $this->assign('oauth', $oauth); |
| 149 | 149 | |
| 150 | - if($user->getForceIdentified() === null) { |
|
| 150 | + if ($user->getForceIdentified() === null) { |
|
| 151 | 151 | $idVerifier = new IdentificationVerifier($this->getHttpHelper(), $this->getSiteConfiguration(), $this->getDatabase()); |
| 152 | 152 | $this->assign('identificationStatus', $idVerifier->isUserIdentified($user->getOnWikiName()) ? 'detected' : 'missing'); |
| 153 | 153 | } else { |
@@ -150,7 +150,8 @@ |
||
| 150 | 150 | if($user->getForceIdentified() === null) { |
| 151 | 151 | $idVerifier = new IdentificationVerifier($this->getHttpHelper(), $this->getSiteConfiguration(), $this->getDatabase()); |
| 152 | 152 | $this->assign('identificationStatus', $idVerifier->isUserIdentified($user->getOnWikiName()) ? 'detected' : 'missing'); |
| 153 | - } else { |
|
| 153 | + } |
|
| 154 | + else { |
|
| 154 | 155 | $this->assign('identificationStatus', $user->getForceIdentified() == 1 ? 'forced-on' : 'forced-off'); |
| 155 | 156 | } |
| 156 | 157 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | protected function main() |
| 21 | 21 | { |
| 22 | - if(WebRequest::wasPosted()) { |
|
| 22 | + if (WebRequest::wasPosted()) { |
|
| 23 | 23 | Session::destroy(); |
| 24 | 24 | $this->redirect("login"); |
| 25 | 25 | return; |
@@ -193,14 +193,16 @@ |
||
| 193 | 193 | return $this->partiallyLinked; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - public function canCreateAccount() { |
|
| 196 | + public function canCreateAccount() |
|
| 197 | + { |
|
| 197 | 198 | return $this->isFullyLinked() |
| 198 | 199 | && $this->getIdentity(true)->getGrantBasic() |
| 199 | 200 | && $this->getIdentity(true)->getGrantHighVolume() |
| 200 | 201 | && $this->getIdentity(true)->getGrantCreateAccount(); |
| 201 | 202 | } |
| 202 | 203 | |
| 203 | - public function canWelcome() { |
|
| 204 | + public function canWelcome() |
|
| 205 | + { |
|
| 204 | 206 | return $this->isFullyLinked() |
| 205 | 207 | && $this->getIdentity(true)->getGrantBasic() |
| 206 | 208 | && $this->getIdentity(true)->getGrantHighVolume() |
@@ -131,7 +131,8 @@ |
||
| 131 | 131 | $task->setNotificationHelper($this->getNotificationHelper()); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - public static function errorHandler($errno, $errstr, $errfile, $errline) { |
|
| 134 | + public static function errorHandler($errno, $errstr, $errfile, $errline) |
|
| 135 | + { |
|
| 135 | 136 | throw new Exception($errfile . "@" . $errline . ": " . $errstr); |
| 136 | 137 | } |
| 137 | 138 | } |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | // Create a task. |
| 86 | 86 | $taskName = $job->getTask(); |
| 87 | 87 | |
| 88 | - if(!class_exists($taskName)) { |
|
| 88 | + if (!class_exists($taskName)) { |
|
| 89 | 89 | throw new ApplicationLogicException('Job task does not exist'); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | if ($reservationId !== 0 && $reservationId !== null) { |
| 134 | 134 | if ($currentUser->getId() !== $reservationId) { |
| 135 | 135 | SessionAlert::error("Request is reserved by someone else."); |
| 136 | - $this->redirect('/viewRequest', null, ['id' => $request->getId()] ); |
|
| 136 | + $this->redirect('/viewRequest', null, ['id' => $request->getId()]); |
|
| 137 | 137 | return true; |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -30,13 +30,13 @@ |
||
| 30 | 30 | public function authenticate(User $user, $data) |
| 31 | 31 | { |
| 32 | 32 | $storedData = $this->getCredentialData($user->getId()); |
| 33 | - if($storedData === null) |
|
| 33 | + if ($storedData === null) |
|
| 34 | 34 | { |
| 35 | 35 | // No available credential matching these parameters |
| 36 | 36 | return false; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - if($storedData->getVersion() !== 2) { |
|
| 39 | + if ($storedData->getVersion() !== 2) { |
|
| 40 | 40 | // Non-2 versions are not supported. |
| 41 | 41 | return false; |
| 42 | 42 | } |
@@ -30,8 +30,7 @@ |
||
| 30 | 30 | public function authenticate(User $user, $data) |
| 31 | 31 | { |
| 32 | 32 | $storedData = $this->getCredentialData($user->getId()); |
| 33 | - if($storedData === null) |
|
| 34 | - { |
|
| 33 | + if($storedData === null) { |
|
| 35 | 34 | // No available credential matching these parameters |
| 36 | 35 | return false; |
| 37 | 36 | } |
@@ -263,7 +263,7 @@ |
||
| 263 | 263 | "dsrcname" => "mysql:host=" . $toolserver_host . ";dbname=" . $toolserver_database, |
| 264 | 264 | "username" => $toolserver_username, |
| 265 | 265 | "password" => $toolserver_password, |
| 266 | - "options" => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'), |
|
| 266 | + "options" => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4'), |
|
| 267 | 267 | ), |
| 268 | 268 | "wikipedia" => array( |
| 269 | 269 | "dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db, |