@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | use GeoIp2\Database\Reader; |
50 | 50 | use \Exception; |
51 | 51 | |
52 | -require_once dirname(dirname(__FILE__)) . "/config/_config.php"; |
|
53 | -require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/PHPMailer.php"; |
|
54 | -require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/SMTP.php"; |
|
52 | +require_once dirname(dirname(__FILE__))."/config/_config.php"; |
|
53 | +require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/PHPMailer.php"; |
|
54 | +require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/SMTP.php"; |
|
55 | 55 | |
56 | 56 | class SanityTests extends CAT |
57 | 57 | { |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $this->test_result = []; |
94 | 94 | $this->test_result['global'] = 0; |
95 | 95 | // parse the schema file to find out the number of expected rows... |
96 | - $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql"); |
|
96 | + $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql"); |
|
97 | 97 | $this->profile_option_ct = 0; |
98 | 98 | $passedTheWindmill = FALSE; |
99 | 99 | foreach ($schema as $schemaLine) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | $this->out[$test] = []; |
122 | 122 | $this->name = $test; |
123 | - $m_name = $test . '_test'; |
|
123 | + $m_name = $test.'_test'; |
|
124 | 124 | $this->test_result[$test] = 0; |
125 | 125 | if (!method_exists($this, $m_name)) { |
126 | 126 | $this->testReturn(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>."); |
@@ -229,9 +229,9 @@ discard block |
||
229 | 229 | private function php_test() |
230 | 230 | { |
231 | 231 | if (version_compare(phpversion(), $this->php_needversion, '>=')) { |
232 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . "."); |
|
232 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion()."."); |
|
233 | 233 | } else { |
234 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have " . phpversion() . "."); |
|
234 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>PHP</strong> is too old. We need at least $this->php_needversion, but you only have ".phpversion()."."); |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $this->testReturn(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly"); |
249 | 249 | } else { |
250 | 250 | $rootFromScript = $m[1] === '' ? '/' : $m[1]; |
251 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>" . CONFIG['PATHS']['cat_base_url'] . "</strong> and should be <strong>$rootFromScript</strong>"); |
|
251 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>cat_base_url</strong> is set to <strong>".CONFIG['PATHS']['cat_base_url']."</strong> and should be <strong>$rootFromScript</strong>"); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | |
@@ -266,9 +266,9 @@ discard block |
||
266 | 266 | $SSPconfig = \SimpleSAML_Configuration::getInstance(); |
267 | 267 | $sspVersion = explode('.', $SSPconfig->getVersion()); |
268 | 268 | if ((int) $sspVersion[0] >= $this->ssp_needversion['major'] && (int) $sspVersion[1] >= $this->ssp_needversion['minor']) { |
269 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion)); |
|
269 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion)); |
|
270 | 270 | } else { |
271 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->ssp_needversion)); |
|
271 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->ssp_needversion)); |
|
272 | 272 | } |
273 | 273 | } |
274 | 274 | } |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | */ |
330 | 330 | private function logdir_test() |
331 | 331 | { |
332 | - if (fopen(CONFIG['PATHS']['logdir'] . "/debug.log", "a") == FALSE) { |
|
333 | - $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>" . CONFIG['PATHS']['logdir'] . "</strong> are not writable!"); |
|
332 | + if (fopen(CONFIG['PATHS']['logdir']."/debug.log", "a") == FALSE) { |
|
333 | + $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>".CONFIG['PATHS']['logdir']."</strong> are not writable!"); |
|
334 | 334 | } else { |
335 | 335 | $this->testReturn(\core\common\Entity::L_OK, "Log directory is writable."); |
336 | 336 | } |
@@ -367,10 +367,10 @@ discard block |
||
367 | 367 | } else { |
368 | 368 | $classname = 'Imagick'; |
369 | 369 | } |
370 | - if (class_exists('\\' . $classname)) { |
|
370 | + if (class_exists('\\'.$classname)) { |
|
371 | 371 | $this->testReturn(\core\common\Entity::L_OK, "PHP extension <strong>$classname</strong> is installed."); |
372 | 372 | } else { |
373 | - $this->testReturn(\core\common\Entity::L_ERROR, "PHP extension <strong>$classname</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/get/" . strtolower($classname) . "'>here</a>."); |
|
373 | + $this->testReturn(\core\common\Entity::L_ERROR, "PHP extension <strong>$classname</strong> not found! Get it from your distribution or <a href='http://pecl.php.net/get/".strtolower($classname)."'>here</a>."); |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | if (function_exists('ImageCreate')) { |
@@ -468,15 +468,15 @@ discard block |
||
468 | 468 | } |
469 | 469 | $output = []; |
470 | 470 | $retval = -100; |
471 | - $t = exec($A['exec'] . ' version', $output, $retval); |
|
471 | + $t = exec($A['exec'].' version', $output, $retval); |
|
472 | 472 | if ($retval != 0 || count($output) != 1) { |
473 | 473 | $this->testReturn(\core\common\Entity::L_ERROR, "<strong>openssl</strong> was not found on your system despite being configured!"); |
474 | 474 | return; |
475 | 475 | } |
476 | 476 | if ($A['exec_is'] == "EXPLICIT") { |
477 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>" . $output[0] . "</strong> was found and is configured explicitly in your config."); |
|
477 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>".$output[0]."</strong> was found and is configured explicitly in your config."); |
|
478 | 478 | } else { |
479 | - $this->testReturn(\core\common\Entity::L_WARN, "<strong>" . $output[0] . "</strong> was found, but is not configured with an absolute path in your config."); |
|
479 | + $this->testReturn(\core\common\Entity::L_WARN, "<strong>".$output[0]."</strong> was found, but is not configured with an absolute path in your config."); |
|
480 | 480 | } |
481 | 481 | } |
482 | 482 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | } |
503 | 503 | $output = []; |
504 | 504 | $retval = -100; |
505 | - $t = exec($A['exec'] . ' -VERSION', $output, $retval); |
|
505 | + $t = exec($A['exec'].' -VERSION', $output, $retval); |
|
506 | 506 | if ($retval != 0 || count($output) != 1) { |
507 | 507 | $this->testReturn(\core\common\Entity::L_ERROR, "<strong>makensis</strong> was not found on your system despite being configured!"); |
508 | 508 | return; |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | $this->testReturn(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config."); |
514 | 514 | } |
515 | 515 | $outputArray = []; |
516 | - exec($A['exec'] . ' -HELP', $outputArray); |
|
516 | + exec($A['exec'].' -HELP', $outputArray); |
|
517 | 517 | $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray)); |
518 | 518 | if ($t1 == 1 && CONFIG_CONFASSISTANT['NSIS_VERSION'] == 2) { |
519 | 519 | $this->testReturn(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!"); |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $NSIS_Module_status = []; |
541 | 541 | foreach ($this->NSIS_Modules as $module) { |
542 | 542 | unset($out); |
543 | - exec(CONFIG_CONFASSISTANT['PATHS']['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
543 | + exec(CONFIG_CONFASSISTANT['PATHS']['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
544 | 544 | if ($retval > 0) { |
545 | 545 | $NSIS_Module_status[$module] = 0; |
546 | 546 | } else { |
@@ -605,8 +605,8 @@ discard block |
||
605 | 605 | $locales = shell_exec("locale -a"); |
606 | 606 | $allthere = ""; |
607 | 607 | foreach (CONFIG['LANGUAGES'] as $onelanguage) { |
608 | - if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) { |
|
609 | - $allthere .= $onelanguage['locale'] . " "; |
|
608 | + if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) { |
|
609 | + $allthere .= $onelanguage['locale']." "; |
|
610 | 610 | } |
611 | 611 | } |
612 | 612 | if ($allthere == "") { |
@@ -620,47 +620,47 @@ discard block |
||
620 | 620 | ["SETTING" => CONFIG['APPEARANCE']['from-mail'], |
621 | 621 | "DEFVALUE" => "[email protected]", |
622 | 622 | "COMPLAINTSTRING" => "APPEARANCE/from-mail ", |
623 | - "REQUIRED" => FALSE,], |
|
623 | + "REQUIRED" => FALSE, ], |
|
624 | 624 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['url'], |
625 | 625 | "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!", |
626 | 626 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ", |
627 | - "REQUIRED" => FALSE,], |
|
627 | + "REQUIRED" => FALSE, ], |
|
628 | 628 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['display'], |
629 | 629 | "DEFVALUE" => "[email protected]", |
630 | 630 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ", |
631 | - "REQUIRED" => FALSE,], |
|
631 | + "REQUIRED" => FALSE, ], |
|
632 | 632 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['developer-mail'], |
633 | 633 | "DEFVALUE" => "[email protected]", |
634 | 634 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ", |
635 | - "REQUIRED" => FALSE,], |
|
635 | + "REQUIRED" => FALSE, ], |
|
636 | 636 | ["SETTING" => CONFIG['APPEARANCE']['abuse-mail'], |
637 | 637 | "DEFVALUE" => "[email protected]", |
638 | 638 | "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ", |
639 | - "REQUIRED" => FALSE,], |
|
639 | + "REQUIRED" => FALSE, ], |
|
640 | 640 | ["SETTING" => CONFIG['APPEARANCE']['MOTD'], |
641 | 641 | "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!", |
642 | 642 | "COMPLAINTSTRING" => "APPEARANCE/MOTD ", |
643 | - "REQUIRED" => FALSE,], |
|
643 | + "REQUIRED" => FALSE, ], |
|
644 | 644 | ["SETTING" => CONFIG['APPEARANCE']['webcert_CRLDP'], |
645 | 645 | "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'], |
646 | 646 | "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ", |
647 | - "REQUIRED" => TRUE,], |
|
647 | + "REQUIRED" => TRUE, ], |
|
648 | 648 | ["SETTING" => CONFIG['APPEARANCE']['webcert_OCSP'], |
649 | 649 | "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'], |
650 | 650 | "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ", |
651 | - "REQUIRED" => TRUE,], |
|
651 | + "REQUIRED" => TRUE, ], |
|
652 | 652 | ["SETTING" => CONFIG['DB']['INST']['host'], |
653 | 653 | "DEFVALUE" => "db.host.example", |
654 | 654 | "COMPLAINTSTRING" => "DB/INST ", |
655 | - "REQUIRED" => TRUE,], |
|
655 | + "REQUIRED" => TRUE, ], |
|
656 | 656 | ["SETTING" => CONFIG['DB']['INST']['host'], |
657 | 657 | "DEFVALUE" => "db.host.example", |
658 | 658 | "COMPLAINTSTRING" => "DB/USER ", |
659 | - "REQUIRED" => TRUE,], |
|
659 | + "REQUIRED" => TRUE, ], |
|
660 | 660 | ["SETTING" => CONFIG['DB']['EXTERNAL']['host'], |
661 | 661 | "DEFVALUE" => "customerdb.otherhost.example", |
662 | 662 | "COMPLAINTSTRING" => "DB/EXTERNAL ", |
663 | - "REQUIRED" => FALSE,], |
|
663 | + "REQUIRED" => FALSE, ], |
|
664 | 664 | ]; |
665 | 665 | |
666 | 666 | /** |
@@ -687,11 +687,11 @@ discard block |
||
687 | 687 | |
688 | 688 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['TLS-clientcerts'] as $cadata) { |
689 | 689 | foreach ($cadata['certificates'] as $cert_files) { |
690 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) { |
|
691 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " "; |
|
690 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) { |
|
691 | + $defaultvalues .= "CERTIFICATE/".$cert_files['public']." "; |
|
692 | 692 | } |
693 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) { |
|
694 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " "; |
|
693 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) { |
|
694 | + $defaultvalues .= "CERTIFICATE/".$cert_files['private']." "; |
|
695 | 695 | } |
696 | 696 | } |
697 | 697 | } |
@@ -783,14 +783,14 @@ discard block |
||
783 | 783 | if ($global_no_cache) { |
784 | 784 | foreach ($Devs as $dev => $D) { |
785 | 785 | if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) { |
786 | - $no_cache_dev .= $dev . " "; |
|
786 | + $no_cache_dev .= $dev." "; |
|
787 | 787 | $no_cache_dev_count++; |
788 | 788 | } |
789 | 789 | } |
790 | 790 | } else { |
791 | 791 | foreach ($Devs as $dev => $D) { |
792 | 792 | if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) { |
793 | - $no_cache_dev .= $dev . " "; |
|
793 | + $no_cache_dev .= $dev." "; |
|
794 | 794 | $no_cache_dev_count++; |
795 | 795 | } |
796 | 796 | } |
@@ -829,13 +829,13 @@ discard block |
||
829 | 829 | $mail->isHTML(FALSE); |
830 | 830 | $mail->CharSet = 'UTF-8'; |
831 | 831 | $mail->From = CONFIG['APPEARANCE']['from-mail']; |
832 | - $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Invitation System"; |
|
832 | + $mail->FromName = CONFIG['APPEARANCE']['productname']." Invitation System"; |
|
833 | 833 | $mail->addAddress(CONFIG['APPEARANCE']['abuse-mail']); |
834 | 834 | $mail->Subject = "testing CAT configuration mail"; |
835 | 835 | $mail->Body = "Testing CAT mailing\n"; |
836 | 836 | $sent = $mail->send(); |
837 | 837 | if ($sent) { |
838 | - $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . CONFIG['APPEARANCE']['abuse-mail'] . " mailbox if the message was receiced."); |
|
838 | + $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".CONFIG['APPEARANCE']['abuse-mail']." mailbox if the message was receiced."); |
|
839 | 839 | } else { |
840 | 840 | $this->testReturn(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS"); |
841 | 841 | } |