Test Setup Failed
Push — master ( 1a3661...1540ec )
by Stefan
06:17
created
core/SanityTests.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         $this->test_result = [];
130 130
         $this->test_result['global'] = 0;
131 131
         // parse the schema file to find out the number of expected rows...
132
-        $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql");
132
+        $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql");
133 133
         $this->profileOptionCount = 0;
134 134
         $passedTheWindmill = FALSE;
135 135
         foreach ($schema as $schemaLine) {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     {
157 157
         $this->out[$test] = [];
158 158
         $this->name = $test;
159
-        $m_name = 'test' . $test;
159
+        $m_name = 'test'.$test;
160 160
         $this->test_result[$test] = 0;
161 161
         if (!method_exists($this, $m_name)) {
162 162
             $this->storeTestResult(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>.");
@@ -269,9 +269,9 @@  discard block
 block discarded – undo
269 269
     private function testPhp()
270 270
     {
271 271
         if (version_compare(phpversion(), $this->needversionPHP, '>=')) {
272
-            $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . ".");
272
+            $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion().".");
273 273
         } else {
274
-            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have " . phpversion() . ".");
274
+            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have ".phpversion().".");
275 275
         }
276 276
     }
277 277
     
@@ -284,12 +284,12 @@  discard block
 block discarded – undo
284 284
      */
285 285
     private function runConstantsTest($config)
286 286
     {
287
-        $templateConfig = file_get_contents(ROOT . "/config/$config-template.php");
288
-        $newTemplateConfig = preg_replace("/class *$config/", "class $config" . "_template", $templateConfig);
289
-        file_put_contents(ROOT . "/var/tmp/$config-template.php", $newTemplateConfig);
290
-        include(ROOT . "/var/tmp/$config-template.php");
291
-        unlink(ROOT . "/var/tmp/$config-template.php");
292
-        $rft = new \ReflectionClass("\config\\$config" . "_template");
287
+        $templateConfig = file_get_contents(ROOT."/config/$config-template.php");
288
+        $newTemplateConfig = preg_replace("/class *$config/", "class $config"."_template", $templateConfig);
289
+        file_put_contents(ROOT."/var/tmp/$config-template.php", $newTemplateConfig);
290
+        include(ROOT."/var/tmp/$config-template.php");
291
+        unlink(ROOT."/var/tmp/$config-template.php");
292
+        $rft = new \ReflectionClass("\config\\$config"."_template");
293 293
         $templateConstants = $rft->getConstants();
294 294
         $failResults = [];
295 295
         foreach ($templateConstants as $constant => $value) {
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
      * Check if all required constants are set
307 307
      */
308 308
     private function testConfigConstants() {
309
-        set_error_handler(function ($severity, $message, $file, $line) {
309
+        set_error_handler(function($severity, $message, $file, $line) {
310 310
             throw new \ErrorException($message, $severity, $severity, $file, $line);
311 311
         });
312 312
         
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
             $failCount = $failCount + count($failResults);
318 318
             if (count($failResults) > 0) {
319 319
             $this->storeTestResult(\core\common\Entity::L_ERROR, 
320
-                    "<strong>The following constants are not set:</strong>" . implode(', ', $failResults));
320
+                    "<strong>The following constants are not set:</strong>".implode(', ', $failResults));
321 321
             }
322 322
         }
323 323
         
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
             $this->storeTestResult(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly");
342 342
         } else {
343 343
             $rootFromScript = $m[1] === '' ? '/' : $m[1];
344
-            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>" . \config\Master::PATHS['cat_base_url'] . "</strong> and should be <strong>$rootFromScript</strong>");
344
+            $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>".\config\Master::PATHS['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>");
345 345
         }
346 346
     }
347 347
 
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
         if (count($probeReturns) == 0) {
363 363
             $this->storeTestResult(common\Entity::L_OK, "All configured RADIUS/UDP probes are reachable.");
364 364
         } else {
365
-            $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: " . implode(', ', $probeReturns));
365
+            $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: ".implode(', ', $probeReturns));
366 366
         }
367 367
     }
368 368
 
@@ -380,9 +380,9 @@  discard block
 block discarded – undo
380 380
             $SSPconfig = \SimpleSAML\Configuration::getInstance();
381 381
             $sspVersion = explode('.', $SSPconfig->getVersion());
382 382
             if ((int) $sspVersion[0] >= $this->needversionSSP['major'] && (int) $sspVersion[1] >= $this->needversionSSP['minor']) {
383
-                $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion));
383
+                $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion));
384 384
             } else {
385
-                $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->needversionSSP));
385
+                $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->needversionSSP));
386 386
             }
387 387
         }
388 388
     }
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
         $A = $this->getExecPath('zip');
410 410
         if ($A['exec'] != "") {
411 411
             $fullOutput = [];
412
-            $t = exec($A['exec'] . ' --version', $fullOutput);
412
+            $t = exec($A['exec'].' --version', $fullOutput);
413 413
             if ($A['exec_is'] == "EXPLICIT") {
414 414
                 $this->storeTestResult(\core\common\Entity::L_OK, "<strong>".$fullOutput[1]."</strong> was found and is configured explicitly in your config.");
415 415
             } else {
@@ -447,8 +447,8 @@  discard block
 block discarded – undo
447 447
      */
448 448
     private function testLogdir()
449 449
     {
450
-        if (fopen(\config\Master::PATHS['logdir'] . "/debug.log", "a") == FALSE) {
451
-            $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>" . \config\Master::PATHS['logdir'] . "</strong> are not writable!");
450
+        if (fopen(\config\Master::PATHS['logdir']."/debug.log", "a") == FALSE) {
451
+            $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>".\config\Master::PATHS['logdir']."</strong> are not writable!");
452 452
         } else {
453 453
             $this->storeTestResult(\core\common\Entity::L_OK, "Log directory is writable.");
454 454
         }
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
         }
481 481
 
482 482
         $classname = 'Imagick';
483
-        if (class_exists('\\' . $classname)) {
483
+        if (class_exists('\\'.$classname)) {
484 484
             $this->storeTestResult(\core\common\Entity::L_OK, "PHP extension <strong>Imagick</strong> is installed.");
485 485
         } else {
486 486
             $this->storeTestResult(\core\common\Entity::L_ERROR, "PHP extension <strong>Imagick</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/package/imagick'>here</a>.");
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
     {
577 577
         $A = $this->getExecPath('openssl');
578 578
         if ($A['exec'] != "") {
579
-            $t = exec($A['exec'] . ' version');
579
+            $t = exec($A['exec'].' version');
580 580
             if ($A['exec_is'] == "EXPLICIT") {
581 581
                 $this->storeTestResult(\core\common\Entity::L_OK, "<strong>$t</strong> was found and is configured explicitly in your config.");
582 582
             } else {
@@ -604,14 +604,14 @@  discard block
 block discarded – undo
604 604
         }
605 605
         $A = $this->getExecPath('makensis');
606 606
         if ($A['exec'] != "") {
607
-            $t = exec($A['exec'] . ' -VERSION');
607
+            $t = exec($A['exec'].' -VERSION');
608 608
             if ($A['exec_is'] == "EXPLICIT") {
609 609
                 $this->storeTestResult(\core\common\Entity::L_OK, "<strong>makensis $t</strong> was found and is configured explicitly in your config.");
610 610
             } else {
611 611
                 $this->storeTestResult(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config.");
612 612
             }
613 613
             $outputArray = [];
614
-            exec($A['exec'] . ' -HELP', $outputArray);
614
+            exec($A['exec'].' -HELP', $outputArray);
615 615
             $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray));
616 616
             if ($t1 == 1 && \config\ConfAssistant::NSIS_VERSION == 2) {
617 617
                 $this->storeTestResult(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!");
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
         $NSIS_Module_status = [];
642 642
         foreach ($this->NSISModules as $module) {
643 643
             unset($out);
644
-            exec(\config\ConfAssistant::PATHS['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
644
+            exec(\config\ConfAssistant::PATHS['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval);
645 645
             if ($retval > 0) {
646 646
                 $NSIS_Module_status[$module] = 0;
647 647
             } else {
@@ -708,8 +708,8 @@  discard block
 block discarded – undo
708 708
         $locales = shell_exec("locale -a");
709 709
         $allthere = "";
710 710
         foreach (\config\Master::LANGUAGES as $onelanguage) {
711
-            if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) {
712
-                $allthere .= $onelanguage['locale'] . " ";
711
+            if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) {
712
+                $allthere .= $onelanguage['locale']." ";
713 713
             }
714 714
         }
715 715
         if ($allthere == "") {
@@ -723,47 +723,47 @@  discard block
 block discarded – undo
723 723
         ["SETTING" => \config\Master::APPEARANCE['from-mail'],
724 724
             "DEFVALUE" => "[email protected]",
725 725
             "COMPLAINTSTRING" => "APPEARANCE/from-mail ",
726
-            "REQUIRED" => FALSE,],
726
+            "REQUIRED" => FALSE, ],
727 727
         ["SETTING" => \config\Master::APPEARANCE['support-contact']['url'],
728 728
             "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!",
729 729
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ",
730
-            "REQUIRED" => FALSE,],
730
+            "REQUIRED" => FALSE, ],
731 731
         ["SETTING" => \config\Master::APPEARANCE['support-contact']['display'],
732 732
             "DEFVALUE" => "[email protected]",
733 733
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ",
734
-            "REQUIRED" => FALSE,],
734
+            "REQUIRED" => FALSE, ],
735 735
         ["SETTING" => \config\Master::APPEARANCE['support-contact']['developer-mail'],
736 736
             "DEFVALUE" => "[email protected]",
737 737
             "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ",
738
-            "REQUIRED" => FALSE,],
738
+            "REQUIRED" => FALSE, ],
739 739
         ["SETTING" => \config\Master::APPEARANCE['abuse-mail'],
740 740
             "DEFVALUE" => "[email protected]",
741 741
             "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ",
742
-            "REQUIRED" => FALSE,],
742
+            "REQUIRED" => FALSE, ],
743 743
         ["SETTING" => \config\Master::APPEARANCE['MOTD'],
744 744
             "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!",
745 745
             "COMPLAINTSTRING" => "APPEARANCE/MOTD ",
746
-            "REQUIRED" => FALSE,],
746
+            "REQUIRED" => FALSE, ],
747 747
         ["SETTING" => \config\Master::APPEARANCE['webcert_CRLDP'],
748 748
             "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'],
749 749
             "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ",
750
-            "REQUIRED" => TRUE,],
750
+            "REQUIRED" => TRUE, ],
751 751
         ["SETTING" => \config\Master::APPEARANCE['webcert_OCSP'],
752 752
             "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'],
753 753
             "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ",
754
-            "REQUIRED" => TRUE,],
754
+            "REQUIRED" => TRUE, ],
755 755
         ["SETTING" => \config\Master::DB['INST']['host'],
756 756
             "DEFVALUE" => "db.host.example",
757 757
             "COMPLAINTSTRING" => "DB/INST ",
758
-            "REQUIRED" => TRUE,],
758
+            "REQUIRED" => TRUE, ],
759 759
         ["SETTING" => \config\Master::DB['INST']['host'],
760 760
             "DEFVALUE" => "db.host.example",
761 761
             "COMPLAINTSTRING" => "DB/USER ",
762
-            "REQUIRED" => TRUE,],
762
+            "REQUIRED" => TRUE, ],
763 763
         ["SETTING" => \config\Master::DB['EXTERNAL']['host'],
764 764
             "DEFVALUE" => "customerdb.otherhost.example",
765 765
             "COMPLAINTSTRING" => "DB/EXTERNAL ",
766
-            "REQUIRED" => FALSE,],
766
+            "REQUIRED" => FALSE, ],
767 767
     ];
768 768
 
769 769
     /**
@@ -792,11 +792,11 @@  discard block
 block discarded – undo
792 792
         if (isset(\config\Diagnostics::RADIUSTESTS['TLS-clientcerts'])) {
793 793
             foreach (\config\Diagnostics::RADIUSTESTS['TLS-clientcerts'] as $cadata) {
794 794
                 foreach ($cadata['certificates'] as $cert_files) {
795
-                    if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) {
796
-                        $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " ";
795
+                    if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) {
796
+                        $defaultvalues .= "CERTIFICATE/".$cert_files['public']." ";
797 797
                     }
798
-                    if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) {
799
-                        $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " ";
798
+                    if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) {
799
+                        $defaultvalues .= "CERTIFICATE/".$cert_files['private']." ";
800 800
                     }
801 801
                 }
802 802
             }
@@ -889,14 +889,14 @@  discard block
 block discarded – undo
889 889
         if ($global_no_cache) {
890 890
             foreach ($Devs as $dev => $D) {
891 891
                 if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) {
892
-                    $no_cache_dev .= $dev . " ";
892
+                    $no_cache_dev .= $dev." ";
893 893
                     $no_cache_dev_count++;
894 894
                 }
895 895
             }
896 896
         } else {
897 897
             foreach ($Devs as $dev => $D) {
898 898
                 if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) {
899
-                    $no_cache_dev .= $dev . " ";
899
+                    $no_cache_dev .= $dev." ";
900 900
                     $no_cache_dev_count++;
901 901
                 }
902 902
             }
@@ -935,13 +935,13 @@  discard block
 block discarded – undo
935 935
         $mail->isHTML(FALSE);
936 936
         $mail->CharSet = 'UTF-8';
937 937
         $mail->From = \config\Master::APPEARANCE['from-mail'];
938
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Invitation System";
938
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Invitation System";
939 939
         $mail->addAddress(\config\Master::APPEARANCE['abuse-mail']);
940 940
         $mail->Subject = "testing CAT configuration mail";
941 941
         $mail->Body = "Testing CAT mailing\n";
942 942
         $sent = $mail->send();
943 943
         if ($sent) {
944
-            $this->storeTestResult(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . \config\Master::APPEARANCE['abuse-mail'] . " mailbox if the message was receiced.");
944
+            $this->storeTestResult(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".\config\Master::APPEARANCE['abuse-mail']." mailbox if the message was receiced.");
945 945
         } else {
946 946
             $this->storeTestResult(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS");
947 947
         }
Please login to merge, or discard this patch.
config/ConfAssistant-template.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                     ], 
91 91
                 'condition' => TRUE],
92 92
             'OpenRoaming®' => [
93
-                'ssid' => [],     /* OpenRoaming has left SSIDs behind */
93
+                'ssid' => [], /* OpenRoaming has left SSIDs behind */
94 94
                 'oi' => [
95 95
                     '5A03BA0000', /* OpenRoaming/AllIdentities/SettlementFree/NoPersonalData/BaselineQoS */
96 96
                     '5A03BA0800', /* OpenRoaming/EduIdentities/SettlementFree/NoPersonalData/BaselineQoS */
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         'makensis' => 'makensis',
156 156
         'zip' => 'zip',
157 157
         'trust-store-mozilla' => '/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem',
158
-        'trust-store-custom' => __DIR__ . "/known-roots.pem",
158
+        'trust-store-custom' => __DIR__."/known-roots.pem",
159 159
     ];
160 160
 
161 161
     /**
@@ -193,13 +193,13 @@  discard block
 block discarded – undo
193 193
             'db' => 'radacct',
194 194
             'user' => 'someuser',
195 195
             'pass' => 'somepass',
196
-            'readonly' => TRUE,],
196
+            'readonly' => TRUE, ],
197 197
         'RADIUS_2' => [
198 198
             'host' => 'auth-2.hosted.eduroam.org',
199 199
             'db' => 'radacct',
200 200
             'user' => 'someuser',
201 201
             'pass' => 'somepass',
202
-            'readonly' => TRUE,],
202
+            'readonly' => TRUE, ],
203 203
     ];
204 204
 
205 205
     /**
Please login to merge, or discard this patch.
core/DeploymentManaged.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                 $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id;
271 271
             }
272 272
             if ($clients > $maxSupportedClients * 0.9) {
273
-                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!");
273
+                $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!");
274 274
             }
275 275
         }
276 276
         if (count($serverCandidates) == 0 && $federation != "DEFAULT") {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         $foundFreePort1 = 0;
308 308
         while ($foundFreePort1 == 0) {
309 309
             $portCandidate = random_int(1200, 65535);
310
-            $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '" . $ourserver . "' AND port_instance_1 = $portCandidate");
310
+            $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '".$ourserver."' AND port_instance_1 = $portCandidate");
311 311
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) {
312 312
                 $foundFreePort1 = $portCandidate;
313 313
             }
@@ -316,14 +316,14 @@  discard block
 block discarded – undo
316 316
         $foundFreePort2 = 0;
317 317
         while ($foundFreePort2 == 0) {
318 318
             $portCandidate = random_int(1200, 65535);
319
-            $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '" . $ourSecondServer . "' AND port_instance_2 = $portCandidate");
319
+            $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '".$ourSecondServer."' AND port_instance_2 = $portCandidate");
320 320
             if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) {
321 321
                 $foundFreePort2 = $portCandidate;
322 322
             }
323 323
         }
324 324
         // and make up a shared secret that is halfways readable
325 325
         $futureSecret = $this->randomString(16, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
326
-        $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '" . $ourserver . "', radius_instance_2 = '" . $ourSecondServer . "', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret', consortium = '$this->consortium' WHERE deployment_id = $this->identifier");
326
+        $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '".$ourserver."', radius_instance_2 = '".$ourSecondServer."', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret', consortium = '$this->consortium' WHERE deployment_id = $this->identifier");
327 327
         return ["port_instance_1" => $foundFreePort1, "port_instance_2" => $foundFreePort2, "secret" => $futureSecret, "radius_instance_1" => $ourserver, "radius_instance_2" => $ourserver];
328 328
     }
329 329
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
      */
371 371
     public function deactivate()
372 372
     {
373
-        $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::INACTIVE . " WHERE deployment_id = $this->identifier");
373
+        $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::INACTIVE." WHERE deployment_id = $this->identifier");
374 374
     }
375 375
 
376 376
     /**
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
      */
382 382
     public function activate()
383 383
     {
384
-        $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::ACTIVE . " WHERE deployment_id = $this->identifier");
384
+        $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::ACTIVE." WHERE deployment_id = $this->identifier");
385 385
     }
386 386
 
387 387
     /**
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
     {
394 394
         $customAttrib = $this->getAttributes("managedsp:operatorname");
395 395
         if (count($customAttrib) == 0) {
396
-            return "1sp." . $this->identifier . "-" . $this->institution . \config\ConfAssistant::SILVERBULLET['realm_suffix'];
396
+            return "1sp.".$this->identifier."-".$this->institution.\config\ConfAssistant::SILVERBULLET['realm_suffix'];
397 397
         }
398 398
         return $customAttrib[0]["value"];
399 399
     }
@@ -409,13 +409,13 @@  discard block
 block discarded – undo
409 409
     {
410 410
 
411 411
         $hostname = "radius_hostname_$idx";
412
-        $ch = curl_init("http://" . $this->$hostname);
412
+        $ch = curl_init("http://".$this->$hostname);
413 413
         if ($ch === FALSE) {
414 414
             $res = 'FAILURE';
415 415
         } else {
416 416
             curl_setopt($ch, CURLOPT_POST, 1);
417 417
             curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
418
-            $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ": $post\n");
418
+            $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.": $post\n");
419 419
             curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
420 420
             curl_setopt($ch, CURLOPT_HEADER, 0);
421 421
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
             $this->loggerInstance->debug(1, $this);
432 432
         }
433 433
         $this->loggerInstance->debug(1, "Database update");
434
-        $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = " . ($res == 'OK' ? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE) . " WHERE deployment_id = $this->identifier");
434
+        $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = ".($res == 'OK' ? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE)." WHERE deployment_id = $this->identifier");
435 435
         return $res;
436 436
     }
437 437
 
@@ -452,19 +452,19 @@  discard block
 block discarded – undo
452 452
         } else {
453 453
             $txt = $remove ? _('Profile dectivation failed') : _('Profile activation/modification failed');
454 454
         }
455
-        $txt = $txt . ' ';
455
+        $txt = $txt.' ';
456 456
         if (array_count_values($response)[$status] == 2) {
457
-            $txt = $txt . _('on both RADIUS servers: primary and backup') . '.';
457
+            $txt = $txt._('on both RADIUS servers: primary and backup').'.';
458 458
         } else {
459 459
             if ($response['res[1]'] == $status) {
460
-                $txt = $txt . _('on primary RADIUS server') . '.';
460
+                $txt = $txt._('on primary RADIUS server').'.';
461 461
             } else {
462
-                $txt = $txt . _('on backup RADIUS server') . '.';
462
+                $txt = $txt._('on backup RADIUS server').'.';
463 463
             }
464 464
         }
465 465
         $mail = \core\common\OutsideComm::mailHandle();
466 466
         $email = $this->getAttributes("support:email")[0]['value'];
467
-        $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System";
467
+        $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System";
468 468
         $mail->addAddress($email);
469 469
         if ($status == 'OK') {
470 470
             $mail->Subject = _('RADIUS profile update problem fixed');
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
             return NULL;
499 499
         }
500 500
         $timeout = 10;
501
-        curl_setopt($ch, CURLOPT_URL, 'http://' . $host);
501
+        curl_setopt($ch, CURLOPT_URL, 'http://'.$host);
502 502
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
503 503
         curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
504 504
         curl_exec($ch);
@@ -590,35 +590,35 @@  discard block
 block discarded – undo
590 590
     {
591 591
         $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1;
592 592
         $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => ''));
593
-        $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . '&secret=' . $this->secret . '&country=' . $this->getAttributes("internal:country")[0]['value'] . '&';
593
+        $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier.'&secret='.$this->secret.'&country='.$this->getAttributes("internal:country")[0]['value'].'&';
594 594
         if ($remove) {
595
-            $toPostTemplate = $toPostTemplate . 'remove=1&';
595
+            $toPostTemplate = $toPostTemplate.'remove=1&';
596 596
         } else {
597 597
             if ($this->getAttributes("managedsp:operatorname")[0]['value'] ?? NULL) {
598
-                $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getAttributes("managedsp:operatorname")[0]['value'] . '&';
598
+                $toPostTemplate = $toPostTemplate.'operatorname='.$this->getAttributes("managedsp:operatorname")[0]['value'].'&';
599 599
             }
600 600
             if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) {
601 601
                 $allRealms = $this->getAllRealms();
602 602
                 if (!empty($allRealms)) {
603
-                    $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&';
604
-                    $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&';
603
+                    $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&';
604
+                    $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&';
605 605
                 }
606 606
             }
607 607
         }
608 608
         foreach (array_keys($toPost) as $key) {
609
-            $elem = 'port' . $key;
610
-            $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem;
609
+            $elem = 'port'.$key;
610
+            $toPost[$key] = $toPostTemplate.'port='.$this->$elem;
611 611
         }
612 612
         $response = array();
613 613
         foreach ($toPost as $key => $value) {
614
-            $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n");
615
-            $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]);
614
+            $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n");
615
+            $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]);
616 616
         }
617 617
         if ($onlyone) {
618
-            $response['res[' . ($onlyone == 1) ? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK;
618
+            $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK;
619 619
         }
620 620
         foreach (array('OK', 'FAILURE') as $status) {
621
-            if ( ( ($status == 'OK' && $notify) || ($status == 'FAILURE') ) && ( in_array($status, $response) ) ) {
621
+            if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && (in_array($status, $response))) {
622 622
                 $this->sendMailtoAdmin($remove, $response, $status);
623 623
             }
624 624
         }
Please login to merge, or discard this patch.
web/admin/overview_org.php 2 patches
Switch Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -207,70 +207,70 @@  discard block
 block discarded – undo
207 207
                     </div>
208 208
                     <?php
209 209
                     break;
210
-                case "core\ProfileRADIUS":
211
-                    ?>
212
-                    <div style='padding-bottom:20px;'>
210
+                    case "core\ProfileRADIUS":
211
+                        ?>
212
+                        <div style='padding-bottom:20px;'>
213 213
                         <?php $profile_name = $profile_list->name; ?>
214
-                        <h2 style='overflow:auto; display:inline; padding-bottom: 10px;'><?php printf(_("Profile: %s"), $profile_name); ?></h2>
214
+                            <h2 style='overflow:auto; display:inline; padding-bottom: 10px;'><?php printf(_("Profile: %s"), $profile_name); ?></h2>
215 215
                         <?php
216
-                        // see if there are any profile-level overrides
217
-                        $attribs = $profile_list->getAttributes();
218
-                        // write things into a buffer; we need some function calls to determine
219
-                        // readiness - but want to display it before!
220
-                        $has_overrides = FALSE;
221
-                        foreach ($attribs as $attrib) {
222
-                            if ($attrib['level'] == \core\Options::LEVEL_PROFILE && !preg_match("/^(internal:|profile:name|profile:description|eap:)/", $attrib['name'])) {
223
-                                $has_overrides = TRUE;
216
+                            // see if there are any profile-level overrides
217
+                            $attribs = $profile_list->getAttributes();
218
+                            // write things into a buffer; we need some function calls to determine
219
+                            // readiness - but want to display it before!
220
+                            $has_overrides = FALSE;
221
+                            foreach ($attribs as $attrib) {
222
+                                if ($attrib['level'] == \core\Options::LEVEL_PROFILE && !preg_match("/^(internal:|profile:name|profile:description|eap:)/", $attrib['name'])) {
223
+                                    $has_overrides = TRUE;
224
+                                }
224 225
                             }
225
-                        }
226
-                        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
227
-                        $typelist = $profile_list->getEapMethodsinOrderOfPreference();
228
-                        $allcomplete = TRUE;
229
-                        foreach ($typelist as $eaptype) {
230
-                            $buffer_eaptypediv .= $eaptype->getPrintableRep();
231
-                            $completeness = $profile_list->isEapTypeDefinitionComplete($eaptype);
232
-                            if ($completeness === true) {
233
-                                $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
234
-                            } else {
235
-                                $buffer_eaptypediv .= " <div class='notacceptable'>";
236
-                                $buffer_eaptypediv .= _("Information needed!");
237
-                                if (is_array($completeness)) {
238
-                                    $buffer_eaptypediv .= "<ul style='margin:1px'>";
239
-                                    foreach ($completeness as $missing_attrib) {
240
-                                        $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
226
+                            $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
227
+                            $typelist = $profile_list->getEapMethodsinOrderOfPreference();
228
+                            $allcomplete = TRUE;
229
+                            foreach ($typelist as $eaptype) {
230
+                                $buffer_eaptypediv .= $eaptype->getPrintableRep();
231
+                                $completeness = $profile_list->isEapTypeDefinitionComplete($eaptype);
232
+                                if ($completeness === true) {
233
+                                    $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
234
+                                } else {
235
+                                    $buffer_eaptypediv .= " <div class='notacceptable'>";
236
+                                    $buffer_eaptypediv .= _("Information needed!");
237
+                                    if (is_array($completeness)) {
238
+                                        $buffer_eaptypediv .= "<ul style='margin:1px'>";
239
+                                        foreach ($completeness as $missing_attrib) {
240
+                                            $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
241
+                                        }
242
+                                        $buffer_eaptypediv .= "</ul>";
241 243
                                     }
242
-                                    $buffer_eaptypediv .= "</ul>";
244
+                                    $buffer_eaptypediv .= "</div>";
245
+                                    $allcomplete = FALSE;
243 246
                                 }
244
-                                $buffer_eaptypediv .= "</div>";
245
-                                $allcomplete = FALSE;
246
-                            }
247
-                            $attribs = $profile_list->getAttributes();
248
-                            $justOnce = FALSE;
249
-                            foreach ($attribs as $attrib) {
250
-                                if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
251
-                                    $justOnce = TRUE;
252
-                                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>";
247
+                                $attribs = $profile_list->getAttributes();
248
+                                $justOnce = FALSE;
249
+                                foreach ($attribs as $attrib) {
250
+                                    if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
251
+                                        $justOnce = TRUE;
252
+                                        $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>";
253
+                                    }
253 254
                                 }
255
+                                $buffer_eaptypediv .= "<br/>";
254 256
                             }
255
-                            $buffer_eaptypediv .= "<br/>";
256
-                        }
257
-                        $buffer_eaptypediv .= "</div>";
257
+                            $buffer_eaptypediv .= "</div>";
258 258
 
259
-                        $buffer_headline = "<span style='float:right;'>";
260
-                        $readiness = $profile_list->readinessLevel();
261
-                        if ($has_overrides) {
262
-                            $buffer_headline .= $uiElements->boxRemark("", _("Option override on profile level is in effect."), TRUE);
263
-                        }
264
-                        if (!$allcomplete) {
265
-                            $buffer_headline .= $uiElements->boxError("", _("The information in this profile is incomplete."), TRUE);
266
-                        }
267
-                        switch ($readiness) {
259
+                            $buffer_headline = "<span style='float:right;'>";
260
+                            $readiness = $profile_list->readinessLevel();
261
+                            if ($has_overrides) {
262
+                                $buffer_headline .= $uiElements->boxRemark("", _("Option override on profile level is in effect."), TRUE);
263
+                            }
264
+                            if (!$allcomplete) {
265
+                                $buffer_headline .= $uiElements->boxError("", _("The information in this profile is incomplete."), TRUE);
266
+                            }
267
+                            switch ($readiness) {
268 268
                             case core\AbstractProfile::READINESS_LEVEL_SHOWTIME:
269 269
                                 $buffer_headline .= $uiElements->boxOkay("", _("This profile is shown on the user download interface."), TRUE);
270 270
                                 break;
271 271
                             case core\AbstractProfile::READINESS_LEVEL_SUFFICIENTCONFIG:
272 272
                                 $buffer_headline .= $uiElements->boxWarning("", sprintf(_("This profile is NOT shown on the user download interface, even though we have enough information to show. To enable the profile, add the attribute \"%s\" and tick the corresponding box."), $uiElements->displayName("profile:production")), TRUE);
273
-                        }
273
+                            }
274 274
 
275 275
                         $buffer_headline .= "</span></div>";
276 276
 
@@ -353,8 +353,8 @@  discard block
 block discarded – undo
353 353
                     </div>
354 354
                     <?php
355 355
                     break;
356
-                default:
357
-                    throw new Exception("We were asked to operate on something that is neither a RADIUS nor Silverbullet profile!");
356
+                    default:
357
+                        throw new Exception("We were asked to operate on something that is neither a RADIUS nor Silverbullet profile!");
358 358
             }
359 359
             ?>
360 360
             <!-- dummy width to keep a little distance -->
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 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
 $deco = new \web\lib\admin\PageDecoration();
32 32
 $validator = new \web\lib\common\InputValidation();
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 } else {
39 39
     $link = 'http://';
40 40
 }
41
-$link .= $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'];
41
+$link .= $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME'];
42 42
 $link = htmlspecialchars($link);
43 43
 
44 44
 echo $deco->defaultPagePrelude(sprintf(_("%s: %s Dashboard"), \config\Master::APPEARANCE['productname'], $uiElements->nomenclatureParticipant));
@@ -182,14 +182,14 @@  discard block
 block discarded – undo
182 182
                                     <ul style='margin:1px'>
183 183
                                         <?php
184 184
                                         foreach ($completeness as $missing_attrib) {
185
-                                            echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
185
+                                            echo "<li>".$uiElements->displayName($missing_attrib)."</li>";
186 186
                                         }
187 187
                                         ?>
188 188
                                     </ul>
189 189
                                 </div>
190 190
                                 <?php
191 191
                             } else {
192
-                                echo sprintf(_("You can create up to %d users."), $maxusers[0]['value']) . "<br/>" . sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $profile_list->realm);
192
+                                echo sprintf(_("You can create up to %d users."), $maxusers[0]['value'])."<br/>".sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $profile_list->realm);
193 193
                             }
194 194
                             ?>
195 195
                             <br/>
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
                             if ($readonly === FALSE) {
199 199
                                 ?>
200 200
                                 <form action='edit_silverbullet.php?inst_id=<?php echo $my_inst->identifier; ?>&amp;profile_id=<?php echo $profile_list->identifier; ?>' method='POST'>
201
-                                    <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
201
+                                    <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button>
202 202
                                 </form>
203 203
                                 <?php
204 204
                             }
@@ -223,21 +223,21 @@  discard block
 block discarded – undo
223 223
                                 $has_overrides = TRUE;
224 224
                             }
225 225
                         }
226
-                        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>";
226
+                        $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>";
227 227
                         $typelist = $profile_list->getEapMethodsinOrderOfPreference();
228 228
                         $allcomplete = TRUE;
229 229
                         foreach ($typelist as $eaptype) {
230 230
                             $buffer_eaptypediv .= $eaptype->getPrintableRep();
231 231
                             $completeness = $profile_list->isEapTypeDefinitionComplete($eaptype);
232 232
                             if ($completeness === true) {
233
-                                $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>";
233
+                                $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>";
234 234
                             } else {
235 235
                                 $buffer_eaptypediv .= " <div class='notacceptable'>";
236 236
                                 $buffer_eaptypediv .= _("Information needed!");
237 237
                                 if (is_array($completeness)) {
238 238
                                     $buffer_eaptypediv .= "<ul style='margin:1px'>";
239 239
                                     foreach ($completeness as $missing_attrib) {
240
-                                        $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>";
240
+                                        $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>";
241 241
                                     }
242 242
                                     $buffer_eaptypediv .= "</ul>";
243 243
                                 }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
                             foreach ($attribs as $attrib) {
250 250
                                 if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) {
251 251
                                     $justOnce = TRUE;
252
-                                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>";
252
+                                    $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='"._("Options on EAP Method/Device level are in effect.")."'>";
253 253
                                 }
254 254
                             }
255 255
                             $buffer_eaptypediv .= "<br/>";
@@ -287,10 +287,10 @@  discard block
 block discarded – undo
287 287
                                 if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") {
288 288
                                     $diagUrl = "../diag/";
289 289
                                 } else {
290
-                                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/";
290
+                                    $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/";
291 291
                                 }
292 292
                                 ?>
293
-                                <form action='<?php echo $diagUrl . "action_realmcheck.php?inst_id=" . $my_inst->identifier . "&profile_id=" . $profile_list->identifier ?>' method='post' accept-charset='UTF-8'>
293
+                                <form action='<?php echo $diagUrl."action_realmcheck.php?inst_id=".$my_inst->identifier."&profile_id=".$profile_list->identifier ?>' method='post' accept-charset='UTF-8'>
294 294
                                     <input type='hidden' name='comefrom' id='comefrom-<?php echo $profilecount; ?>' value='<?php echo $link; ?>'/>
295 295
                                     <button type='submit' name='profile_action' value='check' <?php echo ($has_realm ? "" : "disabled='disabled'"); ?> title='<?php echo _("The realm can only be checked if you configure the realm!"); ?>'>
296 296
                                         <?php echo _("Check realm reachability"); ?>
@@ -324,9 +324,9 @@  discard block
 block discarded – undo
324 324
                                 ?>
325 325
                                 <div style='display: flex;'>
326 326
                                     <?php
327
-                                    $idpLevelUrl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier;
328
-                                    $displayurl = $idpLevelUrl . "&amp;profile=" . $profile_list->identifier;
329
-                                    $QRurl = $idpLevelUrl . "&profile=" . $profile_list->identifier;
327
+                                    $idpLevelUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$my_inst->identifier;
328
+                                    $displayurl = $idpLevelUrl."&amp;profile=".$profile_list->identifier;
329
+                                    $QRurl = $idpLevelUrl."&profile=".$profile_list->identifier;
330 330
                                     $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([
331 331
                                                 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG,
332 332
                                                 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H,
@@ -338,9 +338,9 @@  discard block
 block discarded – undo
338 338
                                     if (empty($rawQr)) {
339 339
                                         throw new Exception("Something went seriously wrong during QR code generation!");
340 340
                                     }
341
-                                    $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
341
+                                    $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL));
342 342
                                     $size = getimagesize($uri);
343
-                                    echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>";
343
+                                    echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>";
344 344
 
345 345
                                     //echo "<nobr>$displayurl</nobr></a>";
346 346
                                     echo "<p>$displayurl</p></a>";
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
                     <div>
391 391
                         <input type="hidden" name="consortium" value="eduroam"/>
392 392
                         <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'>
393
-                            <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?>
393
+                            <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?>
394 394
                         </button>
395 395
 
396 396
                     </div>
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
     <?php
417 417
     $hotspotProfiles = $my_inst->listDeployments();
418 418
     if (count($hotspotProfiles) == 0) { // no profiles yet.
419
-        echo "<h2>" . sprintf(_("There are not yet any known deployments for your %s."), $uiElements->nomenclatureHotspot) . "</h2>";
419
+        echo "<h2>".sprintf(_("There are not yet any known deployments for your %s."), $uiElements->nomenclatureHotspot)."</h2>";
420 420
     }
421 421
 
422 422
     foreach ($hotspotProfiles as $counter => $deploymentObject) {
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
                 <h2><?php
438 438
                     switch ($deploymentObject->consortium) {
439 439
                         case "eduroam":
440
-                            $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME;
440
+                            $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME;
441 441
                             break;
442 442
                         case "OpenRoaming":
443 443
                             $displayname = "OpenRoaming ANP";
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
                         default:
446 446
                             throw new Exception("We are supposed to operate on a roaming consortium we don't know.");
447 447
                     }
448
-                    echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)";
448
+                    echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)";
449 449
                     ?></h2>
450 450
                 <table>
451 451
                     <caption><?php echo _("Deployment Details"); ?></caption>
@@ -459,13 +459,13 @@  discard block
 block discarded – undo
459 459
                         <td><strong><?php echo _("Your primary RADIUS server") ?></strong><br/>
460 460
                             <?php
461 461
                             if ($deploymentObject->host1_v4 !== NULL) {
462
-                                echo _("IPv4") . ": " . $deploymentObject->host1_v4;
462
+                                echo _("IPv4").": ".$deploymentObject->host1_v4;
463 463
                             }
464 464
                             if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) {
465 465
                                 echo "<br/>";
466 466
                             }
467 467
                             if ($deploymentObject->host1_v6 !== NULL) {
468
-                                echo _("IPv6") . ": " . $deploymentObject->host1_v6;
468
+                                echo _("IPv6").": ".$deploymentObject->host1_v6;
469 469
                             }
470 470
                             ?>
471 471
                         </td>
@@ -473,9 +473,9 @@  discard block
 block discarded – undo
473 473
                         <td><?php echo $deploymentObject->port1; ?></td>
474 474
                         <td>
475 475
                             <?php
476
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] .
477
-                            "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] .
478
-                            "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "'>";
476
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon'].
477
+                            "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text'].
478
+                            "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."'>";
479 479
                             ?>
480 480
                         </td>
481 481
                     </tr>
@@ -483,22 +483,22 @@  discard block
 block discarded – undo
483 483
                         <td><strong><?php echo _("Your backup RADIUS server") ?><br/></strong>
484 484
                             <?php
485 485
                             if ($deploymentObject->host2_v4 !== NULL) {
486
-                                echo _("IPv4") . ": " . $deploymentObject->host2_v4;
486
+                                echo _("IPv4").": ".$deploymentObject->host2_v4;
487 487
                             }
488 488
                             if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) {
489 489
                                 echo "<br/>";
490 490
                             }
491 491
                             if ($deploymentObject->host2_v6 !== NULL) {
492
-                                echo _("IPv6") . ": " . $deploymentObject->host2_v6;
492
+                                echo _("IPv6").": ".$deploymentObject->host2_v6;
493 493
                             }
494 494
                             ?></td>
495 495
                         <td><?php echo _("RADIUS port number: ") ?></td>
496 496
                         <td><?php echo $deploymentObject->port2; ?></td>
497 497
                         <td>
498 498
                             <?php
499
-                            echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] .
500
-                            "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] .
501
-                            "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "'>";
499
+                            echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon'].
500
+                            "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text'].
501
+                            "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."'>";
502 502
                             ?>
503 503
                         </td>
504 504
                     </tr>
@@ -550,12 +550,12 @@  discard block
 block discarded – undo
550 550
                                 if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) {
551 551
                                     echo '<br>';
552 552
                                     if ($res['FAILURE'] == 2) {
553
-                                        echo ' <span style="color: red;">' . _("Activation failure.") . '</span>';
553
+                                        echo ' <span style="color: red;">'._("Activation failure.").'</span>';
554 554
                                     } else {
555 555
                                         if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
556
-                                            echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>';
556
+                                            echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>';
557 557
                                         } else {
558
-                                            echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>';
558
+                                            echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>';
559 559
                                         }
560 560
                                     }
561 561
                                 }
@@ -575,12 +575,12 @@  discard block
 block discarded – undo
575 575
                                 if ($res['FAILURE'] > 0) {
576 576
                                     echo '<br>';
577 577
                                     if ($res['FAILURE'] == 2) {
578
-                                        echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>';
578
+                                        echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>';
579 579
                                     } else {
580 580
                                         if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') {
581
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>';
581
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>';
582 582
                                         } else {
583
-                                            echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>';
583
+                                            echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>';
584 584
                                         }
585 585
                                     }
586 586
                                 }
Please login to merge, or discard this patch.
web/admin/edit_hotspot.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             && ( $_POST['consortium'] == "eduroam" 
41 41
                     ||   
42 42
                  ( $_POST['consortium'] == "OpenRoaming" && count($myfed->getAttributes("fed:openroaming")) > 0 )
43
-               )
43
+                )
44 44
             ) {
45 45
         $my_inst->newDeployment(\core\AbstractDeployment::DEPLOYMENTTYPE_MANAGED, $_POST['consortium']);
46 46
         header("Location: overview_org.php?inst_id=" . $my_inst->identifier);
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 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
 $deco = new \web\lib\admin\PageDecoration();
32 32
 $validator = new \web\lib\common\InputValidation();
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 
38 38
 if (!isset($_GET['deployment_id'])) {
39 39
     if (isset($_POST['consortium']) 
40
-            && ( $_POST['consortium'] == "eduroam" 
40
+            && ($_POST['consortium'] == "eduroam" 
41 41
                     ||   
42
-                 ( $_POST['consortium'] == "OpenRoaming" && count($myfed->getAttributes("fed:openroaming")) > 0 )
42
+                 ($_POST['consortium'] == "OpenRoaming" && count($myfed->getAttributes("fed:openroaming")) > 0)
43 43
                )
44 44
             ) {
45 45
         $my_inst->newDeployment(\core\AbstractDeployment::DEPLOYMENTTYPE_MANAGED, $_POST['consortium']);
46
-        header("Location: overview_org.php?inst_id=" . $my_inst->identifier);
46
+        header("Location: overview_org.php?inst_id=".$my_inst->identifier);
47 47
         exit(0);
48 48
     } else {
49 49
         throw new Exception("Desired consortium for Managed SP needs to be specified, and allowed!");
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         if (in_array('OK', $response)) {
59 59
             $deployment->deactivate();
60 60
         }
61
-        header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)));
61
+        header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)));
62 62
         exit(0);
63 63
     }
64 64
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         if (in_array('OK', $response)) {
68 68
             $deployment->activate();
69 69
         }
70
-        header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)));
70
+        header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)));
71 71
         exit(0);
72 72
     }
73 73
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         } else {
90 90
             $response = ['NOOP', 'NOOP'];
91 91
         }
92
-        header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)));
92
+        header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)));
93 93
         exit(0);
94 94
     }
95 95
 }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     echo $uiElements->instLevelInfoBoxes($my_inst);
118 118
     $deploymentOptions = $deployment->getAttributes();
119 119
     echo "<form enctype='multipart/form-data' action='edit_hotspot.php?inst_id=$my_inst->identifier&amp;deployment_id=$deployment->identifier' method='post' accept-charset='UTF-8'>
120
-                <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>";
120
+                <input type='hidden' name='MAX_FILE_SIZE' value='".\config\Master::MAX_UPLOAD_SIZE."'>";
121 121
     $optionDisplay = new \web\lib\admin\OptionDisplay($deploymentOptions, \core\Options::LEVEL_PROFILE);
122 122
     ?>
123 123
     <fieldset class='option_container' id='managedsp_override'>
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                 <!-- input for VLAN identifier for home users-->
150 150
                 <td>
151 151
                     <span id='vlan_label'>
152
-<?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " " . _("(unset with '0')"))); ?>
152
+<?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " "._("(unset with '0')"))); ?>
153 153
                     </span>
154 154
                 </td>
155 155
                 <td>
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     </fieldset>
170 170
 
171 171
     <?php
172
-    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_org.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>";
172
+    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_org.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>";
173 173
     echo $deco->footer();
174 174
 
175 175
     
176 176
\ No newline at end of file
Please login to merge, or discard this patch.