Failed Conditions
Pull Request — oauthcreation (#531)
by Simon
18:38 queued 08:37
created
includes/Router/RequestRouter.php 1 patch
Unused Use Statements   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -15,30 +15,20 @@  discard block
 block discarded – undo
15 15
 use Waca\Pages\PageEmailManagement;
16 16
 use Waca\Pages\PageExpandedRequestList;
17 17
 use Waca\Pages\PageJobQueue;
18
-use Waca\Pages\RequestAction\PageCreateRequest;
19
-use Waca\Pages\UserAuth\Login\PageOtpLogin;
20
-use Waca\Pages\UserAuth\Login\PagePasswordLogin;
21
-use Waca\Pages\UserAuth\Login\PageU2FLogin;
22
-use Waca\Pages\UserAuth\PageChangePassword;
23
-use Waca\Pages\UserAuth\PageForgotPassword;
24 18
 use Waca\Pages\PageLog;
25
-use Waca\Pages\UserAuth\PageLogout;
26 19
 use Waca\Pages\PageMain;
27
-use Waca\Pages\UserAuth\MultiFactor\PageMultiFactor;
28
-use Waca\Pages\UserAuth\PageOAuth;
29
-use Waca\Pages\UserAuth\PageOAuthCallback;
30
-use Waca\Pages\UserAuth\PagePreferences;
31
-use Waca\Pages\Registration\PageRegisterStandard;
32
-use Waca\Pages\Registration\PageRegisterOption;
33 20
 use Waca\Pages\PageSearch;
34 21
 use Waca\Pages\PageSiteNotice;
35 22
 use Waca\Pages\PageTeam;
36 23
 use Waca\Pages\PageUserManagement;
37 24
 use Waca\Pages\PageViewRequest;
38 25
 use Waca\Pages\PageWelcomeTemplateManagement;
26
+use Waca\Pages\Registration\PageRegisterOption;
27
+use Waca\Pages\Registration\PageRegisterStandard;
39 28
 use Waca\Pages\RequestAction\PageBreakReservation;
40 29
 use Waca\Pages\RequestAction\PageCloseRequest;
41 30
 use Waca\Pages\RequestAction\PageComment;
31
+use Waca\Pages\RequestAction\PageCreateRequest;
42 32
 use Waca\Pages\RequestAction\PageCustomClose;
43 33
 use Waca\Pages\RequestAction\PageDeferRequest;
44 34
 use Waca\Pages\RequestAction\PageDropRequest;
@@ -52,6 +42,16 @@  discard block
 block discarded – undo
52 42
 use Waca\Pages\Statistics\StatsTemplateStats;
53 43
 use Waca\Pages\Statistics\StatsTopCreators;
54 44
 use Waca\Pages\Statistics\StatsUsers;
45
+use Waca\Pages\UserAuth\Login\PageOtpLogin;
46
+use Waca\Pages\UserAuth\Login\PagePasswordLogin;
47
+use Waca\Pages\UserAuth\Login\PageU2FLogin;
48
+use Waca\Pages\UserAuth\MultiFactor\PageMultiFactor;
49
+use Waca\Pages\UserAuth\PageChangePassword;
50
+use Waca\Pages\UserAuth\PageForgotPassword;
51
+use Waca\Pages\UserAuth\PageLogout;
52
+use Waca\Pages\UserAuth\PageOAuth;
53
+use Waca\Pages\UserAuth\PageOAuthCallback;
54
+use Waca\Pages\UserAuth\PagePreferences;
55 55
 use Waca\Tasks\IRoutedTask;
56 56
 use Waca\WebRequest;
57 57
 
Please login to merge, or discard this patch.
includes/Security/RoleConfiguration.php 1 patch
Unused Use Statements   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,11 +16,6 @@  discard block
 block discarded – undo
16 16
 use Waca\Pages\PageJobQueue;
17 17
 use Waca\Pages\PageLog;
18 18
 use Waca\Pages\PageMain;
19
-use Waca\Pages\RequestAction\PageCreateRequest;
20
-use Waca\Pages\UserAuth\PageChangePassword;
21
-use Waca\Pages\UserAuth\MultiFactor\PageMultiFactor;
22
-use Waca\Pages\UserAuth\PageOAuth;
23
-use Waca\Pages\UserAuth\PagePreferences;
24 19
 use Waca\Pages\PageSearch;
25 20
 use Waca\Pages\PageSiteNotice;
26 21
 use Waca\Pages\PageTeam;
@@ -30,6 +25,7 @@  discard block
 block discarded – undo
30 25
 use Waca\Pages\RequestAction\PageBreakReservation;
31 26
 use Waca\Pages\RequestAction\PageCloseRequest;
32 27
 use Waca\Pages\RequestAction\PageComment;
28
+use Waca\Pages\RequestAction\PageCreateRequest;
33 29
 use Waca\Pages\RequestAction\PageCustomClose;
34 30
 use Waca\Pages\RequestAction\PageDeferRequest;
35 31
 use Waca\Pages\RequestAction\PageDropRequest;
@@ -43,6 +39,10 @@  discard block
 block discarded – undo
43 39
 use Waca\Pages\Statistics\StatsTemplateStats;
44 40
 use Waca\Pages\Statistics\StatsTopCreators;
45 41
 use Waca\Pages\Statistics\StatsUsers;
42
+use Waca\Pages\UserAuth\MultiFactor\PageMultiFactor;
43
+use Waca\Pages\UserAuth\PageChangePassword;
44
+use Waca\Pages\UserAuth\PageOAuth;
45
+use Waca\Pages\UserAuth\PagePreferences;
46 46
 
47 47
 class RoleConfiguration
48 48
 {
Please login to merge, or discard this patch.
config.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
includes/Pages/UserAuth/Login/LoginCredentialPageBase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)
Please login to merge, or discard this patch.
includes/Pages/UserAuth/Login/PagePasswordLogin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
includes/Security/CredentialProviders/YubikeyOtpCredentialProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
includes/Security/CredentialProviders/U2FCredentialProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@
 block discarded – undo
9 9
 namespace Waca\Security\CredentialProviders;
10 10
 
11 11
 use DateTimeImmutable;
12
-use u2flib_server\Error;
13
-use u2flib_server\U2F;
14 12
 use Waca\DataObjects\User;
15 13
 use Waca\Exceptions\ApplicationLogicException;
16 14
 use Waca\Exceptions\OptimisticLockFailedException;
17 15
 use Waca\PdoDatabase;
18 16
 use Waca\SiteConfiguration;
19 17
 use Waca\WebRequest;
18
+use u2flib_server\Error;
19
+use u2flib_server\U2F;
20 20
 
21 21
 class U2FCredentialProvider extends CredentialProviderBase
22 22
 {
Please login to merge, or discard this patch.
includes/Security/CredentialProviders/CredentialProviderBase.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
includes/Security/CredentialProviders/TotpCredentialProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.