@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $this->installerPath = $cache['path']; |
84 | 84 | if ($this->installerPath !== NULL && $token === NULL && $password === NULL) { |
85 | 85 | $this->loggerInstance->debug(4, "Using cached installer for: $device\n"); |
86 | - $installerProperties['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=$profileId&device=$device&generatedfor=$generatedFor"; |
|
86 | + $installerProperties['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=$profileId&device=$device&generatedfor=$generatedFor"; |
|
87 | 87 | $installerProperties['mime'] = $cache['mime']; |
88 | 88 | } else { |
89 | 89 | $myInstaller = $this->generateNewInstaller($device, $profile, $generatedFor, $token, $password); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $this->loggerInstance->debug(5, "generateNewInstaller() - Device setup done"); |
172 | 172 | $installer = $dev->writeInstaller(); |
173 | 173 | $this->loggerInstance->debug(5, "generateNewInstaller() - writeInstaller complete"); |
174 | - $iPath = $dev->FPATH . '/tmp/' . $installer; |
|
174 | + $iPath = $dev->FPATH.'/tmp/'.$installer; |
|
175 | 175 | if ($iPath && is_file($iPath)) { |
176 | 176 | if (isset($dev->options['mime'])) { |
177 | 177 | $out['mime'] = $dev->options['mime']; |
@@ -179,17 +179,17 @@ discard block |
||
179 | 179 | $info = new \finfo(); |
180 | 180 | $out['mime'] = $info->file($iPath, FILEINFO_MIME_TYPE); |
181 | 181 | } |
182 | - $this->installerPath = $dev->FPATH . '/' . $installer; |
|
182 | + $this->installerPath = $dev->FPATH.'/'.$installer; |
|
183 | 183 | rename($iPath, $this->installerPath); |
184 | 184 | $integerEap = (new \core\common\EAP($dev->selectedEap))->getIntegerRep(); |
185 | 185 | $profile->updateCache($device, $this->installerPath, $out['mime'], $integerEap); |
186 | 186 | if (CONFIG['DEBUG_LEVEL'] < 4) { |
187 | - \core\common\Entity::rrmdir($dev->FPATH . '/tmp'); |
|
187 | + \core\common\Entity::rrmdir($dev->FPATH.'/tmp'); |
|
188 | 188 | } |
189 | - $this->loggerInstance->debug(4, "Generated installer: " . $this->installerPath . ": for: $device, EAP:" . $integerEap . "\n"); |
|
190 | - $out['link'] = "API.php?action=downloadInstaller&lang=" . $this->languageInstance->getLang() . "&profile=" . $profile->identifier . "&device=$device&generatedfor=$generatedFor"; |
|
189 | + $this->loggerInstance->debug(4, "Generated installer: ".$this->installerPath.": for: $device, EAP:".$integerEap."\n"); |
|
190 | + $out['link'] = "API.php?action=downloadInstaller&lang=".$this->languageInstance->getLang()."&profile=".$profile->identifier."&device=$device&generatedfor=$generatedFor"; |
|
191 | 191 | } else { |
192 | - $this->loggerInstance->debug(2, "Installer generation failed for: " . $profile->identifier . ":$device:" . $this->languageInstance->getLang() . "\n"); |
|
192 | + $this->loggerInstance->debug(2, "Installer generation failed for: ".$profile->identifier.":$device:".$this->languageInstance->getLang()."\n"); |
|
193 | 193 | $out['link'] = 0; |
194 | 194 | } |
195 | 195 | } |
@@ -302,9 +302,9 @@ discard block |
||
302 | 302 | $file = $this->installerPath; |
303 | 303 | $filetype = $output['mime']; |
304 | 304 | $this->loggerInstance->debug(4, "installer MIME type:$filetype\n"); |
305 | - header("Content-type: " . $filetype); |
|
306 | - header('Content-Disposition: inline; filename="' . basename($file) . '"'); |
|
307 | - header('Content-Length: ' . filesize($file)); |
|
305 | + header("Content-type: ".$filetype); |
|
306 | + header('Content-Disposition: inline; filename="'.basename($file).'"'); |
|
307 | + header('Content-Length: '.filesize($file)); |
|
308 | 308 | ob_clean(); |
309 | 309 | flush(); |
310 | 310 | readfile($file); |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | $filetype = $info->buffer($inputImage, FILEINFO_MIME_TYPE); |
326 | 326 | $offset = 60 * 60 * 24 * 30; |
327 | 327 | // gmdate cannot fail here - time() is its default argument (and integer), and we are adding an integer to it |
328 | - $expiresString = "Expires: " . /** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; |
|
328 | + $expiresString = "Expires: "./** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset)." GMT"; |
|
329 | 329 | $blob = $inputImage; |
330 | 330 | |
331 | 331 | if ($resize === TRUE) { |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $filetype = 'image/png'; // default, only one code path where it can become different |
381 | 381 | list($width, $height, $resize) = $this->testForResize($widthIn, $heightIn); |
382 | 382 | if ($resize) { |
383 | - $logoFile = ROOT . '/web/downloads/logos/' . $identifier . '_' . $width . '_' . $height . '.png'; |
|
383 | + $logoFile = ROOT.'/web/downloads/logos/'.$identifier.'_'.$width.'_'.$height.'.png'; |
|
384 | 384 | } |
385 | 385 | if (is_file($logoFile)) { // $logoFile could be an empty string but then we will get a FALSE |
386 | 386 | $this->loggerInstance->debug(4, "Using cached logo $logoFile for: $identifier\n"); |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | if (!isset($device['match'])) { |
474 | 474 | continue; |
475 | 475 | } |
476 | - if (preg_match('/' . $device['match'] . '/', $browser)) { |
|
476 | + if (preg_match('/'.$device['match'].'/', $browser)) { |
|
477 | 477 | return $this->returnDevice($devId, $device); |
478 | 478 | } |
479 | 479 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | $this->loggerInstance->debug(5, "translateFile($source_name, $output_name, $encoding)\n"); |
108 | 108 | ob_start(); |
109 | - $this->loggerInstance->debug(5, $this->module_path . '/Files/' . $this->device_id . '/' . $source_name . "\n"); |
|
109 | + $this->loggerInstance->debug(5, $this->module_path.'/Files/'.$this->device_id.'/'.$source_name."\n"); |
|
110 | 110 | $source = $this->findSourceFile($source_name); |
111 | 111 | |
112 | 112 | if ($source !== FALSE) { // if there is no file found, don't attempt to include an uninitialised variable |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | $output = ob_get_clean(); |
116 | 116 | if ($encoding) { |
117 | - $outputClean = iconv('UTF-8', $encoding . '//TRANSLIT', $output); |
|
117 | + $outputClean = iconv('UTF-8', $encoding.'//TRANSLIT', $output); |
|
118 | 118 | if ($outputClean) { |
119 | 119 | $output = $outputClean; |
120 | 120 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $encoding = 0; |
159 | 159 | } |
160 | 160 | if ($encoding) { |
161 | - $output_c = iconv('UTF-8', $encoding . '//TRANSLIT', $source_string); |
|
161 | + $output_c = iconv('UTF-8', $encoding.'//TRANSLIT', $source_string); |
|
162 | 162 | } else { |
163 | 163 | $output_c = $source_string; |
164 | 164 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if (isset($this->LANGS[$this->languageInstance->getLang()])) { |
238 | 238 | $language = $this->LANGS[$this->languageInstance->getLang()]; |
239 | 239 | $this->lang = $language['nsis']; |
240 | - $this->codePage = 'cp' . $language['cp']; |
|
240 | + $this->codePage = 'cp'.$language['cp']; |
|
241 | 241 | } else { |
242 | 242 | $this->lang = 'English'; |
243 | 243 | $this->codePage = 'cp1252'; |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | $out .= sprintf(_("%s installer will be in the form of an EXE file. It will configure %s on your device, by creating wireless network profiles.<p>When you click the download button, the installer will be saved by your browser. Copy it to the machine you want to configure and execute."), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
260 | 260 | $out .= "<p>"; |
261 | 261 | if ($ssidCount > $configCount) { |
262 | - $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList)) . " "; |
|
263 | - $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)) . '</strong>'; |
|
262 | + $out .= sprintf(ngettext("In addition to <strong>%s</strong> the installer will also configure access to:", "In addition to <strong>%s</strong> the installer will also configure access to the following networks:", $ssidCount - $configCount), implode(', ', $configList))." "; |
|
263 | + $out .= '<strong>'.join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)).'</strong>'; |
|
264 | 264 | $out .= "<p>"; |
265 | 265 | } |
266 | 266 | // TODO - change this below |
@@ -276,8 +276,8 @@ discard block |
||
276 | 276 | $out .= _("When you are connecting to the network for the first time, Windows will pop up a login box, where you should enter your user name and password. This information will be saved so that you will reconnect to the network automatically each time you are in the range."); |
277 | 277 | if ($ssidCount > 1) { |
278 | 278 | $out .= "<p>"; |
279 | - $out .= _("You will be required to enter the same credentials for each of the configured networks:") . " "; |
|
280 | - $out .= '<strong>' . join('</strong>, <strong>', array_keys($ssids)) . '</strong>'; |
|
279 | + $out .= _("You will be required to enter the same credentials for each of the configured networks:")." "; |
|
280 | + $out .= '<strong>'.join('</strong>, <strong>', array_keys($ssids)).'</strong>'; |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | return $out; |
@@ -379,13 +379,13 @@ discard block |
||
379 | 379 | */ |
380 | 380 | protected function signInstaller() |
381 | 381 | { |
382 | - $fileName = $this->installerBasename . '.exe'; |
|
382 | + $fileName = $this->installerBasename.'.exe'; |
|
383 | 383 | if (!$this->sign) { |
384 | 384 | rename("installer.exe", $fileName); |
385 | 385 | return $fileName; |
386 | 386 | } |
387 | 387 | // are actually signing |
388 | - $outputFromSigning = system($this->sign . " installer.exe '$fileName' > /dev/null"); |
|
388 | + $outputFromSigning = system($this->sign." installer.exe '$fileName' > /dev/null"); |
|
389 | 389 | if ($outputFromSigning === FALSE) { |
390 | 390 | $this->loggerInstance->debug(2, "Signing the WindowsCommon installer $fileName FAILED!\n"); |
391 | 391 | } |
@@ -400,15 +400,15 @@ discard block |
||
400 | 400 | protected function compileNSIS() |
401 | 401 | { |
402 | 402 | if (CONFIG_CONFASSISTANT['NSIS_VERSION'] >= 3) { |
403 | - $makensis = CONFIG_CONFASSISTANT['PATHS']['makensis'] . " -INPUTCHARSET UTF8"; |
|
403 | + $makensis = CONFIG_CONFASSISTANT['PATHS']['makensis']." -INPUTCHARSET UTF8"; |
|
404 | 404 | } else { |
405 | 405 | $makensis = CONFIG_CONFASSISTANT['PATHS']['makensis']; |
406 | 406 | } |
407 | 407 | $lcAll = getenv("LC_ALL"); |
408 | 408 | putenv("LC_ALL=en_US.UTF-8"); |
409 | - $command = $makensis . ' -V4 cat.NSI > nsis.log 2>&1'; |
|
409 | + $command = $makensis.' -V4 cat.NSI > nsis.log 2>&1'; |
|
410 | 410 | system($command); |
411 | - putenv("LC_ALL=" . $lcAll); |
|
411 | + putenv("LC_ALL=".$lcAll); |
|
412 | 412 | $this->loggerInstance->debug(4, "compileNSIS:$command\n"); |
413 | 413 | } |
414 | 414 | |
@@ -425,10 +425,10 @@ discard block |
||
425 | 425 | 'email' => 'SUPPORT', |
426 | 426 | 'url' => 'URL', |
427 | 427 | ]; |
428 | - $s = "support_" . $type . "_substitute"; |
|
428 | + $s = "support_".$type."_substitute"; |
|
429 | 429 | $substitute = $this->translateString($this->$s, $this->codePage); |
430 | - $returnValue = !empty($attr['support:' . $type][0]) ? $attr['support:' . $type][0] : $substitute; |
|
431 | - return '!define ' . $supportString[$type] . ' "' . $returnValue . '"' . "\n"; |
|
430 | + $returnValue = !empty($attr['support:'.$type][0]) ? $attr['support:'.$type][0] : $substitute; |
|
431 | + return '!define '.$supportString[$type].' "'.$returnValue.'"'."\n"; |
|
432 | 432 | } |
433 | 433 | |
434 | 434 | /** |
@@ -439,20 +439,20 @@ discard block |
||
439 | 439 | */ |
440 | 440 | protected function writeNsisDefines($attr) |
441 | 441 | { |
442 | - $fcontents = "\n" . '!define NSIS_MAJOR_VERSION ' . CONFIG_CONFASSISTANT['NSIS_VERSION']; |
|
442 | + $fcontents = "\n".'!define NSIS_MAJOR_VERSION '.CONFIG_CONFASSISTANT['NSIS_VERSION']; |
|
443 | 443 | if ($attr['internal:profile_count'][0] > 1) { |
444 | - $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '" |
|
444 | + $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage).'" |
|
445 | 445 | '; |
446 | 446 | } |
447 | 447 | $fcontents .= ' |
448 | -Caption "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
449 | -!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
450 | -!define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '" |
|
448 | +Caption "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
449 | +!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprint_nsi(_("%s installer for %s")), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
450 | +!define VERSION "' . \core\CAT::VERSION_MAJOR.'.'.\core\CAT::VERSION_MINOR.'" |
|
451 | 451 | !define INSTALLER_NAME "installer.exe" |
452 | -!define LANG "' . $this->lang . '" |
|
453 | -!define LOCALE "' . preg_replace('/\..*$/', '', CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']) . '" |
|
452 | +!define LANG "' . $this->lang.'" |
|
453 | +!define LOCALE "' . preg_replace('/\..*$/', '', CONFIG['LANGUAGES'][$this->languageInstance->getLang()]['locale']).'" |
|
454 | 454 | ;-------------------------------- |
455 | -!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '" |
|
455 | +!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage).'" |
|
456 | 456 | '; |
457 | 457 | $fcontents .= $this->getSupport($attr, 'email'); |
458 | 458 | $fcontents .= $this->getSupport($attr, 'url'); |
@@ -460,18 +460,18 @@ discard block |
||
460 | 460 | $fcontents .= '!define WIRED |
461 | 461 | '; |
462 | 462 | } |
463 | - $fcontents .= '!define PROVIDERID "urn:UUID:' . $this->deviceUUID . '" |
|
463 | + $fcontents .= '!define PROVIDERID "urn:UUID:'.$this->deviceUUID.'" |
|
464 | 464 | '; |
465 | 465 | if (!empty($attr['internal:realm'][0])) { |
466 | - $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '" |
|
466 | + $fcontents .= '!define REALM "'.$attr['internal:realm'][0].'" |
|
467 | 467 | '; |
468 | 468 | } |
469 | 469 | if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) { |
470 | - $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '" |
|
470 | + $fcontents .= '!define HINT_USER_INPUT "'.$attr['internal:hint_userinput_suffix'][0].'" |
|
471 | 471 | '; |
472 | 472 | } |
473 | 473 | if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) { |
474 | - $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '" |
|
474 | + $fcontents .= '!define VERIFY_USER_REALM_INPUT "'.$attr['internal:verify_userinput_suffix'][0].'" |
|
475 | 475 | '; |
476 | 476 | } |
477 | 477 | $fcontents .= $this->msInfoFile($attr); |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | $out .= '!define EXTERNAL_INFO "'; |
493 | 493 | // $this->loggerInstance->debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n"); |
494 | 494 | if ($attr['internal:info_file'][0]['mime'] == 'rtf') { |
495 | - $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name']; |
|
495 | + $out = '!define LICENSE_FILE "'.$attr['internal:info_file'][0]['name']; |
|
496 | 496 | } elseif ($attr['internal:info_file'][0]['mime'] == 'txt') { |
497 | 497 | $infoFile = file_get_contents($attr['internal:info_file'][0]['name']); |
498 | 498 | if ($infoFile === FALSE) { |
@@ -501,14 +501,14 @@ discard block |
||
501 | 501 | if (CONFIG_CONFASSISTANT['NSIS_VERSION'] >= 3) { |
502 | 502 | $infoFileConverted = $infoFile; |
503 | 503 | } else { |
504 | - $infoFileConverted = iconv('UTF-8', $this->codePage . '//TRANSLIT', $infoFile); |
|
504 | + $infoFileConverted = iconv('UTF-8', $this->codePage.'//TRANSLIT', $infoFile); |
|
505 | 505 | } |
506 | 506 | if ($infoFileConverted !== FALSE && strlen($infoFileConverted) > 0) { |
507 | 507 | file_put_contents('info_f.txt', $infoFileConverted); |
508 | 508 | $out = '!define LICENSE_FILE " info_f.txt'; |
509 | 509 | } |
510 | 510 | } else { |
511 | - $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name']; |
|
511 | + $out = '!define EXTERNAL_INFO "'.$attr['internal:info_file'][0]['name']; |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | $out .= "\"\n"; |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | use GeoIp2\Database\Reader; |
49 | 49 | use \Exception; |
50 | 50 | |
51 | -require_once dirname(dirname(__FILE__)) . "/config/_config.php"; |
|
52 | -require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/PHPMailer.php"; |
|
53 | -require_once dirname(dirname(__FILE__)) . "/core/PHPMailer/src/SMTP.php"; |
|
51 | +require_once dirname(dirname(__FILE__))."/config/_config.php"; |
|
52 | +require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/PHPMailer.php"; |
|
53 | +require_once dirname(dirname(__FILE__))."/core/PHPMailer/src/SMTP.php"; |
|
54 | 54 | |
55 | 55 | class SanityTests extends CAT { |
56 | 56 | /* in this section set current CAT requirements */ |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $this->test_result = []; |
91 | 91 | $this->test_result['global'] = 0; |
92 | 92 | // parse the schema file to find out the number of expected rows... |
93 | - $schema = file(dirname(dirname(__FILE__)) . "/schema/schema.sql"); |
|
93 | + $schema = file(dirname(dirname(__FILE__))."/schema/schema.sql"); |
|
94 | 94 | $this->profile_option_ct = 0; |
95 | 95 | $passedTheWindmill = FALSE; |
96 | 96 | foreach ($schema as $schemaLine) { |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | public function test($test) { |
117 | 117 | $this->out[$test] = []; |
118 | 118 | $this->name = $test; |
119 | - $m_name = $test . '_test'; |
|
119 | + $m_name = $test.'_test'; |
|
120 | 120 | $this->test_result[$test] = 0; |
121 | 121 | if (!method_exists($this, $m_name)) { |
122 | 122 | $this->testReturn(\core\common\Entity::L_ERROR, "Configuration error, no test configured for <strong>$test</strong>."); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $matchArray = []; |
205 | 205 | preg_match('/([^ ]+) ?/', $config['PATHS'][$pathToCheck], $matchArray); |
206 | 206 | $exe = $matchArray[1]; |
207 | - $the_path = exec("which " . $config['PATHS'][$pathToCheck]); |
|
207 | + $the_path = exec("which ".$config['PATHS'][$pathToCheck]); |
|
208 | 208 | if ($the_path == $exe) { |
209 | 209 | $exec_is = "EXPLICIT"; |
210 | 210 | } else { |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | */ |
224 | 224 | private function php_test() { |
225 | 225 | if (version_compare(phpversion(), $this->php_needversion, '>=')) { |
226 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running " . phpversion() . "."); |
|
226 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>PHP</strong> is sufficiently recent. You are running ".phpversion()."."); |
|
227 | 227 | } else { |
228 | - $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() . "."); |
|
228 | + $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()."."); |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $this->testReturn(\core\common\Entity::L_OK, "<strong>cat_base_url</strong> set correctly"); |
242 | 242 | } else { |
243 | 243 | $rootFromScript = $m[1] === '' ? '/' : $m[1]; |
244 | - $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>"); |
|
244 | + $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>"); |
|
245 | 245 | } |
246 | 246 | } |
247 | 247 | |
@@ -258,9 +258,9 @@ discard block |
||
258 | 258 | $SSPconfig = \SimpleSAML_Configuration::getInstance(); |
259 | 259 | $sspVersion = explode('.', $SSPconfig->getVersion()); |
260 | 260 | if ((int) $sspVersion[0] >= $this->ssp_needversion['major'] && (int) $sspVersion[1] >= $this->ssp_needversion['minor']) { |
261 | - $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running " . implode('.', $sspVersion)); |
|
261 | + $this->testReturn(\core\common\Entity::L_OK, "<strong>simpleSAMLphp</strong> is sufficently recent. You are running ".implode('.', $sspVersion)); |
|
262 | 262 | } else { |
263 | - $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least " . implode('.', $this->ssp_needversion)); |
|
263 | + $this->testReturn(\core\common\Entity::L_ERROR, "<strong>simpleSAMLphp</strong> is too old. We need at least ".implode('.', $this->ssp_needversion)); |
|
264 | 264 | } |
265 | 265 | } |
266 | 266 | } |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | * @return void |
315 | 315 | */ |
316 | 316 | private function logdir_test() { |
317 | - if (fopen(CONFIG['PATHS']['logdir'] . "/debug.log", "a") == FALSE) { |
|
318 | - $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>" . CONFIG['PATHS']['logdir'] . "</strong> are not writable!"); |
|
317 | + if (fopen(CONFIG['PATHS']['logdir']."/debug.log", "a") == FALSE) { |
|
318 | + $this->testReturn(\core\common\Entity::L_WARN, "Log files in <strong>".CONFIG['PATHS']['logdir']."</strong> are not writable!"); |
|
319 | 319 | } else { |
320 | 320 | $this->testReturn(\core\common\Entity::L_OK, "Log directory is writable."); |
321 | 321 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | } |
347 | 347 | |
348 | 348 | // on CentOS and RHEL 8, look for Gmagick, else Imagick |
349 | - if (strpos(php_uname("r"),"el8") !== FALSE) { |
|
349 | + if (strpos(php_uname("r"), "el8") !== FALSE) { |
|
350 | 350 | $classname = 'Gmagick'; |
351 | 351 | } else { |
352 | 352 | $classname = 'Imagick'; |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | private function openssl_test() { |
446 | 446 | $A = $this->getExecPath('openssl'); |
447 | 447 | if ($A['exec'] != "") { |
448 | - $t = exec($A['exec'] . ' version'); |
|
448 | + $t = exec($A['exec'].' version'); |
|
449 | 449 | if ($A['exec_is'] == "EXPLICIT") { |
450 | 450 | $this->testReturn(\core\common\Entity::L_OK, "<strong>$t</strong> was found and is configured explicitly in your config."); |
451 | 451 | } else { |
@@ -472,14 +472,14 @@ discard block |
||
472 | 472 | } |
473 | 473 | $A = $this->getExecPath('makensis'); |
474 | 474 | if ($A['exec'] != "") { |
475 | - $t = exec($A['exec'] . ' -VERSION'); |
|
475 | + $t = exec($A['exec'].' -VERSION'); |
|
476 | 476 | if ($A['exec_is'] == "EXPLICIT") { |
477 | 477 | $this->testReturn(\core\common\Entity::L_OK, "<strong>makensis $t</strong> was found and is configured explicitly in your config."); |
478 | 478 | } else { |
479 | 479 | $this->testReturn(\core\common\Entity::L_WARN, "<strong>makensis $t</strong> was found, but is not configured with an absolute path in your config."); |
480 | 480 | } |
481 | 481 | $outputArray = []; |
482 | - exec($A['exec'] . ' -HELP', $outputArray); |
|
482 | + exec($A['exec'].' -HELP', $outputArray); |
|
483 | 483 | $t1 = count(preg_grep('/INPUTCHARSET/', $outputArray)); |
484 | 484 | if ($t1 == 1 && CONFIG_CONFASSISTANT['NSIS_VERSION'] == 2) { |
485 | 485 | $this->testReturn(\core\common\Entity::L_ERROR, "Declared NSIS_VERSION does not seem to match the file pointed to by PATHS['makensis']!"); |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | $NSIS_Module_status = []; |
509 | 509 | foreach ($this->NSIS_Modules as $module) { |
510 | 510 | unset($out); |
511 | - exec(CONFIG_CONFASSISTANT['PATHS']['makensis'] . " -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
511 | + exec(CONFIG_CONFASSISTANT['PATHS']['makensis']." -V1 '-X!include $module' '-XOutFile $exe' '-XSection X' '-XSectionEnd'", $out, $retval); |
|
512 | 512 | if ($retval > 0) { |
513 | 513 | $NSIS_Module_status[$module] = 0; |
514 | 514 | } else { |
@@ -571,8 +571,8 @@ discard block |
||
571 | 571 | $locales = shell_exec("locale -a"); |
572 | 572 | $allthere = ""; |
573 | 573 | foreach (CONFIG['LANGUAGES'] as $onelanguage) { |
574 | - if (preg_match("/" . $onelanguage['locale'] . "/", $locales) == 0) { |
|
575 | - $allthere .= $onelanguage['locale'] . " "; |
|
574 | + if (preg_match("/".$onelanguage['locale']."/", $locales) == 0) { |
|
575 | + $allthere .= $onelanguage['locale']." "; |
|
576 | 576 | } |
577 | 577 | } |
578 | 578 | if ($allthere == "") { |
@@ -586,47 +586,47 @@ discard block |
||
586 | 586 | ["SETTING" => CONFIG['APPEARANCE']['from-mail'], |
587 | 587 | "DEFVALUE" => "[email protected]", |
588 | 588 | "COMPLAINTSTRING" => "APPEARANCE/from-mail ", |
589 | - "REQUIRED" => FALSE,], |
|
589 | + "REQUIRED" => FALSE, ], |
|
590 | 590 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['url'], |
591 | 591 | "DEFVALUE" => "[email protected]?body=Only%20English%20language%20please!", |
592 | 592 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/url ", |
593 | - "REQUIRED" => FALSE,], |
|
593 | + "REQUIRED" => FALSE, ], |
|
594 | 594 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['display'], |
595 | 595 | "DEFVALUE" => "[email protected]", |
596 | 596 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/display ", |
597 | - "REQUIRED" => FALSE,], |
|
597 | + "REQUIRED" => FALSE, ], |
|
598 | 598 | ["SETTING" => CONFIG['APPEARANCE']['support-contact']['developer-mail'], |
599 | 599 | "DEFVALUE" => "[email protected]", |
600 | 600 | "COMPLAINTSTRING" => "APPEARANCE/support-contact/mail ", |
601 | - "REQUIRED" => FALSE,], |
|
601 | + "REQUIRED" => FALSE, ], |
|
602 | 602 | ["SETTING" => CONFIG['APPEARANCE']['abuse-mail'], |
603 | 603 | "DEFVALUE" => "[email protected]", |
604 | 604 | "COMPLAINTSTRING" => "APPEARANCE/abuse-mail ", |
605 | - "REQUIRED" => FALSE,], |
|
605 | + "REQUIRED" => FALSE, ], |
|
606 | 606 | ["SETTING" => CONFIG['APPEARANCE']['MOTD'], |
607 | 607 | "DEFVALUE" => "Release Candidate. All bugs to be shot on sight!", |
608 | 608 | "COMPLAINTSTRING" => "APPEARANCE/MOTD ", |
609 | - "REQUIRED" => FALSE,], |
|
609 | + "REQUIRED" => FALSE, ], |
|
610 | 610 | ["SETTING" => CONFIG['APPEARANCE']['webcert_CRLDP'], |
611 | 611 | "DEFVALUE" => ['list', 'of', 'CRL', 'pointers'], |
612 | 612 | "COMPLAINTSTRING" => "APPEARANCE/webcert_CRLDP ", |
613 | - "REQUIRED" => TRUE,], |
|
613 | + "REQUIRED" => TRUE, ], |
|
614 | 614 | ["SETTING" => CONFIG['APPEARANCE']['webcert_OCSP'], |
615 | 615 | "DEFVALUE" => ['list', 'of', 'OCSP', 'pointers'], |
616 | 616 | "COMPLAINTSTRING" => "APPEARANCE/webcert_OCSP ", |
617 | - "REQUIRED" => TRUE,], |
|
617 | + "REQUIRED" => TRUE, ], |
|
618 | 618 | ["SETTING" => CONFIG['DB']['INST']['host'], |
619 | 619 | "DEFVALUE" => "db.host.example", |
620 | 620 | "COMPLAINTSTRING" => "DB/INST ", |
621 | - "REQUIRED" => TRUE,], |
|
621 | + "REQUIRED" => TRUE, ], |
|
622 | 622 | ["SETTING" => CONFIG['DB']['INST']['host'], |
623 | 623 | "DEFVALUE" => "db.host.example", |
624 | 624 | "COMPLAINTSTRING" => "DB/USER ", |
625 | - "REQUIRED" => TRUE,], |
|
625 | + "REQUIRED" => TRUE, ], |
|
626 | 626 | ["SETTING" => CONFIG['DB']['EXTERNAL']['host'], |
627 | 627 | "DEFVALUE" => "customerdb.otherhost.example", |
628 | 628 | "COMPLAINTSTRING" => "DB/EXTERNAL ", |
629 | - "REQUIRED" => FALSE,], |
|
629 | + "REQUIRED" => FALSE, ], |
|
630 | 630 | ]; |
631 | 631 | |
632 | 632 | /** |
@@ -652,11 +652,11 @@ discard block |
||
652 | 652 | |
653 | 653 | foreach (CONFIG_DIAGNOSTICS['RADIUSTESTS']['TLS-clientcerts'] as $cadata) { |
654 | 654 | foreach ($cadata['certificates'] as $cert_files) { |
655 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['public']) === FALSE) { |
|
656 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['public'] . " "; |
|
655 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['public']) === FALSE) { |
|
656 | + $defaultvalues .= "CERTIFICATE/".$cert_files['public']." "; |
|
657 | 657 | } |
658 | - if (file_get_contents(ROOT . "/config/cli-certs/" . $cert_files['private']) === FALSE) { |
|
659 | - $defaultvalues .= "CERTIFICATE/" . $cert_files['private'] . " "; |
|
658 | + if (file_get_contents(ROOT."/config/cli-certs/".$cert_files['private']) === FALSE) { |
|
659 | + $defaultvalues .= "CERTIFICATE/".$cert_files['private']." "; |
|
660 | 660 | } |
661 | 661 | } |
662 | 662 | } |
@@ -746,14 +746,14 @@ discard block |
||
746 | 746 | if ($global_no_cache) { |
747 | 747 | foreach ($Devs as $dev => $D) { |
748 | 748 | if (empty($D['options']['no_cache']) || $D['options']['no_cache'] != 0) { |
749 | - $no_cache_dev .= $dev . " "; |
|
749 | + $no_cache_dev .= $dev." "; |
|
750 | 750 | $no_cache_dev_count++; |
751 | 751 | } |
752 | 752 | } |
753 | 753 | } else { |
754 | 754 | foreach ($Devs as $dev => $D) { |
755 | 755 | if (!empty($D['options']['no_cache']) && $D['options']['no_cache'] != 0) { |
756 | - $no_cache_dev .= $dev . " "; |
|
756 | + $no_cache_dev .= $dev." "; |
|
757 | 757 | $no_cache_dev_count++; |
758 | 758 | } |
759 | 759 | } |
@@ -791,13 +791,13 @@ discard block |
||
791 | 791 | $mail->isHTML(FALSE); |
792 | 792 | $mail->CharSet = 'UTF-8'; |
793 | 793 | $mail->From = CONFIG['APPEARANCE']['from-mail']; |
794 | - $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Invitation System"; |
|
794 | + $mail->FromName = CONFIG['APPEARANCE']['productname']." Invitation System"; |
|
795 | 795 | $mail->addAddress(CONFIG['APPEARANCE']['abuse-mail']); |
796 | 796 | $mail->Subject = "testing CAT configuration mail"; |
797 | 797 | $mail->Body = "Testing CAT mailing\n"; |
798 | 798 | $sent = $mail->send(); |
799 | 799 | if ($sent) { |
800 | - $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check " . CONFIG['APPEARANCE']['abuse-mail'] . " mailbox if the message was receiced."); |
|
800 | + $this->testReturn(\core\common\Entity::L_OK, "mailer settings appear to be working, check ".CONFIG['APPEARANCE']['abuse-mail']." mailbox if the message was receiced."); |
|
801 | 801 | } else { |
802 | 802 | $this->testReturn(\core\common\Entity::L_ERROR, "mailer settings failed, check the Config::MAILSETTINGS"); |
803 | 803 | } |