Test Failed
Push — master ( 6a1c27...644aaf )
by Stefan
08:08
created
web/admin/action_generate_zone.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
  */
27 27
 ?>
28 28
 <?php
29
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
29
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
30 30
 
31 31
 $auth = new \web\lib\admin\Authentication();
32 32
 $deco = new \web\lib\admin\PageDecoration();
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     "nl" => "_radsec._tcp.eduroam.nl.",
76 76
     ];
77 77
     foreach ($cat->getSuperglueZone() as $oneEntry) {
78
-        foreach (explode(',',$oneEntry['inst_realm']) as $oneRealm) {
78
+        foreach (explode(',', $oneEntry['inst_realm']) as $oneRealm) {
79 79
             $target = "_radsec._somewhere.eduroam.org";
80 80
             foreach ($NROs as $tld => $nroTarget) {
81 81
                 if (preg_match("/$tld$/", $oneRealm)) {
Please login to merge, or discard this patch.
core/CAT.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,28 +105,28 @@
 block discarded – undo
105 105
         parent::__construct();
106 106
         common\Entity::intoThePotatoes();
107 107
 
108
-        $this->catVersionString = sprintf(_("Unreleased %s Git Revision"), "<a href='https://github.com/GEANT/CAT/tree/master/Changes.md'>") . "</a>";
108
+        $this->catVersionString = sprintf(_("Unreleased %s Git Revision"), "<a href='https://github.com/GEANT/CAT/tree/master/Changes.md'>")."</a>";
109 109
         if (CAT::RELEASE_VERSION) {
110 110
             $major = CAT::VERSION_MAJOR;
111 111
             $minor = CAT::VERSION_MINOR;
112 112
             $patch = CAT::VERSION_PATCH;
113 113
             $extra = CAT::VERSION_EXTRA;
114 114
             $temp_version = "CAT-$major.$minor";
115
-            $branch = "release_$major" . "_$minor";
115
+            $branch = "release_$major"."_$minor";
116 116
             if (CAT::VERSION_PATCH != 0) {
117 117
                 $temp_version .= ".$patch";
118 118
             }
119 119
             if (CAT::VERSION_EXTRA != "") {
120 120
                 $temp_version .= "-$extra";
121 121
             }
122
-            $this->catVersionString = sprintf(_("Release <a href='%s'>%s</a>"), "https://github.com/GEANT/CAT/tree/" . $branch . "/Changes.md", $temp_version);
122
+            $this->catVersionString = sprintf(_("Release <a href='%s'>%s</a>"), "https://github.com/GEANT/CAT/tree/".$branch."/Changes.md", $temp_version);
123 123
         }
124 124
         $product = \config\Master::APPEARANCE['productname'];
125 125
         $minYear = self::COPYRIGHT_MIN_YEAR;
126 126
         $maxYear = self::COPYRIGHT_MAX_YEAR;
127 127
         $holder = self::COPYRIGHT_HOLDER;
128 128
         $consortia = self::COPYRIGHT_CONSORTIA;
129
-        $this->catCopyright = "$product - " . $this->catVersionString . " &copy; $minYear-$maxYear $holder<br/>on behalf of $consortia; and others <a href='copyright.php'>Full Copyright and Licenses</a>";
129
+        $this->catCopyright = "$product - ".$this->catVersionString." &copy; $minYear-$maxYear $holder<br/>on behalf of $consortia; and others <a href='copyright.php'>Full Copyright and Licenses</a>";
130 130
 
131 131
 
132 132
         /* Federations are created in DB with bootstrapFederation, and listed via listFederations
Please login to merge, or discard this patch.
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.
web/lib/user/TextTemplates.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -89,12 +89,12 @@
 block discarded – undo
89 89
         $this->templates[WELCOME_ABOARD_TERMS] = "";
90 90
         foreach ([
91 91
                 "eduroam" => [ 
92
-                      "TOU"  => "https://wiki.geant.org/display/H2eduroam/Terms+and+Conditions",
93
-                      "PRIV" => "https://www.eduroam.org/privacy/",
92
+                        "TOU"  => "https://wiki.geant.org/display/H2eduroam/Terms+and+Conditions",
93
+                        "PRIV" => "https://www.eduroam.org/privacy/",
94 94
                     ], 
95 95
                 "OpenRoaming" => [ 
96
-                      "TOU"  => "https://wballiance.com/openroaming/toc-2020/",
97
-                      "PRIV" => "https://wballiance.com/openroaming/privacy-policy-2020/",
96
+                        "TOU"  => "https://wballiance.com/openroaming/toc-2020/",
97
+                        "PRIV" => "https://wballiance.com/openroaming/privacy-policy-2020/",
98 98
                     ]
99 99
             ] as $consortium => $terms) {
100 100
             $this->templates[WELCOME_ABOARD_TERMS] .= sprintf("<p>" . _("When connecting to %s hotspots, the following <a href='%s'>Terms and Conditions</a> and <a href='%s'>Privacy Notice</a> apply.") . "</p>", $consortium, $terms['TOU'], $terms['PRIV']);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 const DOWNLOAD_REDIRECT_CONTINUE = 1054;
50 50
 const SB_GO_AWAY = 1060;
51 51
 const SB_FRONTPAGE_BIGDOWNLOADBUTTON = 1061;
52
-const SB_FRONTPAGE_ROLLER_CUSTOMBUILT= 1062;
52
+const SB_FRONTPAGE_ROLLER_CUSTOMBUILT = 1062;
53 53
 
54 54
 
55 55
 /**
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
                       "PRIV" => "https://wballiance.com/openroaming/privacy-policy-2020/",
97 97
                     ]
98 98
             ] as $consortium => $terms) {
99
-            $this->templates[WELCOME_ABOARD_TERMS] .= sprintf("<p>" . _("When connecting to %s hotspots, the following <a href='%s'>Terms and Conditions</a> and <a href='%s'>Privacy Notice</a> apply.") . "</p>", $consortium, $terms['TOU'], $terms['PRIV']);
99
+            $this->templates[WELCOME_ABOARD_TERMS] .= sprintf("<p>"._("When connecting to %s hotspots, the following <a href='%s'>Terms and Conditions</a> and <a href='%s'>Privacy Notice</a> apply.")."</p>", $consortium, $terms['TOU'], $terms['PRIV']);
100 100
         }
101 101
         // this would actually be a checkbox which grays out the actual download button until ACKed
102 102
         $this->templates[WELCOME_ABOARD_TERMS] .= "<p>"._("I agree to be bound by these Terms and Conditions.")."</p>";
103 103
         $this->templates[WELCOME_ABOARD_BACKTODOWNLOADS] = _("Back to downloads");
104 104
         $this->templates[EDUROAM_WELCOME_ADVERTISING] = sprintf(_("we would like to warmly welcome you among the several million users of %s! From now on, you will be able to use internet access resources on thousands of universities, research centres and other places all over the globe. All of this completely free of charge!"), \config\ConfAssistant::CONSORTIUM['display_name']);
105 105
         $this->templates[HEADING_TOPLEVEL_GREET] = sprintf(_("Welcome to %s"), \config\Master::APPEARANCE['productname']);
106
-        $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"),\config\ConfAssistant::CONSORTIUM['display_name']);
106
+        $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"), \config\ConfAssistant::CONSORTIUM['display_name']);
107 107
         $this->templates[FRONTPAGE_ROLLER_EASY] = sprintf(_("%s installation made easy:"), \config\ConfAssistant::CONSORTIUM['display_name']);
108 108
         $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = _("Custom built for your organisation");
109 109
         $this->templates[FRONTPAGE_BIGDOWNLOADBUTTON] = sprintf(_("Click here to download your %s installer"), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']);
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.
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.