@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | $BUbasefile = "backup"; // The basefile's name. |
| 132 | 132 | $BUdir = "/home/project/a/c/c/acc/backups"; // The directory where backups should be stored. |
| 133 | -$BUmonthdir = $BUdir . "/monthly"; // The directory where monthly backups should be stored. |
|
| 133 | +$BUmonthdir = $BUdir."/monthly"; // The directory where monthly backups should be stored. |
|
| 134 | 134 | $BUdumper = "/opt/ts/mysql/5.1/bin/mysqldump --defaults-file=~/.my.cnf p_acc_live"; // Add parameters here if they are needed. |
| 135 | 135 | $BUgzip = "/usr/bin/gzip"; // Add the gzip parameters here if needed. |
| 136 | 136 | $BUtar = "/bin/tar -cvf"; // Add the tar parameters here if needed. |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $curlDisableSSLVerifyPeer = false; |
| 247 | 247 | |
| 248 | 248 | // Change this to be outside the web directory. |
| 249 | -$curlCookieJar = __DIR__ . '/../cookies.txt'; |
|
| 249 | +$curlCookieJar = __DIR__.'/../cookies.txt'; |
|
| 250 | 250 | |
| 251 | 251 | $yubicoApiId = 0; |
| 252 | 252 | $yubicoApiKey = ""; |
@@ -265,17 +265,17 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | $cDatabaseConfig = array( |
| 267 | 267 | "acc" => array( |
| 268 | - "dsrcname" => "mysql:host=" . $toolserver_host . ";dbname=" . $toolserver_database, |
|
| 268 | + "dsrcname" => "mysql:host=".$toolserver_host.";dbname=".$toolserver_database, |
|
| 269 | 269 | "username" => $toolserver_username, |
| 270 | 270 | "password" => $toolserver_password, |
| 271 | 271 | ), |
| 272 | 272 | "wikipedia" => array( |
| 273 | - "dsrcname" => "mysql:host=" . $antispoof_host . ";dbname=" . $antispoof_db, |
|
| 273 | + "dsrcname" => "mysql:host=".$antispoof_host.";dbname=".$antispoof_db, |
|
| 274 | 274 | "username" => $toolserver_username, |
| 275 | 275 | "password" => $toolserver_password, |
| 276 | 276 | ), |
| 277 | 277 | "notifications" => array( |
| 278 | - "dsrcname" => "mysql:host=" . $toolserver_notification_dbhost . ";dbname=" . $toolserver_notification_database, |
|
| 278 | + "dsrcname" => "mysql:host=".$toolserver_notification_dbhost.";dbname=".$toolserver_notification_database, |
|
| 279 | 279 | "username" => $notifications_username, |
| 280 | 280 | "password" => $notifications_password, |
| 281 | 281 | ), |
@@ -305,13 +305,13 @@ discard block |
||
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | // Set up the AutoLoader |
| 308 | -require_once(__DIR__ . "/includes/AutoLoader.php"); |
|
| 308 | +require_once(__DIR__."/includes/AutoLoader.php"); |
|
| 309 | 309 | spl_autoload_register('Waca\\AutoLoader::load'); |
| 310 | -require_once(__DIR__ . '/vendor/autoload.php'); |
|
| 310 | +require_once(__DIR__.'/vendor/autoload.php'); |
|
| 311 | 311 | |
| 312 | 312 | // Extra includes which are just plain awkward wherever they are. |
| 313 | -require_once(__DIR__ . '/lib/mediawiki-extensions-OAuth/lib/OAuth.php'); |
|
| 314 | -require_once(__DIR__ . '/lib/mediawiki-extensions-OAuth/lib/JWT.php'); |
|
| 313 | +require_once(__DIR__.'/lib/mediawiki-extensions-OAuth/lib/OAuth.php'); |
|
| 314 | +require_once(__DIR__.'/lib/mediawiki-extensions-OAuth/lib/JWT.php'); |
|
| 315 | 315 | |
| 316 | 316 | // Crap that's needed for libraries. >:( |
| 317 | 317 | /** |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | SessionAlert::success('Enabled YubiKey OTP.'); |
| 79 | 79 | |
| 80 | 80 | $scratchProvider = new ScratchTokenCredentialProvider($database, $this->getSiteConfiguration()); |
| 81 | - if($scratchProvider->getRemaining($currentUser->getId()) < 3) { |
|
| 81 | + if ($scratchProvider->getRemaining($currentUser->getId()) < 3) { |
|
| 82 | 82 | $scratchProvider->setCredential($currentUser, 2, null); |
| 83 | 83 | $tokens = $scratchProvider->getTokens($currentUser->getId()); |
| 84 | 84 | $this->assign('tokens', $tokens); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | catch (ApplicationLogicException $ex) { |
| 90 | - SessionAlert::error('Error enabling YubiKey OTP: ' . $ex->getMessage()); |
|
| 90 | + SessionAlert::error('Error enabling YubiKey OTP: '.$ex->getMessage()); |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $this->redirect('multiFactor'); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | SessionAlert::success('Enabled TOTP.'); |
| 179 | 179 | |
| 180 | 180 | $scratchProvider = new ScratchTokenCredentialProvider($database, $this->getSiteConfiguration()); |
| 181 | - if($scratchProvider->getRemaining($currentUser->getId()) < 3) { |
|
| 181 | + if ($scratchProvider->getRemaining($currentUser->getId()) < 3) { |
|
| 182 | 182 | $scratchProvider->setCredential($currentUser, 2, null); |
| 183 | 183 | $tokens = $scratchProvider->getTokens($currentUser->getId()); |
| 184 | 184 | $this->assign('tokens', $tokens); |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | list($data, $reqs) = $otpCredentialProvider->getRegistrationData(); |
| 256 | 256 | |
| 257 | - $u2fRequest =json_encode($data); |
|
| 257 | + $u2fRequest = json_encode($data); |
|
| 258 | 258 | $u2fSigns = json_encode($reqs); |
| 259 | 259 | |
| 260 | 260 | $this->addJs('/vendor/yubico/u2flib-server/examples/assets/u2f-api.js'); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | SessionAlert::success('Enabled TOTP.'); |
| 304 | 304 | |
| 305 | 305 | $scratchProvider = new ScratchTokenCredentialProvider($database, $this->getSiteConfiguration()); |
| 306 | - if($scratchProvider->getRemaining($currentUser->getId()) < 3) { |
|
| 306 | + if ($scratchProvider->getRemaining($currentUser->getId()) < 3) { |
|
| 307 | 307 | $scratchProvider->setCredential($currentUser, 2, null); |
| 308 | 308 | $tokens = $scratchProvider->getTokens($currentUser->getId()); |
| 309 | 309 | $this->assign('tokens', $tokens); |
@@ -407,11 +407,11 @@ discard block |
||
| 407 | 407 | |
| 408 | 408 | if ($result) { |
| 409 | 409 | $otpCredentialProvider->deleteCredential($currentUser); |
| 410 | - SessionAlert::success('Disabled ' . $factorType . '.'); |
|
| 410 | + SessionAlert::success('Disabled '.$factorType.'.'); |
|
| 411 | 411 | $this->redirect('multiFactor'); |
| 412 | 412 | } |
| 413 | 413 | else { |
| 414 | - SessionAlert::error('Error disabling ' . $factorType . ' - invalid credentials.'); |
|
| 414 | + SessionAlert::error('Error disabling '.$factorType.' - invalid credentials.'); |
|
| 415 | 415 | $this->redirect('multiFactor'); |
| 416 | 416 | } |
| 417 | 417 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | else { |
| 136 | 136 | // This is the login form, not the request form. We need protection here. |
| 137 | - $this->redirectUrl('https://' . WebRequest::serverName() . WebRequest::requestUri()); |
|
| 137 | + $this->redirectUrl('https://'.WebRequest::serverName().WebRequest::requestUri()); |
|
| 138 | 138 | |
| 139 | 139 | return false; |
| 140 | 140 | } |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | throw new ApplicationLogicException('Unknown page handler for next authentication stage.'); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | - $this->redirect("login/" . $this->nextPageMap[$nextStage]); |
|
| 281 | + $this->redirect("login/".$this->nextPageMap[$nextStage]); |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | private function setupAlternates(User $user, $partialStage, PdoDatabase $database) |
@@ -17,14 +17,14 @@ |
||
| 17 | 17 | { |
| 18 | 18 | list($partialId, $partialStage) = WebRequest::getAuthPartialLogin(); |
| 19 | 19 | |
| 20 | - if($partialId !== null && $partialStage > 1) { |
|
| 20 | + if ($partialId !== null && $partialStage > 1) { |
|
| 21 | 21 | $sql = 'SELECT type FROM credential WHERE user = :user AND factor = :stage AND disabled = 0 ORDER BY priority'; |
| 22 | 22 | $statement = $this->getDatabase()->prepare($sql); |
| 23 | 23 | $statement->execute(array(':user' => $partialId, ':stage' => $partialStage)); |
| 24 | 24 | $nextStage = $statement->fetchColumn(); |
| 25 | 25 | $statement->closeCursor(); |
| 26 | 26 | |
| 27 | - $this->redirect("login/" . $this->nextPageMap[$nextStage]); |
|
| 27 | + $this->redirect("login/".$this->nextPageMap[$nextStage]); |
|
| 28 | 28 | return; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -136,7 +136,7 @@ |
||
| 136 | 136 | |
| 137 | 137 | $data = array(); |
| 138 | 138 | foreach ($apiResponse as $key => $value) { |
| 139 | - $data[] = $key . "=" . $value; |
|
| 139 | + $data[] = $key."=".$value; |
|
| 140 | 140 | } |
| 141 | 141 | $dataString = implode('&', $data); |
| 142 | 142 | |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | { |
| 33 | 33 | parent::__construct($database, $configuration, 'u2f'); |
| 34 | 34 | |
| 35 | - $appId = 'https://' . WebRequest::httpHost(); |
|
| 35 | + $appId = 'https://'.WebRequest::httpHost(); |
|
| 36 | 36 | $this->u2f = new U2F($appId); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ':t' => $this->type |
| 56 | 56 | ); |
| 57 | 57 | |
| 58 | - if($disabled !== null) { |
|
| 58 | + if ($disabled !== null) { |
|
| 59 | 59 | $sql .= ' AND disabled = :d'; |
| 60 | 60 | $parameters[':d'] = $disabled ? 1 : 0; |
| 61 | 61 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $alternates = $statement->fetchColumn(); |
| 110 | 110 | $statement->closeCursor(); |
| 111 | 111 | |
| 112 | - if($alternates <= 1) { |
|
| 112 | + if ($alternates <= 1) { |
|
| 113 | 113 | // decrement the factor for every stage above this |
| 114 | 114 | $sql = 'UPDATE credential SET factor = factor - 1 WHERE user = :user AND factor > :factor'; |
| 115 | 115 | $statement = $this->database->prepare($sql); |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | */ |
| 92 | 92 | public function setCredential(User $user, $factor, $data) |
| 93 | 93 | { |
| 94 | - $issuer = 'ACC - ' . $this->getConfiguration()->getIrcNotificationsInstance(); |
|
| 94 | + $issuer = 'ACC - '.$this->getConfiguration()->getIrcNotificationsInstance(); |
|
| 95 | 95 | $totp = new TOTP($user->getUsername()); |
| 96 | 96 | $totp->setIssuer($issuer); |
| 97 | 97 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | $i = array_search($data, $scratchTokens); |
| 59 | 59 | |
| 60 | - if($i === false) { |
|
| 60 | + if ($i === false) { |
|
| 61 | 61 | return false; |
| 62 | 62 | } |
| 63 | 63 | |