@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | foreach ($idps as $idp) { |
| 38 | 38 | $idpTitle[$idp['entityID']] = $idp['title']; |
| 39 | 39 | $d = self::getIdpDistance($idp, $here); |
| 40 | - $resultSet[$idp['entityID']] = $d . " " . $idp['title']; |
|
| 40 | + $resultSet[$idp['entityID']] = $d." ".$idp['title']; |
|
| 41 | 41 | } |
| 42 | 42 | asort($resultSet); |
| 43 | 43 | $outarray = []; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $allIDPs = ($country != "" ? $handle->exec($query, "s", $country) : $handle->exec($query)); |
| 80 | 80 | $returnarray = []; |
| 81 | 81 | // SELECTs never return a booleans, always an object |
| 82 | - $i=0; |
|
| 82 | + $i = 0; |
|
| 83 | 83 | while ($queryResult = mysqli_fetch_object(/** @scrutinizer ignore-type */ $allIDPs)) { |
| 84 | 84 | $i++; |
| 85 | 85 | $institutionOptions = explode('---', $queryResult->options); |
@@ -129,7 +129,7 @@ discard block |
||
| 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 |
||
| 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>."); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $matchArray = []; |
| 253 | 253 | preg_match('/([^ ]+) ?/', $config[$pathToCheck], $matchArray); |
| 254 | 254 | $exe = $matchArray[1]; |
| 255 | - $the_path = exec("which " . $config[$pathToCheck]); |
|
| 255 | + $the_path = exec("which ".$config[$pathToCheck]); |
|
| 256 | 256 | if ($the_path == $exe) { |
| 257 | 257 | $exec_is = "EXPLICIT"; |
| 258 | 258 | } else { |
@@ -272,9 +272,9 @@ discard block |
||
| 272 | 272 | private function testPhp() |
| 273 | 273 | { |
| 274 | 274 | if (version_compare(phpversion(), $this->needversionPHP, '>=')) { |
| 275 | - $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . "."); |
|
| 275 | + $this->storeTestResult(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion()."."); |
|
| 276 | 276 | } else { |
| 277 | - $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have " . phpversion() . "."); |
|
| 277 | + $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->needversionPHP, but you only have ".phpversion()."."); |
|
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | |
@@ -287,12 +287,12 @@ discard block |
||
| 287 | 287 | */ |
| 288 | 288 | private function runConstantsTest($config) |
| 289 | 289 | { |
| 290 | - $templateConfig = file_get_contents(ROOT . "/config/$config-template.php"); |
|
| 291 | - $newTemplateConfig = preg_replace("/class *$config/", "class $config" . "_template", $templateConfig); |
|
| 292 | - file_put_contents(ROOT . "/var/tmp/$config-template.php", $newTemplateConfig); |
|
| 293 | - include(ROOT . "/var/tmp/$config-template.php"); |
|
| 294 | - unlink(ROOT . "/var/tmp/$config-template.php"); |
|
| 295 | - $rft = new \ReflectionClass("\config\\$config" . "_template"); |
|
| 290 | + $templateConfig = file_get_contents(ROOT."/config/$config-template.php"); |
|
| 291 | + $newTemplateConfig = preg_replace("/class *$config/", "class $config"."_template", $templateConfig); |
|
| 292 | + file_put_contents(ROOT."/var/tmp/$config-template.php", $newTemplateConfig); |
|
| 293 | + include(ROOT."/var/tmp/$config-template.php"); |
|
| 294 | + unlink(ROOT."/var/tmp/$config-template.php"); |
|
| 295 | + $rft = new \ReflectionClass("\config\\$config"."_template"); |
|
| 296 | 296 | $templateConstants = $rft->getConstants(); |
| 297 | 297 | $failResults = []; |
| 298 | 298 | foreach ($templateConstants as $constant => $value) { |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | * Check if all required constants are set |
| 310 | 310 | */ |
| 311 | 311 | private function testConfigConstants() { |
| 312 | - set_error_handler(function ($severity, $message, $file, $line) { |
|
| 312 | + set_error_handler(function($severity, $message, $file, $line) { |
|
| 313 | 313 | throw new \ErrorException($message, $severity, $severity, $file, $line); |
| 314 | 314 | }); |
| 315 | 315 | |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | $failCount = $failCount + count($failResults); |
| 321 | 321 | if (count($failResults) > 0) { |
| 322 | 322 | $this->storeTestResult(\core\common\Entity::L_ERROR, |
| 323 | - "<strong>The following constants are not set:</strong>" . implode(', ', $failResults)); |
|
| 323 | + "<strong>The following constants are not set:</strong>".implode(', ', $failResults)); |
|
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | $this->storeTestResult(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly"); |
| 345 | 345 | } else { |
| 346 | 346 | $rootFromScript = $m[1] === '' ? '/' : $m[1]; |
| 347 | - $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>"); |
|
| 347 | + $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>"); |
|
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | if (count($probeReturns) == 0) { |
| 366 | 366 | $this->storeTestResult(common\Entity::L_OK, "All configured RADIUS/UDP probes are reachable."); |
| 367 | 367 | } else { |
| 368 | - $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: " . implode(', ', $probeReturns)); |
|
| 368 | + $this->storeTestResult(common\Entity::L_ERROR, "The following RADIUS probes are NOT reachable: ".implode(', ', $probeReturns)); |
|
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | 371 | |
@@ -383,9 +383,9 @@ discard block |
||
| 383 | 383 | $SSPconfig = \SimpleSAML\Configuration::getInstance(); |
| 384 | 384 | $sspVersion = explode('.', $SSPconfig->getVersion()); |
| 385 | 385 | if ((int) $sspVersion[0] >= $this->needversionSSP['major'] && (int) $sspVersion[1] >= $this->needversionSSP['minor']) { |
| 386 | - $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion)); |
|
| 386 | + $this->storeTestResult(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion)); |
|
| 387 | 387 | } else { |
| 388 | - $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->needversionSSP)); |
|
| 388 | + $this->storeTestResult(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->needversionSSP)); |
|
| 389 | 389 | } |
| 390 | 390 | } |
| 391 | 391 | } |
@@ -443,8 +443,8 @@ discard block |
||
| 443 | 443 | */ |
| 444 | 444 | private function testLogdir() |
| 445 | 445 | { |
| 446 | - if (fopen(\config\Master::PATHS['logdir'] . "/debug.log", "a") == FALSE) { |
|
| 447 | - $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>" . \config\Master::PATHS['logdir'] . "</strong> are not writable!"); |
|
| 446 | + if (fopen(\config\Master::PATHS['logdir']."/debug.log", "a") == FALSE) { |
|
| 447 | + $this->storeTestResult(\core\common\Entity::L_WARN, "Log files in <strong>".\config\Master::PATHS['logdir']."</strong> are not writable!"); |
|
| 448 | 448 | } else { |
| 449 | 449 | $this->storeTestResult(\core\common\Entity::L_OK, "Log directory is writable."); |
| 450 | 450 | } |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | $classname = 'Imagick'; |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | - if (class_exists('\\' . $classname)) { |
|
| 486 | + if (class_exists('\\'.$classname)) { |
|
| 487 | 487 | $this->storeTestResult(\core\common\Entity::L_OK, "PHP extension <strong>Imagick</strong> is installed."); |
| 488 | 488 | } else { |
| 489 | 489 | $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>."); |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | { |
| 580 | 580 | $A = $this->getExecPath('openssl'); |
| 581 | 581 | if ($A['exec'] != "") { |
| 582 | - $t = exec($A['exec'] . ' version'); |
|
| 582 | + $t = exec($A['exec'].' version'); |
|
| 583 | 583 | if ($A['exec_is'] == "EXPLICIT") { |
| 584 | 584 | $this->storeTestResult(\core\common\Entity::L_OK, "<strong>$t</strong> was found and is configured explicitly in your config."); |
| 585 | 585 | } else { |
@@ -607,14 +607,14 @@ discard block |
||
| 607 | 607 | } |
| 608 | 608 | $A = $this->getExecPath('makensis'); |
| 609 | 609 | if ($A['exec'] != "") { |
| 610 | - $t = exec($A['exec'] . ' -VERSION'); |
|
| 610 | + $t = exec($A['exec'].' -VERSION'); |
|
| 611 | 611 | if ($A['exec_is'] == "EXPLICIT") { |
| 612 | 612 | $this->storeTestResult(\core\common\Entity::L_OK, "<strong>makensis $t</strong> was found and is configured explicitly in your config."); |
| 613 | 613 | } else { |
| 614 | 614 | $this->storeTestResult(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config."); |
| 615 | 615 | } |
| 616 | 616 | $outputArray = []; |
| 617 | - exec($A['exec'] . ' -HELP', $outputArray); |
|
| 617 | + exec($A['exec'].' -HELP', $outputArray); |
|
| 618 | 618 | $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray)); |
| 619 | 619 | if ($t1 == 1 && \config\ConfAssistant::NSIS_VERSION == 2) { |
| 620 | 620 | $this->storeTestResult(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!"); |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | $NSIS_Module_status = []; |
| 645 | 645 | foreach ($this->NSISModules as $module) { |
| 646 | 646 | unset($out); |
| 647 | - exec(\config\ConfAssistant::PATHS['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
| 647 | + exec(\config\ConfAssistant::PATHS['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
| 648 | 648 | if ($retval > 0) { |
| 649 | 649 | $NSIS_Module_status[$module] = 0; |
| 650 | 650 | } else { |
@@ -711,8 +711,8 @@ discard block |
||
| 711 | 711 | $locales = shell_exec("locale -a"); |
| 712 | 712 | $allthere = ""; |
| 713 | 713 | foreach (\config\Master::LANGUAGES as $onelanguage) { |
| 714 | - if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) { |
|
| 715 | - $allthere .= $onelanguage['locale'] . " "; |
|
| 714 | + if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) { |
|
| 715 | + $allthere .= $onelanguage['locale']." "; |
|
| 716 | 716 | } |
| 717 | 717 | } |
| 718 | 718 | if ($allthere == "") { |
@@ -726,47 +726,47 @@ discard block |
||
| 726 | 726 | ["SETTING" => \config\Master::APPEARANCE['from-mail'], |
| 727 | 727 | "DEFVALUE" => "[email protected]", |
| 728 | 728 | "COMPLAINTSTRING" => "APPEARANCE/from-mail ", |
| 729 | - "REQUIRED" => FALSE,], |
|
| 729 | + "REQUIRED" => FALSE, ], |
|
| 730 | 730 | ["SETTING" => \config\Master::APPEARANCE['support-contact']['url'], |
| 731 | 731 | "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!", |
| 732 | 732 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ", |
| 733 | - "REQUIRED" => FALSE,], |
|
| 733 | + "REQUIRED" => FALSE, ], |
|
| 734 | 734 | ["SETTING" => \config\Master::APPEARANCE['support-contact']['display'], |
| 735 | 735 | "DEFVALUE" => "[email protected]", |
| 736 | 736 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ", |
| 737 | - "REQUIRED" => FALSE,], |
|
| 737 | + "REQUIRED" => FALSE, ], |
|
| 738 | 738 | ["SETTING" => \config\Master::APPEARANCE['support-contact']['developer-mail'], |
| 739 | 739 | "DEFVALUE" => "[email protected]", |
| 740 | 740 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ", |
| 741 | - "REQUIRED" => FALSE,], |
|
| 741 | + "REQUIRED" => FALSE, ], |
|
| 742 | 742 | ["SETTING" => \config\Master::APPEARANCE['abuse-mail'], |
| 743 | 743 | "DEFVALUE" => "[email protected]", |
| 744 | 744 | "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ", |
| 745 | - "REQUIRED" => FALSE,], |
|
| 745 | + "REQUIRED" => FALSE, ], |
|
| 746 | 746 | ["SETTING" => \config\Master::APPEARANCE['MOTD'], |
| 747 | 747 | "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!", |
| 748 | 748 | "COMPLAINTSTRING" => "APPEARANCE/MOTD ", |
| 749 | - "REQUIRED" => FALSE,], |
|
| 749 | + "REQUIRED" => FALSE, ], |
|
| 750 | 750 | ["SETTING" => \config\Master::APPEARANCE['webcert_CRLDP'], |
| 751 | 751 | "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'], |
| 752 | 752 | "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ", |
| 753 | - "REQUIRED" => TRUE,], |
|
| 753 | + "REQUIRED" => TRUE, ], |
|
| 754 | 754 | ["SETTING" => \config\Master::APPEARANCE['webcert_OCSP'], |
| 755 | 755 | "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'], |
| 756 | 756 | "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ", |
| 757 | - "REQUIRED" => TRUE,], |
|
| 757 | + "REQUIRED" => TRUE, ], |
|
| 758 | 758 | ["SETTING" => \config\Master::DB['INST']['host'], |
| 759 | 759 | "DEFVALUE" => "db.host.example", |
| 760 | 760 | "COMPLAINTSTRING" => "DB/INST ", |
| 761 | - "REQUIRED" => TRUE,], |
|
| 761 | + "REQUIRED" => TRUE, ], |
|
| 762 | 762 | ["SETTING" => \config\Master::DB['INST']['host'], |
| 763 | 763 | "DEFVALUE" => "db.host.example", |
| 764 | 764 | "COMPLAINTSTRING" => "DB/USER ", |
| 765 | - "REQUIRED" => TRUE,], |
|
| 765 | + "REQUIRED" => TRUE, ], |
|
| 766 | 766 | ["SETTING" => \config\Master::DB['EXTERNAL']['host'], |
| 767 | 767 | "DEFVALUE" => "customerdb.otherhost.example", |
| 768 | 768 | "COMPLAINTSTRING" => "DB/EXTERNAL ", |
| 769 | - "REQUIRED" => FALSE,], |
|
| 769 | + "REQUIRED" => FALSE, ], |
|
| 770 | 770 | ]; |
| 771 | 771 | |
| 772 | 772 | /** |
@@ -795,11 +795,11 @@ discard block |
||
| 795 | 795 | if (isset(\config\Diagnostics::RADIUSTESTS['TLS-clientcerts'])) { |
| 796 | 796 | foreach (\config\Diagnostics::RADIUSTESTS['TLS-clientcerts'] as $cadata) { |
| 797 | 797 | foreach ($cadata['certificates'] as $cert_files) { |
| 798 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) { |
|
| 799 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " "; |
|
| 798 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) { |
|
| 799 | + $defaultvalues .= "CERTIFICATE/".$cert_files['public']." "; |
|
| 800 | 800 | } |
| 801 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) { |
|
| 802 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " "; |
|
| 801 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) { |
|
| 802 | + $defaultvalues .= "CERTIFICATE/".$cert_files['private']." "; |
|
| 803 | 803 | } |
| 804 | 804 | } |
| 805 | 805 | } |
@@ -892,14 +892,14 @@ discard block |
||
| 892 | 892 | if ($global_no_cache) { |
| 893 | 893 | foreach ($Devs as $dev => $D) { |
| 894 | 894 | if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) { |
| 895 | - $no_cache_dev .= $dev . " "; |
|
| 895 | + $no_cache_dev .= $dev." "; |
|
| 896 | 896 | $no_cache_dev_count++; |
| 897 | 897 | } |
| 898 | 898 | } |
| 899 | 899 | } else { |
| 900 | 900 | foreach ($Devs as $dev => $D) { |
| 901 | 901 | if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) { |
| 902 | - $no_cache_dev .= $dev . " "; |
|
| 902 | + $no_cache_dev .= $dev." "; |
|
| 903 | 903 | $no_cache_dev_count++; |
| 904 | 904 | } |
| 905 | 905 | } |
@@ -938,13 +938,13 @@ discard block |
||
| 938 | 938 | $mail->isHTML(FALSE); |
| 939 | 939 | $mail->CharSet = 'UTF-8'; |
| 940 | 940 | $mail->From = \config\Master::APPEARANCE['from-mail']; |
| 941 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Invitation System"; |
|
| 941 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Invitation System"; |
|
| 942 | 942 | $mail->addAddress(\config\Master::APPEARANCE['abuse-mail']); |
| 943 | 943 | $mail->Subject = "testing CAT configuration mail"; |
| 944 | 944 | $mail->Body = "Testing CAT mailing\n"; |
| 945 | 945 | $sent = $mail->send(); |
| 946 | 946 | if ($sent) { |
| 947 | - $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."); |
|
| 947 | + $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."); |
|
| 948 | 948 | } else { |
| 949 | 949 | $this->storeTestResult(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS"); |
| 950 | 950 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 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 |
||
| 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 | } |