Test Failed
Push — master ( a393f2...e4ce85 )
by Stefan
08:15
created
web/admin/sanity_tests.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 $Tests = [
25 25
     'Directories',
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 $uiElements = new \web\lib\admin\UIElements();
45 45
 
46
-if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || \config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL" ) {
46
+if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL" || \config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == "LOCAL") {
47 47
     $Tests[] = 'Makensis';
48 48
     $Tests[] = 'Makensis=>NSISmodules';
49 49
 }
Please login to merge, or discard this patch.
devices/Devices-template.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
                     'mime' => 'application/eap-config',
398 398
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
399 399
                             "geteduroam",
400
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=app.eduroam.geteduroam'>Google Play</a>, <a target='_blank' href='geteduroam-stable.apk'>" . _("as local download") . "</a>"),
400
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=app.eduroam.geteduroam'>Google Play</a>, <a target='_blank' href='geteduroam-stable.apk'>"._("as local download")."</a>"),
401 401
                 ],
402 402
             ],            
403 403
             
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                     'mime' => 'application/eap-config',
412 412
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
413 413
                             "geteduroam",
414
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=app.eduroam.geteduroam'>Google Play</a>, <a target='_blank' href='geteduroam-stable.apk'>" . _("as local download") . "</a>"),
414
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=app.eduroam.geteduroam'>Google Play</a>, <a target='_blank' href='geteduroam-stable.apk'>"._("as local download")."</a>"),
415 415
                 ],
416 416
             ],  
417 417
             'android_4_7' => [
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                     'mime' => 'application/eap-config',
425 425
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
426 426
                             "eduroamCAT",
427
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
427
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
428 428
                 ],
429 429
             ],            
430 430
             
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
                     'mime' => 'application/eap-config',
440 440
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
441 441
                             "eduroamCAT",
442
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
442
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
443 443
                 ],
444 444
             ],
445 445
             'android_pie' => [
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
                     'mime' => 'application/eap-config',
454 454
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
455 455
                             "eduroamCAT",
456
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
456
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
457 457
                 ],
458 458
             ],
459 459
             'android_oreo' => [
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                     'mime' => 'application/eap-config',
468 468
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
469 469
                             "eduroamCAT",
470
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
470
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
471 471
                 ],
472 472
             ],
473 473
             'android_nougat' => [
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
                     'mime' => 'application/eap-config',
482 482
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
483 483
                             "eduroamCAT",
484
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
484
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
485 485
                 ],
486 486
             ],
487 487
             'android_marshmallow' => [
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
                     'mime' => 'application/eap-config',
496 496
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
497 497
                             "eduroamCAT",
498
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
498
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
499 499
                 ],
500 500
             ],
501 501
             'android_lollipop' => [
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
                     'mime' => 'application/eap-config',
510 510
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
511 511
                             "eduroamCAT",
512
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
512
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
513 513
                 ],
514 514
             ],
515 515
             'android_kitkat' => [
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
                     'mime' => 'application/eap-config',
524 524
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
525 525
                             "eduroamCAT",
526
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
526
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
527 527
                 ],
528 528
             ],
529 529
             'android_43' => [
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
                     'mime' => 'application/eap-config',
538 538
                     'message' => sprintf(_("Before you proceed with installation on Android systems, please make sure that you have installed the %s application. This application is available from these sites: %s and will use the configuration file downloaded from CAT to create all necessary settings."),
539 539
                             "eduroamCAT",
540
-                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>" . _("as local download") . "</a>"),
540
+                            "<a target='_blank' href='https://play.google.com/store/apps/details?id=uk.ac.swansea.eduroamcat'>Google Play</a>, <a target='_blank' href='https://www.amazon.com/dp/B01EACCX0S/'>Amazon Appstore</a>, <a target='_blank' href='eduroamCAT-stable.apk'>"._("as local download")."</a>"),
541 541
                 ],
542 542
             ],
543 543
             'android_legacy' => [
Please login to merge, or discard this patch.
core/AbstractProfile.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType)
135 135
     {
136 136
         if (\config\Master::PATHS['logdir']) {
137
-            $file = fopen(\config\Master::PATHS['logdir'] . "/download_details.log", "a");
137
+            $file = fopen(\config\Master::PATHS['logdir']."/download_details.log", "a");
138 138
             if ($file === FALSE) {
139 139
                 throw new Exception("Unable to open file for append: $file");
140 140
             }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         }
182 182
         foreach ($new->getAttributes("eap:server_name") as $newName) {
183 183
             if (!in_array($newName['value'], $baselineNames)) {
184
-                $retval[AbstractProfile::SERVERNAME_ADDED] .= "#New server name '" . $newName['value'] . "' added";
184
+                $retval[AbstractProfile::SERVERNAME_ADDED] .= "#New server name '".$newName['value']."' added";
185 185
             }
186 186
         }
187 187
         return $retval;
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
             $eaptype = new common\EAP($eapQuery->eap_method_id);
206 206
             $eapTypeArray[] = $eaptype;
207 207
         }
208
-        $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n" . print_r($eapTypeArray, true));
208
+        $this->loggerInstance->debug(4, "This profile supports the following EAP types:\n".print_r($eapTypeArray, true));
209 209
         return $eapTypeArray;
210 210
     }
211 211
 
@@ -287,16 +287,16 @@  discard block
 block discarded – undo
287 287
         if (count($this->getAttributes("internal:checkuser_outer")) > 0) {
288 288
             // we are supposed to use a specific outer username for checks, 
289 289
             // which is different from the outer username we put into installers
290
-            return $this->getAttributes("internal:checkuser_value")[0]['value'] . "@" . $realm;
290
+            return $this->getAttributes("internal:checkuser_value")[0]['value']."@".$realm;
291 291
         }
292 292
         if (count($this->getAttributes("internal:use_anon_outer")) > 0) {
293 293
             // no special check username, but there is an anon outer ID for
294 294
             // installers - so let's use that one
295
-            return $this->getAttributes("internal:anon_local_value")[0]['value'] . "@" . $realm;
295
+            return $this->getAttributes("internal:anon_local_value")[0]['value']."@".$realm;
296 296
         }
297 297
         // okay, no guidance on outer IDs at all - but we need *something* to
298 298
         // test with for the RealmChecks. So:
299
-        return "@" . $realm;
299
+        return "@".$realm;
300 300
     }
301 301
 
302 302
     /**
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
     public function prepShowtime()
749 749
     {
750 750
         $properConfig = $this->readyForShowtime();
751
-        $this->databaseHandle->exec("UPDATE profile SET sufficient_config = " . ($properConfig ? "TRUE" : "FALSE") . " WHERE profile_id = " . $this->identifier);
751
+        $this->databaseHandle->exec("UPDATE profile SET sufficient_config = ".($properConfig ? "TRUE" : "FALSE")." WHERE profile_id = ".$this->identifier);
752 752
 
753 753
         $attribs = $this->getCollapsedAttributes();
754 754
         // if not enough info to go live, set FALSE
Please login to merge, or discard this patch.
core/IdPlist.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
         $allIDPs = ($country != "" ? $handle->exec($query, "s", $country) : $handle->exec($query));
69 69
         $returnarray = [];
70 70
         // SELECTs never return a booleans, always an object
71
-        $i=0;
71
+        $i = 0;
72 72
         while ($queryResult = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allIDPs)) {
73 73
             $i++;
74 74
             $institutionOptions = explode('---', $queryResult->options);
Please login to merge, or discard this patch.
core/diag/RADIUSTests.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             }
168 168
         }
169 169
 
170
-        $this->loggerInstance->debug(4, "RADIUSTests is in opMode " . $this->opMode . ", parameters were: $realm, $outerUsernameForChecks, " . print_r($supportedEapTypes, true));
170
+        $this->loggerInstance->debug(4, "RADIUSTests is in opMode ".$this->opMode.", parameters were: $realm, $outerUsernameForChecks, ".print_r($supportedEapTypes, true));
171 171
         $this->loggerInstance->debug(4, print_r($expectedServerNames, true));
172 172
         $this->loggerInstance->debug(4, print_r($expectedCABundle, true));
173 173
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                 $returnarray[] = RADIUSTests::CERTPROB_WILDCARD_IN_NAME;
258 258
                 continue; // otherwise we'd ALSO complain that it's not a real hostname
259 259
             }
260
-            if ($onename != "" && filter_var("foo@" . idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
260
+            if ($onename != "" && filter_var("foo@".idn_to_ascii($onename), FILTER_VALIDATE_EMAIL) === FALSE) {
261 261
                 $returnarray[] = RADIUSTests::CERTPROB_NOT_A_HOSTNAME;
262 262
             }
263 263
         }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
             $probValue = RADIUSTests::CERTPROB_SHA1_SIGNATURE;
285 285
             $returnarray[] = $probValue;
286 286
         }
287
-        $this->loggerInstance->debug(4, "CERT IS: " . print_r($intermediateCa, TRUE));
287
+        $this->loggerInstance->debug(4, "CERT IS: ".print_r($intermediateCa, TRUE));
288 288
         if ($intermediateCa['basicconstraints_set'] == 0) {
289 289
             $returnarray[] = RADIUSTests::CERTPROB_NO_BASICCONSTRAINTS;
290 290
         }
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
     {
335 335
         // for EAP-TLS to be a viable option, we need to pass a random client cert to make eapol_test happy
336 336
         // the following PEM data is one of the SENSE EAPLab client certs (not secret at all)
337
-        $clientcert = file_get_contents(dirname(__FILE__) . "/clientcert.p12");
337
+        $clientcert = file_get_contents(dirname(__FILE__)."/clientcert.p12");
338 338
         if ($clientcert === FALSE) {
339 339
             throw new Exception("A dummy client cert is part of the source distribution, but could not be loaded!");
340 340
         }
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         if ($this->opMode == self::RADIUS_TEST_OPERATION_MODE_THOROUGH) {
344 344
             return $this->udpLogin($probeindex, $this->supportedEapTypes[0]->getArrayRep(), $this->outerUsernameForChecks, 'eaplab', $opnameCheck, $frag, $clientcert);
345 345
         }
346
-        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@" . $this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
346
+        return $this->udpLogin($probeindex, \core\common\EAP::EAPTYPE_ANY, "cat-connectivity-test@".$this->realm, 'eaplab', $opnameCheck, $frag, $clientcert);
347 347
     }
348 348
 
349 349
     /**
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             return RADIUSTests::CERTPROB_NO_CDP_HTTP;
366 366
         }
367 367
         // first and second sub-match is the full URL... check it
368
-        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1] . $crlUrl[2]));
368
+        $crlcontent = \core\common\OutsideComm::downloadFile(trim($crlUrl[1].$crlUrl[2]));
369 369
         if ($crlcontent === FALSE) {
370 370
             return RADIUSTests::CERTPROB_NO_CRL_AT_CDP_URL;
371 371
         }
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
         // $pem = chunk_split(base64_encode($crlcontent), 64, "\n");
381 381
         // inspired by https://stackoverflow.com/questions/2390604/how-to-pass-variables-as-stdin-into-command-line-from-php
382 382
 
383
-        $proc = \config\Master::PATHS['openssl'] . " crl -inform der";
383
+        $proc = \config\Master::PATHS['openssl']." crl -inform der";
384 384
         $descriptorspec = [
385 385
             0 => ["pipe", "r"],
386 386
             1 => ["pipe", "w"],
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
         $origLength = strlen($hex);
420 420
         for ($i = 1; $i < $origLength; $i++) {
421 421
             if ($i % 2 == 1 && $i != strlen($hex)) {
422
-                $spaced .= $hex[$i] . " ";
422
+                $spaced .= $hex[$i]." ";
423 423
             } else {
424 424
                 $spaced .= $hex[$i];
425 425
             }
@@ -547,19 +547,19 @@  discard block
 block discarded – undo
547 547
         $eapText = \core\common\EAP::eapDisplayName($eaptype);
548 548
         $config = '
549 549
 network={
550
-  ssid="' . \config\Master::APPEARANCE['productname'] . ' testing"
550
+  ssid="' . \config\Master::APPEARANCE['productname'].' testing"
551 551
   key_mgmt=WPA-EAP
552 552
   proto=WPA2
553 553
   pairwise=CCMP
554 554
   group=CCMP
555 555
   ';
556 556
 // phase 1
557
-        $config .= 'eap=' . $eapText['OUTER'] . "\n";
557
+        $config .= 'eap='.$eapText['OUTER']."\n";
558 558
         $logConfig = $config;
559 559
 // phase 2 if applicable; all inner methods have passwords
560 560
         if (isset($eapText['INNER']) && $eapText['INNER'] != "") {
561
-            $config .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
562
-            $logConfig .= '  phase2="auth=' . $eapText['INNER'] . "\"\n";
561
+            $config .= '  phase2="auth='.$eapText['INNER']."\"\n";
562
+            $logConfig .= '  phase2="auth='.$eapText['INNER']."\"\n";
563 563
         }
564 564
 // all methods set a password, except EAP-TLS
565 565
         if ($eaptype != \core\common\EAP::EAPTYPE_TLS) {
@@ -575,11 +575,11 @@  discard block
 block discarded – undo
575 575
         }
576 576
 
577 577
 // inner identity
578
-        $config .= '  identity="' . $inner . "\"\n";
579
-        $logConfig .= '  identity="' . $inner . "\"\n";
578
+        $config .= '  identity="'.$inner."\"\n";
579
+        $logConfig .= '  identity="'.$inner."\"\n";
580 580
 // outer identity, may be equal
581
-        $config .= '  anonymous_identity="' . $outer . "\"\n";
582
-        $logConfig .= '  anonymous_identity="' . $outer . "\"\n";
581
+        $config .= '  anonymous_identity="'.$outer."\"\n";
582
+        $logConfig .= '  anonymous_identity="'.$outer."\"\n";
583 583
 // done
584 584
         $config .= "}";
585 585
         $logConfig .= "}";
@@ -642,13 +642,13 @@  discard block
 block discarded – undo
642 642
      */
643 643
     private function eapolTestConfig($probeindex, $opName, $frag)
644 644
     {
645
-        $cmdline = \config\Diagnostics::PATHS['eapol_test'] .
646
-                " -a " . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['ip'] .
647
-                " -s " . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['secret'] .
648
-                " -o serverchain.pem" .
649
-                " -c ./udp_login_test.conf" .
650
-                " -M 22:44:66:CA:20:" . sprintf("%02d", $probeindex) . " " .
651
-                " -t " . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['timeout'] . " ";
645
+        $cmdline = \config\Diagnostics::PATHS['eapol_test'].
646
+                " -a ".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['ip'].
647
+                " -s ".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['secret'].
648
+                " -o serverchain.pem".
649
+                " -c ./udp_login_test.conf".
650
+                " -M 22:44:66:CA:20:".sprintf("%02d", $probeindex)." ".
651
+                " -t ".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$probeindex]['timeout']." ";
652 652
         if ($opName) {
653 653
             $cmdline .= '-N126:s:"1cat.eduroam.org" ';
654 654
         }
@@ -678,10 +678,10 @@  discard block
 block discarded – undo
678 678
      */
679 679
     private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs)
680 680
     {
681
-        if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) {
681
+        if (!mkdir($tmpDir."/root-ca-allcerts/", 0700, true)) {
682 682
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n");
683 683
         }
684
-        if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) {
684
+        if (!mkdir($tmpDir."/root-ca-eaponly/", 0700, true)) {
685 685
             throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-eaponly/\n");
686 686
         }
687 687
 // make a copy of the EAP-received chain and add the configured intermediates, if any
@@ -695,15 +695,15 @@  discard block
 block discarded – undo
695 695
             }
696 696
             if ($decoded['ca'] == 1) {
697 697
                 if ($decoded['root'] == 1) { // save CAT roots to the root directory
698
-                    file_put_contents($tmpDir . "/root-ca-eaponly/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
699
-                    file_put_contents($tmpDir . "/root-ca-allcerts/configuredroot" . count($catRoots) . ".pem", $decoded['pem']);
698
+                    file_put_contents($tmpDir."/root-ca-eaponly/configuredroot".count($catRoots).".pem", $decoded['pem']);
699
+                    file_put_contents($tmpDir."/root-ca-allcerts/configuredroot".count($catRoots).".pem", $decoded['pem']);
700 700
                     $catRoots[] = $decoded['pem'];
701 701
                 } else { // save the intermediates to allcerts directory
702
-                    file_put_contents($tmpDir . "/root-ca-allcerts/cat-intermediate" . count($catIntermediates) . ".pem", $decoded['pem']);
702
+                    file_put_contents($tmpDir."/root-ca-allcerts/cat-intermediate".count($catIntermediates).".pem", $decoded['pem']);
703 703
                     $intermOdditiesCAT = array_merge($intermOdditiesCAT, $this->propertyCheckIntermediate($decoded));
704 704
                     if (isset($decoded['CRL']) && isset($decoded['CRL'][0])) {
705 705
                         $this->loggerInstance->debug(4, "got an intermediate CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
706
-                        file_put_contents($tmpDir . "/root-ca-allcerts/crl_cat" . count($catIntermediates) . ".pem", $decoded['CRL'][0]);
706
+                        file_put_contents($tmpDir."/root-ca-allcerts/crl_cat".count($catIntermediates).".pem", $decoded['CRL'][0]);
707 707
                     }
708 708
                     $catIntermediates[] = $decoded['pem'];
709 709
                 }
@@ -712,26 +712,26 @@  discard block
 block discarded – undo
712 712
         // save all intermediate certificates and CRLs to separate files in 
713 713
         // both root-ca directories
714 714
         foreach ($eapIntermediates as $index => $onePem) {
715
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediate$index.pem", $onePem);
716
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediate$index.pem", $onePem);
715
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediate$index.pem", $onePem);
716
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediate$index.pem", $onePem);
717 717
         }
718 718
         foreach ($eapIntermediateCRLs as $index => $onePem) {
719
-            file_put_contents($tmpDir . "/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
720
-            file_put_contents($tmpDir . "/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
719
+            file_put_contents($tmpDir."/root-ca-eaponly/intermediateCRL$index.pem", $onePem);
720
+            file_put_contents($tmpDir."/root-ca-allcerts/intermediateCRL$index.pem", $onePem);
721 721
         }
722 722
 
723 723
         $checkstring = "";
724 724
         if (isset($servercert['CRL']) && isset($servercert['CRL'][0])) {
725 725
             $this->loggerInstance->debug(4, "got a server CRL; adding them to the chain checks. (Remember: checking end-entity cert only, not the whole chain");
726 726
             $checkstring = "-crl_check_all";
727
-            file_put_contents($tmpDir . "/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
728
-            file_put_contents($tmpDir . "/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
727
+            file_put_contents($tmpDir."/root-ca-eaponly/crl-server.pem", $servercert['CRL'][0]);
728
+            file_put_contents($tmpDir."/root-ca-allcerts/crl-server.pem", $servercert['CRL'][0]);
729 729
         }
730 730
 
731 731
 
732 732
 // now c_rehash the root CA directory ...
733
-        system(\config\Diagnostics::PATHS['c_rehash'] . " $tmpDir/root-ca-eaponly/ > /dev/null");
734
-        system(\config\Diagnostics::PATHS['c_rehash'] . " $tmpDir/root-ca-allcerts/ > /dev/null");
733
+        system(\config\Diagnostics::PATHS['c_rehash']." $tmpDir/root-ca-eaponly/ > /dev/null");
734
+        system(\config\Diagnostics::PATHS['c_rehash']." $tmpDir/root-ca-allcerts/ > /dev/null");
735 735
         return $checkstring;
736 736
     }
737 737
 
@@ -764,12 +764,12 @@  discard block
 block discarded – undo
764 764
 // so test if there's something PEMy in the file at all
765 765
 // serverchain.pem is the output from eapol_test; incomingserver.pem is written by extractIncomingCertsfromEAP() if there was at least one server cert.
766 766
         if (filesize("$tmpDir/serverchain.pem") > 10 && filesize("$tmpDir/incomingserver.pem") > 10) {
767
-            exec(\config\Master::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
768
-            $this->loggerInstance->debug(4, \config\Master::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
769
-            $this->loggerInstance->debug(4, "Chain verify pass 1: " . print_r($verifyResultEaponly, TRUE) . "\n");
770
-            exec(\config\Master::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
771
-            $this->loggerInstance->debug(4, \config\Master::PATHS['openssl'] . " verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
772
-            $this->loggerInstance->debug(4, "Chain verify pass 2: " . print_r($verifyResultAllcerts, TRUE) . "\n");
767
+            exec(\config\Master::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/incomingserver.pem", $verifyResultEaponly);
768
+            $this->loggerInstance->debug(4, \config\Master::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-eaponly/ -purpose any $tmpDir/serverchain.pem\n");
769
+            $this->loggerInstance->debug(4, "Chain verify pass 1: ".print_r($verifyResultEaponly, TRUE)."\n");
770
+            exec(\config\Master::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/incomingserver.pem", $verifyResultAllcerts);
771
+            $this->loggerInstance->debug(4, \config\Master::PATHS['openssl']." verify $crlCheckString -CApath $tmpDir/root-ca-allcerts/ -purpose any $tmpDir/serverchain.pem\n");
772
+            $this->loggerInstance->debug(4, "Chain verify pass 2: ".print_r($verifyResultAllcerts, TRUE)."\n");
773 773
         }
774 774
 
775 775
 // now we do certificate verification against the collected parents
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
         // we are UNHAPPY if no names match!
836 836
         $happiness = "UNHAPPY";
837 837
         foreach ($this->expectedServerNames as $expectedName) {
838
-            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: " . print_r($servercert['CN'], TRUE) . print_r($servercert['sAN_DNS'], TRUE));
838
+            $this->loggerInstance->debug(4, "Managing expectations for $expectedName: ".print_r($servercert['CN'], TRUE).print_r($servercert['sAN_DNS'], TRUE));
839 839
             if (array_search($expectedName, $servercert['CN']) !== FALSE && array_search($expectedName, $servercert['sAN_DNS']) !== FALSE) {
840 840
                 $this->loggerInstance->debug(4, "Totally happy!");
841 841
                 $happiness = "TOTALLY";
@@ -880,11 +880,11 @@  discard block
 block discarded – undo
880 880
         $theconfigs = $this->wpaSupplicantConfig($eaptype, $finalInner, $finalOuter, $password);
881 881
         // the config intentionally does not include CA checking. We do this
882 882
         // ourselves after getting the chain with -o.
883
-        file_put_contents($tmpDir . "/udp_login_test.conf", $theconfigs[0]);
883
+        file_put_contents($tmpDir."/udp_login_test.conf", $theconfigs[0]);
884 884
 
885 885
         $cmdline = $this->eapolTestConfig($probeindex, $opnameCheck, $frag);
886 886
         $this->loggerInstance->debug(4, "Shallow reachability check cmdline: $cmdline\n");
887
-        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n" . $theconfigs[1] . "\n");
887
+        $this->loggerInstance->debug(4, "Shallow reachability check config: $tmpDir\n".$theconfigs[1]."\n");
888 888
         $time_start = microtime(true);
889 889
         $pflow = [];
890 890
         exec($cmdline, $pflow);
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
         }
894 894
         $time_stop = microtime(true);
895 895
         $output = print_r($this->redact($password, $pflow), TRUE);
896
-        file_put_contents($tmpDir . "/eapol_test_output_redacted_$probeindex.txt", $output);
896
+        file_put_contents($tmpDir."/eapol_test_output_redacted_$probeindex.txt", $output);
897 897
         $this->loggerInstance->debug(5, "eapol_test output saved to eapol_test_output_redacted_$probeindex.txt\n");
898 898
         return [
899 899
             "time" => ($time_stop - $time_start) * 1000,
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
         if ($packetflow[count($packetflow) - 1] == 3 && $this->checkLineparse($packetflow_orig, self::LINEPARSE_CHECK_REJECTIGNORE)) {
931 931
             array_pop($packetflow);
932 932
         }
933
-        $this->loggerInstance->debug(5, "Packetflow: " . print_r($packetflow, TRUE));
933
+        $this->loggerInstance->debug(5, "Packetflow: ".print_r($packetflow, TRUE));
934 934
         $packetcount = array_count_values($packetflow);
935 935
         $testresults['packetcount'] = $packetcount;
936 936
         $testresults['packetflow'] = $packetflow;
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
     private function wasModernTlsNegotiated(&$testresults, $packetflow_orig)
973 973
     {
974 974
         $negotiatedTlsVersion = $this->checkLineparse($packetflow_orig, self::LINEPARSE_TLSVERSION);
975
-        $this->loggerInstance->debug(4, "TLS version found is: $negotiatedTlsVersion" . "\n");
975
+        $this->loggerInstance->debug(4, "TLS version found is: $negotiatedTlsVersion"."\n");
976 976
         if ($negotiatedTlsVersion === FALSE) {
977 977
             $testresults['cert_oddities'][] = RADIUSTests::TLSPROB_UNKNOWN_TLS_VERSION;
978 978
         } elseif ($negotiatedTlsVersion != self::TLS_VERSION_1_2 && $negotiatedTlsVersion != self::TLS_VERSION_1_3) {
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 
1033 1033
         $x509 = new \core\common\X509();
1034 1034
 // $eap_certarray holds all certs received in EAP conversation
1035
-        $incomingData = file_get_contents($tmpDir . "/serverchain.pem");
1035
+        $incomingData = file_get_contents($tmpDir."/serverchain.pem");
1036 1036
         if ($incomingData !== FALSE && strlen($incomingData) > 0) {
1037 1037
             $eapCertArray = $x509->splitCertificate($incomingData);
1038 1038
         } else {
@@ -1062,10 +1062,10 @@  discard block
 block discarded – undo
1062 1062
                 case RADIUSTests::SERVER_CA_SELFSIGNED:
1063 1063
                     $servercert[] = $cert;
1064 1064
                     if (count($servercert) == 1) {
1065
-                        if (file_put_contents($tmpDir . "/incomingserver.pem", $cert['pem'] . "\n") === FALSE) {
1065
+                        if (file_put_contents($tmpDir."/incomingserver.pem", $cert['pem']."\n") === FALSE) {
1066 1066
                             $this->loggerInstance->debug(4, "The (first) server certificate could not be written to $tmpDir/incomingserver.pem!\n");
1067 1067
                         }
1068
-                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: " . print_r($servercert[0], true));
1068
+                        $this->loggerInstance->debug(4, "This is the (first) server certificate, with CRL content if applicable: ".print_r($servercert[0], true));
1069 1069
                     } elseif (!in_array(RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS, $testresults['cert_oddities'])) {
1070 1070
                         $testresults['cert_oddities'][] = RADIUSTests::CERTPROB_TOO_MANY_SERVER_CERTS;
1071 1071
                     }
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
         chdir($tmpDir);
1147 1147
         $this->loggerInstance->debug(4, "temp dir: $tmpDir\n");
1148 1148
         if ($clientcertdata !== NULL) {
1149
-            file_put_contents($tmpDir . "/client.p12", $clientcertdata);
1149
+            file_put_contents($tmpDir."/client.p12", $clientcertdata);
1150 1150
         }
1151 1151
         $testresults = [];
1152 1152
         // initialise the sub-array for cleaner parsing
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
                     'issuer' => $this->printDN($certdata['issuer']),
1254 1254
                     'validFrom' => $this->printTm($certdata['validFrom_time_t']),
1255 1255
                     'validTo' => $this->printTm($certdata['validTo_time_t']),
1256
-                    'serialNumber' => $certdata['serialNumber'] . sprintf(" (0x%X)", $certdata['serialNumber']),
1256
+                    'serialNumber' => $certdata['serialNumber'].sprintf(" (0x%X)", $certdata['serialNumber']),
1257 1257
                     'sha1' => $certdata['sha1'],
1258 1258
                     'extensions' => $certdata['extensions']
1259 1259
                 ];
Please login to merge, or discard this patch.
core/DeviceConfig.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     protected function setSupportedEapMethods($eapArray)
86 86
     {
87 87
         $this->supportedEapMethods = $eapArray;
88
-        $this->loggerInstance->debug(4, "This device (" . __CLASS__ . ") supports the following EAP methods: ");
88
+        $this->loggerInstance->debug(4, "This device (".__CLASS__.") supports the following EAP methods: ");
89 89
         $this->loggerInstance->debug(4, $this->supportedEapMethods);
90 90
     }
91 91
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                     break 2;
138 138
                 }
139 139
             }
140
-            $longestSuffix = $candidate . $longestSuffix;
140
+            $longestSuffix = $candidate.$longestSuffix;
141 141
         }
142 142
         return $longestSuffix;
143 143
     }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             throw new Exception("No EAP type available.");
176 176
         }
177 177
         $this->attributes = $this->getProfileAttributes($profile);
178
-        $this->deviceUUID = common\Entity::uuid('', 'CAT' . $profile->institution . "-" . $profile->identifier . "-" . $this->device_id);
178
+        $this->deviceUUID = common\Entity::uuid('', 'CAT'.$profile->institution."-".$profile->identifier."-".$this->device_id);
179 179
 
180 180
 
181 181
         // if we are instantiating a Silverbullet profile AND have been given
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
         // create temporary directory, its full path will be saved in $this->FPATH;
201 201
         $tempDir = \core\common\Entity::createTemporaryDirectory($purpose);
202 202
         $this->FPATH = $tempDir['dir'];
203
-        mkdir($tempDir['dir'] . '/tmp');
204
-        chdir($tempDir['dir'] . '/tmp');
203
+        mkdir($tempDir['dir'].'/tmp');
204
+        chdir($tempDir['dir'].'/tmp');
205 205
         $caList = [];
206 206
         $x509 = new \core\common\X509();
207 207
         if (isset($this->attributes['eap:ca_file'])) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         $this->support_url_substitute = sprintf(_("your local %s support page"), \config\ConfAssistant::CONSORTIUM['display_name']);
240 240
 
241 241
         if ($this->signer && $this->options['sign']) {
242
-            $this->sign = ROOT . '/signer/' . $this->signer;
242
+            $this->sign = ROOT.'/signer/'.$this->signer;
243 243
         }
244 244
         $this->installerBasename = $this->getInstallerBasename();
245 245
         common\Entity::outOfThePotatoes();
@@ -299,10 +299,10 @@  discard block
 block discarded – undo
299 299
      */
300 300
     protected function findSourceFile($file)
301 301
     {
302
-        if (is_file($this->module_path . '/Files/' . $this->device_id . '/' . $file)) {
303
-            return $this->module_path . '/Files/' . $this->device_id . '/' . $file;
304
-        } elseif (is_file($this->module_path . '/Files/' . $file)) {
305
-            return $this->module_path . '/Files/' . $file;
302
+        if (is_file($this->module_path.'/Files/'.$this->device_id.'/'.$file)) {
303
+            return $this->module_path.'/Files/'.$this->device_id.'/'.$file;
304
+        } elseif (is_file($this->module_path.'/Files/'.$file)) {
305
+            return $this->module_path.'/Files/'.$file;
306 306
         } else {
307 307
             $this->loggerInstance->debug(2, "requested file $file does not exist\n");
308 308
             return FALSE;
@@ -426,19 +426,19 @@  discard block
 block discarded – undo
426 426
      */
427 427
     private function getInstallerBasename()
428 428
     {
429
-        $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name']) . "-" . $this->getDeviceId();
429
+        $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name'])."-".$this->getDeviceId();
430 430
         if (isset($this->attributes['profile:customsuffix'][1])) {
431 431
             // this string will end up as a filename on a filesystem, so always
432 432
             // take a latin-based language variant if available
433 433
             // and then scrub non-ASCII just in case
434
-            return $baseName . $this->customTranslit($this->attributes['profile:customsuffix'][1]);
434
+            return $baseName.$this->customTranslit($this->attributes['profile:customsuffix'][1]);
435 435
         }
436 436
         // Okay, no custom suffix. 
437 437
         // Use the configured inst name and apply shortening heuristics
438 438
         // if an instshortname is set, base on that, otherwise, the normal instname
439 439
         $attribToUse = (isset($this->attributes['general:instshortname']) ? 'general:instshortname' : 'general:instname');
440 440
         $lang_pointer = \config\Master::LANGUAGES[$this->languageInstance->getLang()]['latin_based'] == TRUE ? 0 : 1;
441
-        $this->loggerInstance->debug(5, "getInstallerBasename1:" . $this->attributes[$attribToUse][$lang_pointer] . "\n");
441
+        $this->loggerInstance->debug(5, "getInstallerBasename1:".$this->attributes[$attribToUse][$lang_pointer]."\n");
442 442
         $inst = $this->customTranslit($this->attributes[$attribToUse][$lang_pointer]);
443 443
         $this->loggerInstance->debug(4, "getInstallerBasename2:$inst\n");
444 444
         $Inst_a = explode('_', $inst);
@@ -453,10 +453,10 @@  discard block
 block discarded – undo
453 453
             if (!empty($this->attributes['profile:name']) && !empty($this->attributes['profile:name'][$lang_pointer])) {
454 454
                 $profTemp = $this->customTranslit($this->attributes['profile:name'][$lang_pointer]);
455 455
                 $prof = preg_replace('/_+$/', '', $profTemp);
456
-                return $baseName . $inst . '-' . $prof;
456
+                return $baseName.$inst.'-'.$prof;
457 457
             }
458 458
         }
459
-        return $baseName . $inst;
459
+        return $baseName.$inst;
460 460
     }
461 461
 
462 462
     /**
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
                 $ext = 'unsupported';
641 641
             }
642 642
             $this->loggerInstance->debug(5, "saveLogoFile: $mime : $ext\n");
643
-            $fileName = 'logo-' . $type . $iterator . '.' . $ext;
643
+            $fileName = 'logo-'.$type.$iterator.'.'.$ext;
644 644
             $fileHandle = fopen($fileName, "w");
645 645
             if (!$fileHandle) {
646 646
                 $this->loggerInstance->debug(2, "saveLogoFile failed for: $fileName\n");
@@ -667,13 +667,13 @@  discard block
 block discarded – undo
667 667
         $mime = $finfo->buffer($blob);
668 668
         $ext = isset($this->mime_extensions[$mime]) ? $this->mime_extensions[$mime] : 'usupported';
669 669
         $this->loggerInstance->debug(5, "saveInfoFile: $mime : $ext\n");
670
-        $fileHandle = fopen('local-info.' . $ext, "w");
670
+        $fileHandle = fopen('local-info.'.$ext, "w");
671 671
         if ($fileHandle === FALSE) {
672 672
             throw new Exception("problem opening the file");
673 673
         }
674 674
         fwrite($fileHandle, $blob);
675 675
         fclose($fileHandle);
676
-        return(['name' => 'local-info.' . $ext, 'mime' => $ext]);
676
+        return(['name' => 'local-info.'.$ext, 'mime' => $ext]);
677 677
     }
678 678
 
679 679
     /**
@@ -727,9 +727,9 @@  discard block
 block discarded – undo
727 727
     {
728 728
         $outerId = NULL;
729 729
         if (isset($this->attributes['internal:use_anon_outer']) && $this->attributes['internal:use_anon_outer'][0] == "1" && isset($this->attributes['internal:realm'])) {
730
-            $outerId = "@" . $this->attributes['internal:realm'][0];
730
+            $outerId = "@".$this->attributes['internal:realm'][0];
731 731
             if (isset($this->attributes['internal:anon_local_value'])) {
732
-                $outerId = $this->attributes['internal:anon_local_value'][0] . $outerId;
732
+                $outerId = $this->attributes['internal:anon_local_value'][0].$outerId;
733 733
             }
734 734
         }
735 735
         return $outerId;
Please login to merge, or discard this patch.
core/ProfileRADIUS.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -116,9 +116,9 @@  discard block
 block discarded – undo
116 116
 
117 117
         $attributesLowLevel = array_merge($this->deviceLevelAttributes, $this->eapLevelAttributes);
118 118
 
119
-        $this->loggerInstance->debug(5, "Device-Level Attributes: " . print_r($this->deviceLevelAttributes, true));
120
-        $this->loggerInstance->debug(5, "EAP-Level Attributes: " . print_r($this->eapLevelAttributes, true));
121
-        $this->loggerInstance->debug(5, "All low-Level Attributes: " . print_r($attributesLowLevel, true));
119
+        $this->loggerInstance->debug(5, "Device-Level Attributes: ".print_r($this->deviceLevelAttributes, true));
120
+        $this->loggerInstance->debug(5, "EAP-Level Attributes: ".print_r($this->eapLevelAttributes, true));
121
+        $this->loggerInstance->debug(5, "All low-Level Attributes: ".print_r($attributesLowLevel, true));
122 122
 
123 123
         // now fetch and merge profile-level attributes if not already set on deeper level
124 124
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             }
138 138
         }
139 139
 
140
-        $this->loggerInstance->debug(5, "Merged Attributes: " . print_r($attributesLowLevel, true));
140
+        $this->loggerInstance->debug(5, "Merged Attributes: ".print_r($attributesLowLevel, true));
141 141
 
142 142
         // now, fetch and merge IdP-wide attributes
143 143
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                 "row" => $attributeQuery->row,
194 194
                 "flag" => $optinfo['flag'],
195 195
                 "device" => ($devicesOrEAPMethods == "DEVICES" ? $attributeQuery->deviceormethod : NULL),
196
-                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep() )];
196
+                "eapmethod" => ($devicesOrEAPMethods == "DEVICES" ? 0 : (new \core\common\EAP($attributeQuery->deviceormethod))->getArrayRep())];
197 197
         }
198 198
         return $temparray;
199 199
     }
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public function setAnonymousIDSupport($shallwe)
304 304
     {
305
-        $this->databaseHandle->exec("UPDATE profile SET use_anon_outer = " . ($shallwe === true ? "1" : "0") . " WHERE profile_id = $this->identifier");
305
+        $this->databaseHandle->exec("UPDATE profile SET use_anon_outer = ".($shallwe === true ? "1" : "0")." WHERE profile_id = $this->identifier");
306 306
     }
307 307
 
308 308
     /** Toggle special username for realm checks
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
      * @return void
313 313
      */
314 314
     public function setRealmCheckUser($shallwe, $localpart = NULL) {
315
-        $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = " . ($shallwe === true ? "1" : "0") . " WHERE profile_id = $this->identifier");
315
+        $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = ".($shallwe === true ? "1" : "0")." WHERE profile_id = $this->identifier");
316 316
         if ($localpart !== NULL) {
317 317
             $this->databaseHandle->exec("UPDATE profile SET checkuser_value = ? WHERE profile_id = $this->identifier", "s", $localpart);
318 318
         }
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
      */
328 328
     public function setInputVerificationPreference($verify, $hint)
329 329
     {
330
-        $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = " . ($verify === true ? "1" : "0") .
331
-                ", hint_userinput_suffix = " . ($hint === true ? "1" : "0") .
330
+        $this->databaseHandle->exec("UPDATE profile SET verify_userinput_suffix = ".($verify === true ? "1" : "0").
331
+                ", hint_userinput_suffix = ".($hint === true ? "1" : "0").
332 332
                 " WHERE profile_id = $this->identifier");
333 333
     }
334 334
 
Please login to merge, or discard this patch.
devices/ms/Files/common.inc 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -141,10 +141,10 @@  discard block
 block discarded – undo
141 141
 !define MUI_HEADERIMAGE_BITMAP "cat_150.bmp"
142 142
 !define MUI_COMPONENTSPAGE_SMALLDESC
143 143
 
144
-!define WELCOME_HEADER "<?php printf(WindowsCommon::sprintNsis(_("Welcome to the %s installer")),\config\ConfAssistant::CONSORTIUM['display_name'])?>"
145
-!define FAREWELL_HEADER "<?php WindowsCommon::echoNsis( _("Installation complete"))?>"
146
-!define FAREWELL_TEXT	"<?php WindowsCommon::echoNsis( _("Network profiles have been installed."))?>$\r$\n$\n <?php WindowsCommon::echoNsis(  _("Your system is ready."))?>"
147
-!define FAREWELL_FAIL	"<?php WindowsCommon::echoNsis( _("Network installation had errors."))?>$\r$\n$\n <?php WindowsCommon::echoNsis( _("Please contact \${SUPPORT}."))?>"
144
+!define WELCOME_HEADER "<?php printf(WindowsCommon::sprintNsis(_("Welcome to the %s installer")), \config\ConfAssistant::CONSORTIUM['display_name'])?>"
145
+!define FAREWELL_HEADER "<?php WindowsCommon::echoNsis(_("Installation complete"))?>"
146
+!define FAREWELL_TEXT	"<?php WindowsCommon::echoNsis(_("Network profiles have been installed."))?>$\r$\n$\n <?php WindowsCommon::echoNsis(_("Your system is ready."))?>"
147
+!define FAREWELL_FAIL	"<?php WindowsCommon::echoNsis(_("Network installation had errors."))?>$\r$\n$\n <?php WindowsCommon::echoNsis(_("Please contact \${SUPPORT}."))?>"
148 148
 ;--------------------------------
149 149
 ;Languages
150 150
 !insertmacro MUI_LANGUAGE "${LANG}"
@@ -152,14 +152,14 @@  discard block
 block discarded – undo
152 152
 ;--------------------------------
153 153
 ; License file
154 154
 !ifdef LICENSE_FILE
155
-LicenseForceSelection checkbox "<?php WindowsCommon::echoNsis( _("Accept"))?>"
155
+LicenseForceSelection checkbox "<?php WindowsCommon::echoNsis(_("Accept"))?>"
156 156
 LicenseText "<?php WindowsCommon::echoNsis(_("If you accept the conditions then select Accept and then click Install to continue."))?>"
157 157
 LicenseData ${LICENSE_FILE}
158 158
 !endif
159 159
 
160 160
 ;-----------------------------------
161 161
 
162
-MiscButtonText "" "" "" "<?php WindowsCommon::echoNsis( _("Finish"))?>"
162
+MiscButtonText "" "" "" "<?php WindowsCommon::echoNsis(_("Finish"))?>"
163 163
 ;----------------------------------
164 164
 ;  FUNCTIONS
165 165
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
 !macro install_ca_cert ca_file ca_fingerprint level
194 194
    !insertmacro debug_cat 2 "locating certificate  SHA=${ca_fingerprint} Level=${level}"
195
-   DetailPrint "<?php WindowsCommon::echoNsis( _("searching for certificate"))?> ${ca_file}"
195
+   DetailPrint "<?php WindowsCommon::echoNsis(_("searching for certificate"))?> ${ca_file}"
196 196
    File "${ca_file}"
197 197
    nsArray::Set Delete_files "${ca_file}"
198 198
    !insertmacro debug_cat 2 "Testing machine store root"
@@ -254,13 +254,13 @@  discard block
 block discarded – undo
254 254
    ${EndIf}
255 255
    !insertmacro debug_cat 2 "installing certificate $TEMP\${ca_file}"
256 256
    !insertmacro debug_cat 3 "Execute: certutil -addstore -user ${level} $TEMP\${ca_file}"
257
-   DetailPrint "<?php WindowsCommon::echoNsis( _("installing certificate"))?> ${ca_file}"
257
+   DetailPrint "<?php WindowsCommon::echoNsis(_("installing certificate"))?> ${ca_file}"
258 258
    nsExec::Exec '"certutil" -addstore -user ${level} "$TEMP"\${ca_file}'
259 259
    Pop $0
260 260
    !insertmacro debug_cat 3 "certutil returned $0"
261 261
    ${If} $0 != 0
262 262
      IfSilent +2
263
-     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echoNsis( _("could not install certificate"))?>  ${ca_file}"
263
+     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echoNsis(_("could not install certificate"))?>  ${ca_file}"
264 264
      !insertmacro debug_cat 1 "could not install certificate ${ca_file}"
265 265
    ${EndIf}
266 266
 no_install_${ca_file}:
@@ -467,26 +467,26 @@  discard block
 block discarded – undo
467 467
   pop $R0
468 468
   ${If} $tkip_count > 0
469 469
     ${If} $aes_count > 1
470
-      StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echoNsis( _("The non TKIP profiles are preferred. Always use them if you have a choice."))?>"
470
+      StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echoNsis(_("The non TKIP profiles are preferred. Always use them if you have a choice."))?>"
471 471
     ${Else}
472
-     StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echoNsis( _("The non TKIP profile is preferred. Always use it if you have a choice."))?>"
472
+     StrCpy $R1 "$\r$\n$\n<?php WindowsCommon::echoNsis(_("The non TKIP profile is preferred. Always use it if you have a choice."))?>"
473 473
     ${EndIf}
474 474
   ${Else}
475 475
     StrCpy $R1 ""
476 476
   ${EndIf}
477 477
   ${If} $profile_count > 0
478
-    StrCpy $welcome_message "<?php WindowsCommon::echoNsis( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
479
-<?php WindowsCommon::echoNsis( _("The installer will create the following wireless profiles:"))?>$\r$\n\
478
+    StrCpy $welcome_message "<?php WindowsCommon::echoNsis(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
479
+<?php WindowsCommon::echoNsis(_("The installer will create the following wireless profiles:"))?>$\r$\n\
480 480
 $R0.\
481 481
 $R1$\r$\n$\n\
482
-<?php WindowsCommon::echoNsis( _("More information and comments:"))?>$\r$\n\
482
+<?php WindowsCommon::echoNsis(_("More information and comments:"))?>$\r$\n\
483 483
    EMAIL: ${SUPPORT}$\r$\n\
484 484
    WWW: ${URL}"
485 485
 ${Else}
486
-StrCpy $welcome_message "<?php WindowsCommon::echoNsis( _("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
487
-<?php WindowsCommon::echoNsis( _("The installer will create the wireless profile:"))?> $R0.\
486
+StrCpy $welcome_message "<?php WindowsCommon::echoNsis(_("This installer has been prepared for \${ORGANISATION}"))?>.$\r$\n\
487
+<?php WindowsCommon::echoNsis(_("The installer will create the wireless profile:"))?> $R0.\
488 488
 $R1$\r$\n$\n\
489
-<?php WindowsCommon::echoNsis( _("More information and comments:"))?>$\r$\n\
489
+<?php WindowsCommon::echoNsis(_("More information and comments:"))?>$\r$\n\
490 490
    EMAIL: ${SUPPORT}$\r$\n\
491 491
    WWW: ${URL}"
492 492
 ${EndIf}
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
   SendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0
513 513
 ;TRANSLATION
514 514
   nsDialogs::CreateControl STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 46u -130u -32u "$welcome_message\
515
-$\r$\n$\r$\n<?php WindowsCommon::echoNsis( _("Installer created with software from the GEANT project."))?>"
515
+$\r$\n$\r$\n<?php WindowsCommon::echoNsis(_("Installer created with software from the GEANT project."))?>"
516 516
   Pop $TEXT
517 517
 
518 518
   SetCtlColors $DIALOG "" 0xffffff
@@ -645,18 +645,18 @@  discard block
 block discarded – undo
645 645
     ${If} $wireless_result == 1
646 646
       !insertmacro debug_cat 1 "wlan_test.exe did not find wireless configuration service"
647 647
       IfSilent +2
648
-      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echoNsis( _("Windows wireless configuration service is not enabled. The installer cannot continue."))?>"
648
+      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echoNsis(_("Windows wireless configuration service is not enabled. The installer cannot continue."))?>"
649 649
       Call Cleanup
650 650
     ${EndIf}
651 651
     ${If} $wireless_result == 2
652 652
       IfSilent +2
653
-      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echoNsis( _("No wireless interfaces found. The installer cannot continue."))?>"
653
+      MessageBox MB_OK|MB_ICONEXCLAMATION "<?php WindowsCommon::echoNsis(_("No wireless interfaces found. The installer cannot continue."))?>"
654 654
       Call Cleanup
655 655
     ${EndIf}
656 656
   ${Else}
657 657
     ${If} $wireless_result > 0
658 658
        IfSilent +3
659
-       MessageBox MB_YESNO "<?php WindowsCommon::echoNsis( _("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes
659
+       MessageBox MB_YESNO "<?php WindowsCommon::echoNsis(_("No wireless interfaces found. Wireless access will not be configured. Would you like to continue and configure access on the wired interface?"))?>" IDYES wired_yes
660 660
        Call Cleanup
661 661
        wired_yes:
662 662
        Push 1
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
     ${If} $wired == 1
673 673
       ${If} $force_wired == 0
674 674
         IfSilent wired
675
-        MessageBox MB_YESNO "<?php WindowsCommon::echoNsis( _("Do you want to enable access on wired interfaces?"))?>" IDYES wired
675
+        MessageBox MB_YESNO "<?php WindowsCommon::echoNsis(_("Do you want to enable access on wired interfaces?"))?>" IDYES wired
676 676
         Push 0
677 677
         Pop $wired
678 678
         wired:
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 ;================================
714 714
 
715 715
 Function ShowInstfiles
716
-  !insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echoNsis( _("Profiles installation"))?>" " "
716
+  !insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echoNsis(_("Profiles installation"))?>" " "
717 717
 FunctionEnd
718 718
 ;================================
719 719
 ;  Check if a wireless profile exist and put it on delete list
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 
733 733
 Function FindProfile
734 734
   Pop $R8
735
-  DetailPrint "<?php WindowsCommon::echoNsis( _("Checking for profile \$R8"))?>"
735
+  DetailPrint "<?php WindowsCommon::echoNsis(_("Checking for profile \$R8"))?>"
736 736
   !insertmacro debug_cat 2 "Checking for profile $R8"
737 737
   !insertmacro debug_cat 3 "Exec: $Netsh wlan show profiles $R8"
738 738
   nsExec::Exec  '"$Netsh" wlan show profiles "$R8"'
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
   !insertmacro debug_cat 4 "netsh returned $0"
741 741
   ${If} $0 == 0
742 742
     !insertmacro debug_cat 1 "found profile $R8"
743
-    DetailPrint "<?php WindowsCommon::echoNsis( _("found profile \$R8"))?>"
743
+    DetailPrint "<?php WindowsCommon::echoNsis(_("found profile \$R8"))?>"
744 744
     Push 0
745 745
   ${Else}
746 746
     !insertmacro debug_cat 1 "profile $R8 not found"
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
     ${If} $Symantec_installed  != 0
836 836
      !insertmacro debug_cat 3 "Symantec problem"
837 837
      IfSilent +2
838
-     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(WindowsCommon::sprintNsis(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")),\config\ConfAssistant::CONSORTIUM['display_name']) ?>"
838
+     MessageBox MB_OK|MB_ICONEXCLAMATION "<?php printf(WindowsCommon::sprintNsis(_("Please READ this message it is IMPORTANT.$\\r$\\nInstallation problems may be due to the fact that Symantec Endpoint Protection is installed on your machine.$\\r$\\nWhile this is a well-known bug of the Symantec product, about which the installer can not do anything, there is a workaround.$\\r$\\nWhen you close this window the installer will exit and an explorer window will be started (it could appear underneath already opened windows). In this window you should see a script named inst_cat. Start it by double-clicking, It will install the profiles. You will need to login to %s with your username and password.")), \config\ConfAssistant::CONSORTIUM['display_name']) ?>"
839 839
     Exec '"explorer" /select,"$EXEDIR\inst_cat.cmd"'
840 840
     Quit
841 841
 
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
 Function PFXCertificateSelect
1129 1129
   !ifndef SILVERBULLET
1130 1130
 ;TRANSLATION
1131
-!insertmacro MUI_HEADER_TEXT "<?php printf(WindowsCommon::sprintNsis(_("%s installer for")),\config\ConfAssistant::CONSORTIUM['display_name'])?> " "<?php WindowsCommon::echoNsis(_("Install personal certificate"))?>"
1131
+!insertmacro MUI_HEADER_TEXT "<?php printf(WindowsCommon::sprintNsis(_("%s installer for")), \config\ConfAssistant::CONSORTIUM['display_name'])?> " "<?php WindowsCommon::echoNsis(_("Install personal certificate"))?>"
1132 1132
 ;TRANSLATION
1133 1133
     IfSilent +2
1134 1134
   MessageBox MB_OK "<?php WindowsCommon::echoNsis(_("Preparing to install personal certificate."))?>$\r$\n<?php WindowsCommon::echoNsis(_("Click OK to continue"))?> "
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
         $certPasswordLength = strlen($certPasswordLabel);
1145 1145
         $certUsernameLabel = WindowsCommon::sprintNsis(_("Username:"));
1146 1146
         $certUsernameLength = strlen($certUsernameLabel);
1147
-        $labelLength = max($certPasswordLength,$certUsernameLength);
1147
+        $labelLength = max($certPasswordLength, $certUsernameLength);
1148 1148
   ?>
1149 1149
   ${NSD_CreateLabel} 0 0 100% 32u "<?php WindowsCommon::echoNsis(_("Selected file: \$Cert_file"))?>"
1150 1150
   !else
@@ -1161,11 +1161,11 @@  discard block
 block discarded – undo
1161 1161
   !insertmacro debug_cat 3 "Vista level (Vista without Service pack): $VistaNoSP";
1162 1162
   ${If} $VistaNoSP == 0
1163 1163
     !ifdef PFX_USERNAME
1164
-       !define LABEL_LENGTH "<?php echo($labelLength*3.5)?>u"
1165
-       !define TEXT_START "<?php echo($labelLength*3.5 +5)?>u"
1164
+       !define LABEL_LENGTH "<?php echo($labelLength * 3.5)?>u"
1165
+       !define TEXT_START "<?php echo($labelLength * 3.5 + 5)?>u"
1166 1166
     !else
1167
-       !define LABEL_LENGTH "<?php echo($certPasswordLength*3.5)?>u"
1168
-       !define TEXT_START "<?php echo($certPasswordLength*3.5 +5)?>u"
1167
+       !define LABEL_LENGTH "<?php echo($certPasswordLength * 3.5)?>u"
1168
+       !define TEXT_START "<?php echo($certPasswordLength * 3.5 + 5)?>u"
1169 1169
     !endif
1170 1170
     ${NSD_CreateLabel} 0 35u ${LABEL_LENGTH} 12u "<?php echo $certPasswordLabel?>"
1171 1171
     ${NSD_CreatePassword} ${TEXT_START} 34.5u 120u 12u ""
@@ -1537,7 +1537,7 @@  discard block
 block discarded – undo
1537 1537
 Section "-start"
1538 1538
 SectionIn RO
1539 1539
 
1540
-!insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echoNsis( _("Installation"))?>" "<?php WindowsCommon::echoNsis( _("Checking for existing wireless profiles"))?>"
1540
+!insertmacro MUI_HEADER_TEXT "<?php WindowsCommon::echoNsis(_("Installation"))?>" "<?php WindowsCommon::echoNsis(_("Checking for existing wireless profiles"))?>"
1541 1541
 !ifndef PWD
1542 1542
 !include "certs.nsh"
1543 1543
 !endif
Please login to merge, or discard this patch.
web/admin/edit_profile.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 ?>
29 29
 <?php
30
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
30
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
31 31
 
32 32
 $deco = new \web\lib\admin\PageDecoration();
33 33
 $validator = new \web\lib\common\InputValidation();
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     <?php
128 128
     echo $uiElements->instLevelInfoBoxes($my_inst);
129 129
 
130
-    echo "<form enctype='multipart/form-data' action='edit_profile_result.php?inst_id=$my_inst->identifier" . ($my_profile !== NULL ? "&amp;profile_id=" . $my_profile->identifier : "") . "' method='post' accept-charset='UTF-8'>
131
-                <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
130
+    echo "<form enctype='multipart/form-data' action='edit_profile_result.php?inst_id=$my_inst->identifier".($my_profile !== NULL ? "&amp;profile_id=".$my_profile->identifier : "")."' method='post' accept-charset='UTF-8'>
131
+                <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE."'>";
132 132
     $optionDisplay = new \web\lib\admin\OptionDisplay($profile_options, \core\Options::LEVEL_PROFILE);
133 133
     ?>
134 134
     <fieldset class="option_container">
@@ -137,29 +137,29 @@  discard block
 block discarded – undo
137 137
         </legend>
138 138
         <?php
139 139
         if ($wizardStyle) {
140
-            echo "<p>" . _("We will now define a profile for your user group(s).  You can add as many profiles as you like by choosing the appropriate button on the end of the page. After we are done, the wizard is finished and you will be taken to the main IdP administration page.") . "</p>";
140
+            echo "<p>"._("We will now define a profile for your user group(s).  You can add as many profiles as you like by choosing the appropriate button on the end of the page. After we are done, the wizard is finished and you will be taken to the main IdP administration page.")."</p>";
141 141
         }
142 142
         ?>
143 143
         <h3><?php echo _("Profile Name and RADIUS realm"); ?></h3>
144 144
         <?php
145 145
         if ($wizardStyle) {
146
-            echo "<p>" . _("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.") . "</p>";
147
-            echo "<p>" . _("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.") . "</p>";
148
-            echo "<p>" . _("You can also tell us your RADIUS realm. ");
146
+            echo "<p>"._("First of all we need a name for the profile. This will be displayed to end users, so you may want to choose a descriptive name like 'Professors', 'Students of the Faculty of Bioscience', etc.")."</p>";
147
+            echo "<p>"._("Optionally, you can provide a longer descriptive text about who this profile is for. If you specify it, it will be displayed on the download page after the user has selected the profile name in the list.")."</p>";
148
+            echo "<p>"._("You can also tell us your RADIUS realm. ");
149 149
             if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] !== NULL) {
150 150
                 printf(_("This is useful if you want to use the sanity check module later, which tests reachability of your realm in the %s infrastructure. "), \config\ConfAssistant::CONSORTIUM['display_name']);
151 151
             }
152
-            echo _("It is required to enter the realm name if you want to support anonymous outer identities (see below).") . "</p>";
152
+            echo _("It is required to enter the realm name if you want to support anonymous outer identities (see below).")."</p>";
153 153
         }
154 154
 
155 155
         echo $optionDisplay->prefilledOptionTable("profile");
156 156
         ?>
157 157
         <button type='button' class='newoption' onclick='getXML("profile")'><?php echo _("Add new option"); ?></button>
158 158
         <table>
159
-            <caption><?php echo _("Basic Realm Information");?></caption>
159
+            <caption><?php echo _("Basic Realm Information"); ?></caption>
160 160
             <tr>
161
-                <th class="wai-invisible" scope="col"><?php echo _("Realm:");?></th>
162
-                <th class="wai-invisible" scope="col"><?php echo _("Realm input field");?></th>
161
+                <th class="wai-invisible" scope="col"><?php echo _("Realm:"); ?></th>
162
+                <th class="wai-invisible" scope="col"><?php echo _("Realm input field"); ?></th>
163 163
             </tr>
164 164
             <?php
165 165
             ?>
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
 
205 205
         <?php
206 206
         if ($wizardStyle) {
207
-            echo "<p>" . sprintf(_("Some installers support a feature called 'Anonymous outer identity'. If you don't know what this is, please read <a href='%s'>this article</a>."), "https://confluence.terena.org/display/H2eduroam/eap-types") . "</p>";
208
-            echo "<p>" . _("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix.") . "</p>";
209
-            echo "<p>" . _("The realm check feature needs to know an outer ID which actually gets a chance to authenticate. If your RADIUS server lets only select usernames pass, it is useful to supply the information which of those (outer ID) username we can use for testing.") . "</p>";
207
+            echo "<p>".sprintf(_("Some installers support a feature called 'Anonymous outer identity'. If you don't know what this is, please read <a href='%s'>this article</a>."), "https://confluence.terena.org/display/H2eduroam/eap-types")."</p>";
208
+            echo "<p>"._("On some platforms, the installers can suggest username endings and/or verify the user input to contain the realm suffix.")."</p>";
209
+            echo "<p>"._("The realm check feature needs to know an outer ID which actually gets a chance to authenticate. If your RADIUS server lets only select usernames pass, it is useful to supply the information which of those (outer ID) username we can use for testing.")."</p>";
210 210
         }
211 211
         ?>
212 212
         <p>
@@ -214,52 +214,52 @@  discard block
 block discarded – undo
214 214
 
215 215
             <!-- UI table to align elements-->
216 216
         <table>
217
-            <caption><?php echo _("Username Handling Options");?></caption>
217
+            <caption><?php echo _("Username Handling Options"); ?></caption>
218 218
             <tr>
219
-                <th class="wai-invisible" scope="col"><?php echo _("Option name");?></th>
220
-                <th class="wai-invisible" scope="col"><?php echo _("Option checkbox");?></th>
219
+                <th class="wai-invisible" scope="col"><?php echo _("Option name"); ?></th>
220
+                <th class="wai-invisible" scope="col"><?php echo _("Option checkbox"); ?></th>
221 221
             </tr>
222 222
             <tr>
223
-                <th colspan="2" style="text-align: left;"><?php echo _("Outer Identity Handling");?></th>
223
+                <th colspan="2" style="text-align: left;"><?php echo _("Outer Identity Handling"); ?></th>
224 224
             </tr>
225 225
             <tr>
226 226
                 <!-- checkbox and input field for anonymity support, available only when realm is known-->
227 227
                 <td>
228
-                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
228
+                    <span id='anon_support_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
229 229
                         <?php echo _("Enable Anonymous Outer Identity:"); ?>
230 230
                     </span>
231 231
                 </td>
232 232
                 <td>
233
-                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='anon_support' onclick='
233
+                    <input type='checkbox' <?php echo ($useAnon != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='anon_support' onclick='
234 234
                             if (this.form.elements["anon_support"].checked !== true) {
235 235
                                 this.form.elements["anon_local"].setAttribute("disabled", "disabled");
236 236
                             } else {
237 237
                                 this.form.elements["anon_local"].removeAttribute("disabled");
238 238
                             }
239 239
                             ;'/>
240
-                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : "" ); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
240
+                    <input type='text' <?php echo ($useAnon == FALSE ? "disabled" : ""); ?> name='anon_local' value='<?php echo $anonLocal; ?>'/>
241 241
                 </td>
242 242
             </tr>
243 243
             <tr>
244 244
                 <!-- checkbox and input field for check realm outer id, available only when realm is known-->
245 245
                 <td>
246
-                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
246
+                    <span id='checkuser_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
247 247
                         <?php echo _("Use special Outer Identity for realm checks:"); ?>
248 248
                     </span>
249 249
                 </td>
250 250
                 <td>
251
-                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "" ) . ($realm == "" ? " disabled" : "" ); ?> name='checkuser_support' onclick='
251
+                    <input type='checkbox' <?php echo ($checkuserOuter != FALSE ? "checked" : "").($realm == "" ? " disabled" : ""); ?> name='checkuser_support' onclick='
252 252
                             if (this.form.elements["checkuser_support"].checked !== true) {
253 253
                                 this.form.elements["checkuser_local"].setAttribute("disabled", "disabled");
254 254
                             } else {
255 255
                                 this.form.elements["checkuser_local"].removeAttribute("disabled");
256 256
                             }
257 257
                             ;'/>
258
-                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : "" ); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
258
+                    <input type='text' <?php echo ($checkuserOuter == FALSE ? "disabled" : ""); ?> name='checkuser_local' value='<?php echo $checkuserValue; ?>'/>
259 259
                 </td>
260 260
             </tr>
261 261
             <tr>
262
-                <th colspan="2" style="border-top: 2px solid; text-align: left;"><?php echo _("Inner Identity (Username) Handling");?></th>
262
+                <th colspan="2" style="border-top: 2px solid; text-align: left;"><?php echo _("Inner Identity (Username) Handling"); ?></th>
263 263
             </tr>
264 264
             <tr>
265 265
                 <!-- checkbox for "verify-->
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                 </td>
271 271
                 <td>
272 272
                     <input type='checkbox' <?php
273
-                    echo ($verify != FALSE ? "checked" : "" );
273
+                    echo ($verify != FALSE ? "checked" : "");
274 274
                     ?> name='verify_support' onclick='
275 275
                             if (this.form.elements["verify_support"].checked !== true || this.form.elements["realm"].value.length == 0) {
276 276
                                 this.form.elements["hint_support"].setAttribute("disabled", "disabled");
@@ -282,12 +282,12 @@  discard block
 block discarded – undo
282 282
             </tr>
283 283
             <tr>
284 284
                 <td>
285
-                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : "" ); ?>'>
285
+                    <span id='hint_label' style='<?php echo ($realm == "" ? "color:#999999" : ""); ?>'>
286 286
                         <?php echo _("Enforce exact realm in username"); ?>
287 287
                     </span>
288 288
                 </td>
289 289
                 <td>
290
-                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : "" ); ?> name='hint_support' <?php echo ( $hint != FALSE ? "checked" : "" ); ?> />
290
+                    <input type='checkbox' <?php echo ($verify == FALSE ? "disabled" : ""); ?> name='hint_support' <?php echo ($hint != FALSE ? "checked" : ""); ?> />
291 291
                 </td>
292 292
             </tr>
293 293
         </table>
@@ -297,20 +297,20 @@  discard block
 block discarded – undo
297 297
 
298 298
     <?php
299 299
     if ($wizardStyle) {
300
-        echo "<p>" . _("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).") . "</p>";
300
+        echo "<p>"._("The CAT has a download area for end users. There, they will, for example, learn about the support pointers you entered earlier. The CAT can also immediately offer the installers for the profile for download. If you don't want that, you can instead enter a web site location where you want your users to be redirected to. You, as the administrator, can still download the profiles to place them on that page (see the 'Compatibility Matrix' button on the dashboard).")."</p>";
301 301
     }
302 302
     ?>
303 303
     <p>
304 304
 
305 305
         <?php
306
-        echo "<span id='redirect_label' style='" . ($realm == "" ? "color:#999999" : "" ) . "'><label for='redirect'>" . _("Redirect end users to own web page:") . "</label></span>
307
-                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked " ) . "onclick='
306
+        echo "<span id='redirect_label' style='".($realm == "" ? "color:#999999" : "")."'><label for='redirect'>"._("Redirect end users to own web page:")."</label></span>
307
+                          <input type='checkbox'  name='redirect' id='redirect' " . ($blacklisted === FALSE ? "" : "checked ")."onclick='
308 308
                               if (this.form.elements[\"redirect\"].checked != true) {
309 309
                                 this.form.elements[\"redirect_target\"].setAttribute(\"disabled\", \"disabled\");
310 310
                               } else {
311 311
                                 this.form.elements[\"redirect_target\"].removeAttribute(\"disabled\");
312 312
                               };'/>
313
-                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled" ) . "/>";
313
+                          <input type='text' name='redirect_target' " . ($blacklisted !== FALSE ? "value='$blacklisted'" : "disabled")."/>";
314 314
         ?>
315 315
     </p>
316 316
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     <legend><strong><?php echo _("Supported EAP types"); ?></strong></legend>
320 320
     <?php
321 321
     if ($wizardStyle) {
322
-        echo "<p>" . _("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.") . "</p>";
322
+        echo "<p>"._("Now, we need to know which EAP types your IdP supports. If you support multiple EAP types, you can assign every type a priority (1=highest). This tool will always generate an automatic installer for the EAP type with the highest priority; only if the user's device can't use that EAP type, we will use an EAP type further down in the list.")."</p>";
323 323
     }
324 324
     ?>
325 325
     <?php
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
     ?>
344 344
     <div>
345 345
         <table style="border:none">
346
-            <caption><?php echo _("EAP type support");?></caption>
346
+            <caption><?php echo _("EAP type support"); ?></caption>
347 347
             <tr>
348 348
                 <th scope="row" style="vertical-align:top; padding:1em">
349 349
                     <?php echo _('Supported EAP types for this profile'); ?>
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
                         <?php
354 354
                         $D = [];
355 355
                         foreach ($prefill_methods as $prio => $value) {
356
-                            print '<li>' . $value->getPrintableRep() . "</li>\n";
356
+                            print '<li>'.$value->getPrintableRep()."</li>\n";
357 357
                             $D[$value->getPrintableRep()] = $prio;
358 358
                         }
359 359
                         ?>
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                             }
380 380
                             $display = $a->getPrintableRep();
381 381
                             if (!isset($D[$a->getPrintableRep()])) {
382
-                                print '<li class="eap1">' . $a->getPrintableRep() . "</li>\n";
382
+                                print '<li class="eap1">'.$a->getPrintableRep()."</li>\n";
383 383
                             }
384 384
                         }
385 385
                         ?>
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
     foreach ($methods as $a) {
393 393
         $display = $a->getPrintableRep();
394 394
         $v = isset($D[$display]) ? $D[$display] : '';
395
-        print '<input type="hidden" class="eapm" name="' . $display . '" id="EAP-' . $display . '" value="' . $display . '">';
396
-        print '<input type="hidden" class="eapmv" name="' . $display . '-priority" id="EAP-' . $display . '-priority" value="' . $v . '">';
395
+        print '<input type="hidden" class="eapm" name="'.$display.'" id="EAP-'.$display.'" value="'.$display.'">';
396
+        print '<input type="hidden" class="eapmv" name="'.$display.'-priority" id="EAP-'.$display.'-priority" value="'.$v.'">';
397 397
     }
398 398
     ?>
399 399
     <br style="clear:both;" />
@@ -413,11 +413,11 @@  discard block
 block discarded – undo
413 413
 foreach ($optionsAlreadySet as $optionNames) {
414 414
     if (preg_match("/^support:/", $optionNames)) {
415 415
         $has_support_options[$optionNames] = "SET";
416
-        $support_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
416
+        $support_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
417 417
     }
418 418
     if (preg_match("/^media:/", $optionNames)) {
419 419
         $has_media_options[$optionNames] = "SET";
420
-        $media_text .= "<li><strong>" . $uiElements->displayName($optionNames) . "</strong></li>";
420
+        $media_text .= "<li><strong>".$uiElements->displayName($optionNames)."</strong></li>";
421 421
     }
422 422
 }
423 423
 $fields = [
@@ -426,22 +426,22 @@  discard block
 block discarded – undo
426 426
     "media" => _("Media Properties for this profile")];
427 427
 
428 428
 foreach ($fields as $name => $description) {
429
-    echo "<fieldset class='option_container' id='" . $name . "_override'>
429
+    echo "<fieldset class='option_container' id='".$name."_override'>
430 430
     <legend><strong>$description</strong></legend>
431 431
     <p>";
432 432
 
433
-    if (count(${"has_" . $name . "_options"}) > 0) {
434
-        printf(ngettext("The option %s is already defined IdP-wide. If you set it here on profile level, this setting will override the IdP-wide one.", "The options %s are already defined IdP-wide. If you set them here on profile level, these settings will override the IdP-wide ones.", count(${"has_" . $name . "_options"})), "<ul>" . ${$name . "_text"} . "</ul>");
433
+    if (count(${"has_".$name."_options"}) > 0) {
434
+        printf(ngettext("The option %s is already defined IdP-wide. If you set it here on profile level, this setting will override the IdP-wide one.", "The options %s are already defined IdP-wide. If you set them here on profile level, these settings will override the IdP-wide ones.", count(${"has_".$name."_options"})), "<ul>".${$name."_text"}."</ul>");
435 435
     }
436 436
 
437 437
     echo "</p>";
438 438
     echo $optionDisplay->prefilledOptionTable($name);
439
-    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>" . _("Add new option") . "</button>";
439
+    echo "<button type='button' class='newoption' onclick='getXML(\"$name\")'>"._("Add new option")."</button>";
440 440
     echo "</fieldset>";
441 441
 }
442 442
 
443 443
 if ($wizardStyle) {
444
-    echo "<p>" . _("When you are sure that everything is correct, please click on 'Save data' and you will be taken to your IdP Dashboard page.") . "</p>";
444
+    echo "<p>"._("When you are sure that everything is correct, please click on 'Save data' and you will be taken to your IdP Dashboard page.")."</p>";
445 445
 }
446
-echo "<p><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
446
+echo "<p><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_idp.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>";
447 447
 echo $deco->footer();
Please login to merge, or discard this patch.