@@ -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 != "NONE") { |
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 = "NONE"; |
159 | 159 | } |
160 | 160 | if ($encoding != "NONE") { |
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 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | if (isset(WindowsCommon::LANGS[$this->languageInstance->getLang()])) { |
236 | 236 | $language = WindowsCommon::LANGS[$this->languageInstance->getLang()]; |
237 | 237 | $this->lang = $language['nsis']; |
238 | - $this->codePage = 'cp' . $language['cp']; |
|
238 | + $this->codePage = 'cp'.$language['cp']; |
|
239 | 239 | } else { |
240 | 240 | $this->lang = 'English'; |
241 | 241 | $this->codePage = 'cp1252'; |
@@ -257,8 +257,8 @@ discard block |
||
257 | 257 | $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']); |
258 | 258 | $out .= "<p>"; |
259 | 259 | if ($ssidCount > $configCount) { |
260 | - $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)) . " "; |
|
261 | - $out .= '<strong>' . join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)) . '</strong>'; |
|
260 | + $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))." "; |
|
261 | + $out .= '<strong>'.join('</strong>, <strong>', array_diff(array_keys($ssids), $configList)).'</strong>'; |
|
262 | 262 | $out .= "<p>"; |
263 | 263 | } |
264 | 264 | // TODO - change this below |
@@ -274,8 +274,8 @@ discard block |
||
274 | 274 | $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."); |
275 | 275 | if ($ssidCount > 1) { |
276 | 276 | $out .= "<p>"; |
277 | - $out .= _("You will be required to enter the same credentials for each of the configured networks:") . " "; |
|
278 | - $out .= '<strong>' . join('</strong>, <strong>', array_keys($ssids)) . '</strong>'; |
|
277 | + $out .= _("You will be required to enter the same credentials for each of the configured networks:")." "; |
|
278 | + $out .= '<strong>'.join('</strong>, <strong>', array_keys($ssids)).'</strong>'; |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | return $out; |
@@ -380,13 +380,13 @@ discard block |
||
380 | 380 | */ |
381 | 381 | protected function signInstaller() |
382 | 382 | { |
383 | - $fileName = $this->installerBasename . '.exe'; |
|
383 | + $fileName = $this->installerBasename.'.exe'; |
|
384 | 384 | if (!$this->sign) { |
385 | 385 | rename("installer.exe", $fileName); |
386 | 386 | return $fileName; |
387 | 387 | } |
388 | 388 | // are actually signing |
389 | - $outputFromSigning = system($this->sign . " installer.exe '$fileName' > /dev/null"); |
|
389 | + $outputFromSigning = system($this->sign." installer.exe '$fileName' > /dev/null"); |
|
390 | 390 | if ($outputFromSigning === FALSE) { |
391 | 391 | $this->loggerInstance->debug(2, "Signing the WindowsCommon installer $fileName FAILED!\n"); |
392 | 392 | } |
@@ -400,15 +400,15 @@ discard block |
||
400 | 400 | */ |
401 | 401 | protected function compileNSIS() { |
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 | /** |
@@ -438,20 +438,20 @@ discard block |
||
438 | 438 | * @return string |
439 | 439 | */ |
440 | 440 | protected function writeNsisDefines($attr) { |
441 | - $fcontents = "\n" . '!define NSIS_MAJOR_VERSION ' . \config\ConfAssistant::NSIS_VERSION; |
|
441 | + $fcontents = "\n".'!define NSIS_MAJOR_VERSION '.\config\ConfAssistant::NSIS_VERSION; |
|
442 | 442 | if ($attr['internal:profile_count'][0] > 1) { |
443 | - $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage) . '" |
|
443 | + $fcontents .= "\n".'!define USER_GROUP "'.$this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0]), $this->codePage).'" |
|
444 | 444 | '; |
445 | 445 | } |
446 | - $fcontents .= ' |
|
447 | -Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
448 | -!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage) . '" |
|
449 | -!define VERSION "' . \core\CAT::VERSION_MAJOR . '.' . \core\CAT::VERSION_MINOR . '" |
|
446 | + $fcontents .= ' |
|
447 | +Caption "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
448 | +!define APPLICATION "' . $this->translateString(sprintf(WindowsCommon::sprintNsis(_("%s installer for %s")), \config\ConfAssistant::CONSORTIUM['display_name'], $attr['general:instname'][0]), $this->codePage).'" |
|
449 | +!define VERSION "' . \core\CAT::VERSION_MAJOR.'.'.\core\CAT::VERSION_MINOR.'" |
|
450 | 450 | !define INSTALLER_NAME "installer.exe" |
451 | -!define LANG "' . $this->lang . '" |
|
452 | -!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::LANGUAGES[$this->languageInstance->getLang()]['locale']) . '" |
|
451 | +!define LANG "' . $this->lang.'" |
|
452 | +!define LOCALE "' . preg_replace('/\..*$/', '', \config\Master::LANGUAGES[$this->languageInstance->getLang()]['locale']).'" |
|
453 | 453 | ;-------------------------------- |
454 | -!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage) . '" |
|
454 | +!define ORGANISATION "' . $this->translateString($attr['general:instname'][0], $this->codePage).'" |
|
455 | 455 | '; |
456 | 456 | $fcontents .= $this->getSupport($attr, 'email'); |
457 | 457 | $fcontents .= $this->getSupport($attr, 'url'); |
@@ -459,18 +459,18 @@ discard block |
||
459 | 459 | $fcontents .= '!define WIRED |
460 | 460 | '; |
461 | 461 | } |
462 | - $fcontents .= '!define PROVIDERID "urn:UUID:' . $this->deviceUUID . '" |
|
462 | + $fcontents .= '!define PROVIDERID "urn:UUID:'.$this->deviceUUID.'" |
|
463 | 463 | '; |
464 | 464 | if (!empty($attr['internal:realm'][0])) { |
465 | - $fcontents .= '!define REALM "' . $attr['internal:realm'][0] . '" |
|
465 | + $fcontents .= '!define REALM "'.$attr['internal:realm'][0].'" |
|
466 | 466 | '; |
467 | 467 | } |
468 | 468 | if (!empty($attr['internal:hint_userinput_suffix'][0]) && $attr['internal:hint_userinput_suffix'][0] == 1) { |
469 | - $fcontents .= '!define HINT_USER_INPUT "' . $attr['internal:hint_userinput_suffix'][0] . '" |
|
469 | + $fcontents .= '!define HINT_USER_INPUT "'.$attr['internal:hint_userinput_suffix'][0].'" |
|
470 | 470 | '; |
471 | 471 | } |
472 | 472 | if (!empty($attr['internal:verify_userinput_suffix'][0]) && $attr['internal:verify_userinput_suffix'][0] == 1) { |
473 | - $fcontents .= '!define VERIFY_USER_REALM_INPUT "' . $attr['internal:verify_userinput_suffix'][0] . '" |
|
473 | + $fcontents .= '!define VERIFY_USER_REALM_INPUT "'.$attr['internal:verify_userinput_suffix'][0].'" |
|
474 | 474 | '; |
475 | 475 | } |
476 | 476 | $fcontents .= $this->msInfoFile($attr); |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $out .= '!define EXTERNAL_INFO "'; |
492 | 492 | // $this->loggerInstance->debug(4,"Info file type ".$attr['support:info_file'][0]['mime']."\n"); |
493 | 493 | if ($attr['internal:info_file'][0]['mime'] == 'rtf') { |
494 | - $out = '!define LICENSE_FILE "' . $attr['internal:info_file'][0]['name']; |
|
494 | + $out = '!define LICENSE_FILE "'.$attr['internal:info_file'][0]['name']; |
|
495 | 495 | } elseif ($attr['internal:info_file'][0]['mime'] == 'txt') { |
496 | 496 | $infoFile = file_get_contents($attr['internal:info_file'][0]['name']); |
497 | 497 | if ($infoFile === FALSE) { |
@@ -500,14 +500,14 @@ discard block |
||
500 | 500 | if (\config\ConfAssistant::NSIS_VERSION >= 3) { |
501 | 501 | $infoFileConverted = $infoFile; |
502 | 502 | } else { |
503 | - $infoFileConverted = iconv('UTF-8', $this->codePage . '//TRANSLIT', $infoFile); |
|
503 | + $infoFileConverted = iconv('UTF-8', $this->codePage.'//TRANSLIT', $infoFile); |
|
504 | 504 | } |
505 | 505 | if ($infoFileConverted !== FALSE && strlen($infoFileConverted) > 0) { |
506 | 506 | file_put_contents('info_f.txt', $infoFileConverted); |
507 | 507 | $out = '!define LICENSE_FILE " info_f.txt'; |
508 | 508 | } |
509 | 509 | } else { |
510 | - $out = '!define EXTERNAL_INFO "' . $attr['internal:info_file'][0]['name']; |
|
510 | + $out = '!define EXTERNAL_INFO "'.$attr['internal:info_file'][0]['name']; |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | $out .= "\"\n"; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | return $this->counter; |
132 | 132 | } |
133 | 133 | |
134 | - $cachedNumber = @file_get_contents(ROOT . "/var/tmp/cachedSPNumber.serialised"); |
|
134 | + $cachedNumber = @file_get_contents(ROOT."/var/tmp/cachedSPNumber.serialised"); |
|
135 | 135 | if ($cachedNumber !== FALSE) { |
136 | 136 | $numberData = unserialize($cachedNumber); |
137 | 137 | $now = new \DateTime(); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } else { // data in cache is too old or doesn't exist. We really need to ask the database |
145 | 145 | $list = $this->listAllServiceProviders(); |
146 | 146 | $this->counter = count($list); |
147 | - file_put_contents(ROOT . "/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()])); |
|
147 | + file_put_contents(ROOT."/var/tmp/cachedSPNumber.serialised", serialize(["number" => $this->counter, "timestamp" => new \DateTime()])); |
|
148 | 148 | return $this->counter; |
149 | 149 | } |
150 | 150 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $returnarray = []; |
176 | 176 | $query = "SELECT id_institution AS id, country, inst_realm as realmlist, name AS collapsed_name, contact AS collapsed_contact, type FROM view_active_institution WHERE country = ?"; |
177 | 177 | if ($eduroamDbType !== NULL) { |
178 | - $query .= " AND ( type = '" . ExternalEduroamDBData::TYPE_IDPSP . "' OR type = '" . $eduroamDbType . "')"; |
|
178 | + $query .= " AND ( type = '".ExternalEduroamDBData::TYPE_IDPSP."' OR type = '".$eduroamDbType."')"; |
|
179 | 179 | } |
180 | 180 | $externals = $this->db->exec($query, "s", $tld); |
181 | 181 | // was a SELECT query, so a resource and not a boolean |
@@ -45,11 +45,11 @@ discard block |
||
45 | 45 | ], |
46 | 46 | [ |
47 | 47 | 'title' => sprintf(_("Is it safe to use %s installers?"), \config\Master::APPEARANCE['productname']), |
48 | - 'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Master::APPEARANCE['productname']) . ' ' . ( isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""), |
|
48 | + 'text' => sprintf(_("%s installers configure security settings on your device, therefore you should be sure that you are using genuine ones."), \config\Master::APPEARANCE['productname']).' '.(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("This is why %s installers are digitally signed by %s. Watch out for a system message confirming this."), \config\Master::APPEARANCE['productname'], \config\ConfAssistant::CONSORTIUM['signer_name']) : ""), |
|
49 | 49 | ], |
50 | 50 | [ |
51 | 51 | 'title' => _("Windows 'SmartScreen' or 'Internet Explorer' tell me that the file is not commonly downloaded and possibly harmful. Should I be concerned?"), |
52 | - 'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.") . " " . (isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name']) . " " : "") . sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>") |
|
52 | + 'text' => _("Contrary to what the name suggests, 'SmartScreen' isn't actually very smart. The warning merely means that the file has not yet been downloaded by enough users to make Microsoft consider it popular (which would strangely enough make it be considered 'safe'). This message alone is not a security problem.")." ".(isset(\config\ConfAssistant::CONSORTIUM['signer_name']) && \config\ConfAssistant::CONSORTIUM['signer_name'] != "" ? sprintf(_("So long as the file is carrying a valid signature from %s, the download is safe."), \config\ConfAssistant::CONSORTIUM['signer_name'])." " : "").sprintf(_("Please see also Microsoft's FAQ regarding SmartScreen at %s."), "<a href='http://windows.microsoft.com/en-US/windows7/SmartScreen-Filter-frequently-asked-questions-IE9?SignedIn=1'>Microsoft FAQ</a>") |
|
53 | 53 | ], |
54 | 54 | [ |
55 | 55 | 'title' => sprintf(_("I can see %s network and my device is configured but it does not connect, what can be the cause?"), \config\ConfAssistant::CONSORTIUM['display_name']), |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $consortium = \config\ConfAssistant::CONSORTIUM['display_name']; |
69 | 69 | array_push($Faq, |
70 | 70 | [ |
71 | - 'id' => 'what_is_' . \config\ConfAssistant::CONSORTIUM['name'], |
|
71 | + 'id' => 'what_is_'.\config\ConfAssistant::CONSORTIUM['name'], |
|
72 | 72 | 'title' => sprintf(_("What is this %s thing anyway?"), $consortium), |
73 | 73 | 'text' => sprintf(_("%s is a global WiFi roaming consortium which gives members of education and research access to the internet <i>for free</i> on all %s hotspots on the planet. There are several million %s users already, enjoying free internet access on more than %d hotspots! Visit <a href='http://www.eduroam.org'>the %s homepage</a> or <a href='http://monitor.eduroam.org/map_service_loc.php'>the %s location map</a> for more details."), $consortium, $consortium, $consortium, $SPs, $consortium, $consortium) |
74 | 74 | ]); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | <table><tr> |
291 | 291 | <td class='icon_td'>"; |
292 | 292 | $out[] = "<img src='".$this->stateIcons[$this->globalLevelStatic]."' id='main_static_ico' class='icon'></td><td id='main_static_result'>". |
293 | - $this->globalInfo[$this->globalLevelStatic].' '. _("See the appropriate tab for details.").'</td> |
|
293 | + $this->globalInfo[$this->globalLevelStatic].' '._("See the appropriate tab for details.").'</td> |
|
294 | 294 | </tr></table>'; |
295 | 295 | if ($this->naptr > 0) { |
296 | 296 | $out[] = "<hr><strong>"._("Dynamic connectivity tests")."</strong> |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | <td class='icon_td'><img src='".$this->stateIcons[$result->level]."' id='src".$hostindex."_img'></td> |
324 | 324 | <td id='src$hostindex' colspan=2> |
325 | 325 | "; |
326 | - $out[] = '<strong>'.($result->server ? $result->server : _("Connected to undetermined server")).'</strong><br/>'.sprintf (_("elapsed time: %sms."), $result->time_millisec).'<p>'.$result->message.'</p>'; |
|
326 | + $out[] = '<strong>'.($result->server ? $result->server : _("Connected to undetermined server")).'</strong><br/>'.sprintf(_("elapsed time: %sms."), $result->time_millisec).'<p>'.$result->message.'</p>'; |
|
327 | 327 | |
328 | 328 | if ($result->level > \core\common\Entity::L_OK && property_exists($result, 'cert_oddities')) { |
329 | 329 | foreach ($result->cert_oddities as $oddities) { |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | } else { |
409 | 409 | $certdesc = '<br>'; |
410 | 410 | } |
411 | - $capathtest[] = '<div>'.($capath->message!='' ? $capath->message : _('Test failed')).'</div>'.$more; |
|
411 | + $capathtest[] = '<div>'.($capath->message != '' ? $capath->message : _('Test failed')).'</div>'.$more; |
|
412 | 412 | $capathtest[] = '</td> |
413 | 413 | </tr> |
414 | 414 | </table>'; |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | $srefused = 0; |
435 | 435 | $cliinfo = ''; |
436 | 436 | $cliinfo .= '<li>'._('Client certificate').' <b>'.$ca->clientcertinfo->from. |
437 | - '</b>'.', '.$ca->clientcertinfo->message . |
|
437 | + '</b>'.', '.$ca->clientcertinfo->message. |
|
438 | 438 | '<br> (CA: '.$ca->clientcertinfo->issuer.')<ul>'; |
439 | 439 | foreach ($ca->certificate as $certificate) { |
440 | 440 | if ($certificate->returncode == \core\diag\RADIUSTests::RETVAL_CONNECTION_REFUSED) { |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | } else { |
495 | 495 | $cliinfo = _('Test failed'); |
496 | 496 | $clientstest[] = "<table><tr><td class='icon_td' id='srcclient".$hostindex."_img'><img src='". |
497 | - $this->stateIcons[\core\common\Entity::L_WARN]."'></td>" . |
|
497 | + $this->stateIcons[\core\common\Entity::L_WARN]."'></td>". |
|
498 | 498 | "<td id='srcclient$hostindex'>$cliinfo</td></tr></table>"; |
499 | 499 | } |
500 | 500 | } else { |
@@ -146,12 +146,12 @@ discard block |
||
146 | 146 | $this->marshalObject($root, $eapIdp); |
147 | 147 | $dom = dom_import_simplexml($root)->ownerDocument; |
148 | 148 | //TODO schema validation makes sense so probably should be used |
149 | - if ($dom->schemaValidate(ROOT . '/devices/xml/eap-metadata.xsd') === FALSE) { |
|
149 | + if ($dom->schemaValidate(ROOT.'/devices/xml/eap-metadata.xsd') === FALSE) { |
|
150 | 150 | throw new Exception("Schema validation failed for eap-metadata"); |
151 | 151 | } |
152 | 152 | $dom->formatOutput = true; |
153 | - file_put_contents($this->installerBasename . '.eap-config', $dom->saveXML()); |
|
154 | - return($this->installerBasename . '.eap-config'); |
|
153 | + file_put_contents($this->installerBasename.'.eap-config', $dom->saveXML()); |
|
154 | + return($this->installerBasename.'.eap-config'); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | private const ATTRIBUTENAMES = [ |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $this->loggerInstance->debug(4, "Missing class definition for $attrName\n"); |
178 | 178 | return([]); |
179 | 179 | } |
180 | - $className = "\devices\xml\\" . self::ATTRIBUTENAMES[$attrName]; |
|
180 | + $className = "\devices\xml\\".self::ATTRIBUTENAMES[$attrName]; |
|
181 | 181 | $objs = []; |
182 | 182 | if ($this->langScope === 'global') { |
183 | 183 | foreach ($attributeList['langs'] as $language => $value) { |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $displayname = new DisplayName(); |
216 | 216 | if (isset($profileNameLangs)) { |
217 | 217 | $langOrC = isset($profileNameLangs[$language]) ? $profileNameLangs[$language] : $profileNameLangs['C']; |
218 | - $value .= ' - ' . $langOrC; |
|
218 | + $value .= ' - '.$langOrC; |
|
219 | 219 | } |
220 | 220 | $displayname->setValue($value); |
221 | 221 | $displayname->setAttributes(['lang' => $language]); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $displayname = new DisplayName(); |
226 | 226 | $value = $attr['general:instname'][0]; |
227 | 227 | if ($attr['internal:profile_count'][0] > 1) { |
228 | - $value .= ' - ' . $attr['profile:name'][0]; |
|
228 | + $value .= ' - '.$attr['profile:name'][0]; |
|
229 | 229 | } |
230 | 230 | $displayname->setValue($value); |
231 | 231 | $objs[] = $displayname; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $attr = $this->attributes; |
243 | 243 | if (isset($attr['general:logo_file'][0])) { |
244 | 244 | $logoString = base64_encode($attr['general:logo_file'][0]); |
245 | - $logoMime = 'image/' . $attr['internal:logo_file'][0]['mime']; |
|
245 | + $logoMime = 'image/'.$attr['internal:logo_file'][0]['mime']; |
|
246 | 246 | $providerlogo = new ProviderLogo(); |
247 | 247 | $providerlogo->setAttributes(['mime' => $logoMime, 'encoding' => 'base64']); |
248 | 248 | $providerlogo->setValue($logoString); |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | |
348 | 348 | if (isset($inner["METHOD"]) && $inner["METHOD"]) { |
349 | 349 | $innerauthmethod = new InnerAuthenticationMethod(); |
350 | - $typeOfInner = "\devices\xml\\" . ($inner["EAP"] ? 'EAPMethod' : 'NonEAPAuthMethod'); |
|
350 | + $typeOfInner = "\devices\xml\\".($inner["EAP"] ? 'EAPMethod' : 'NonEAPAuthMethod'); |
|
351 | 351 | $eapmethod = new $typeOfInner(); |
352 | 352 | $eaptype = new Type(); |
353 | 353 | $eaptype->setValue(abs($inner['METHOD'])); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * License: see the web/copyright.inc.php file in the file structure or |
20 | 20 | * <base_url>/copyright.php after deploying the software |
21 | 21 | */ |
22 | - ?> |
|
22 | + ?> |
|
23 | 23 | <script> |
24 | 24 | var L_OK = <?php echo \core\common\Entity::L_OK ?>; |
25 | 25 | var L_WARN = <?php echo \core\common\Entity::L_WARN ?>; |
@@ -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(__DIR__)) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(__DIR__))."/config/_config.php"; |
|
23 | 23 | |
24 | 24 | $loggerInstance = new \core\common\Logging(); |
25 | 25 | |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | $testsuite = new \core\diag\RADIUSTests($check_realm, $testedProfile->getRealmCheckOuterUsername(), $testedProfile->getEapMethodsinOrderOfPreference(1), $testedProfile->getCollapsedAttributes()['eap:server_name'], $testedProfile->getCollapsedAttributes()["eap:ca_file"]); |
66 | 66 | $rfc7585suite = new \core\diag\RFC7585Tests($check_realm); |
67 | 67 | } else { |
68 | - $error_message = _("You asked for a realm check, but we don't know the realm for this profile!") . "</p>"; |
|
68 | + $error_message = _("You asked for a realm check, but we don't know the realm for this profile!")."</p>"; |
|
69 | 69 | } |
70 | 70 | } else { // someone else's realm, and we don't know anything about it... only shallow checks |
71 | 71 | $check_realm = $validator->realm($realm ?? $_SESSION['check_realm'] ?? ""); |
72 | 72 | if ($check_realm !== FALSE) { |
73 | 73 | $_SESSION['check_realm'] = $check_realm; |
74 | - $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm); |
|
74 | + $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm); |
|
75 | 75 | $rfc7585suite = new \core\diag\RFC7585Tests($check_realm); |
76 | 76 | } else { |
77 | 77 | $error_message = _("No valid realm name given, cannot execute any checks!"); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | var listofcas = "<?php echo _("You should update your list of accredited CAs") ?>"; |
120 | 120 | var getitfrom = "<?php echo _("Get it from here.") ?>"; |
121 | 121 | var listsource = "<?php echo \config\Diagnostics::RADIUSTESTS['accreditedCAsURL'] ?>"; |
122 | - var moretext = "<?php echo _("more") . "»" ?>"; |
|
122 | + var moretext = "<?php echo _("more")."»" ?>"; |
|
123 | 123 | var lesstext = "<?php echo "«" ?>"; |
124 | 124 | var morealltext = "<?php echo _("Show detailed information for all tests") ?>"; |
125 | 125 | var unknownca_code = "<?php echo \core\diag\RADIUSTests::CERTPROB_UNKNOWN_CA ?>"; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | } |
257 | 257 | } |
258 | 258 | cliinfo = cliinfo + '<li><table><tbody><tr><td class="icon_td"><img class="icon" src="' + icons[level] + '" style="width: 24px;"></td><td>' + state; |
259 | - cliinfo = cliinfo + ' <?php echo "(" . sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+' ") . ")"; ?>' + add + '</td></tr>'; |
|
259 | + cliinfo = cliinfo + ' <?php echo "(".sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+' ").")"; ?>' + add + '</td></tr>'; |
|
260 | 260 | cliinfo = cliinfo + '</tbody></table></ul></li>'; |
261 | 261 | if (data.ca[key].certificate[c].finalerror === 1) { |
262 | 262 | cliinfo = cliinfo + '<li>' + restskipped + '</li>'; |
@@ -425,8 +425,8 @@ discard block |
||
425 | 425 | <?php |
426 | 426 | foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) { |
427 | 427 | print " |
428 | -$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading); |
|
429 | -$(\"#live_src" . $hostindex . "_img\").show(); |
|
428 | +$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading); |
|
429 | +$(\"#live_src" . $hostindex."_img\").show(); |
|
430 | 430 | $.ajax({ |
431 | 431 | url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm, |
432 | 432 | type: 'POST', |
@@ -456,15 +456,15 @@ discard block |
||
456 | 456 | <?php |
457 | 457 | foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) { |
458 | 458 | if ($testedProfile !== NULL) { |
459 | - $extraarg = "profile_id: " . $testedProfile->identifier . ", "; |
|
459 | + $extraarg = "profile_id: ".$testedProfile->identifier.", "; |
|
460 | 460 | } else { |
461 | 461 | $extraarg = ""; |
462 | 462 | } |
463 | 463 | print " |
464 | -$(\"#src" . $hostindex . "_img\").attr('src',icon_loading); |
|
464 | +$(\"#src" . $hostindex."_img\").attr('src',icon_loading); |
|
465 | 465 | $(\"#src$hostindex\").html(''); |
466 | 466 | running_ajax_stat++; |
467 | -$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex' }, udp, 'json'); |
|
467 | +$.get('radius_tests.php',{test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex' }, udp, 'json'); |
|
468 | 468 | |
469 | 469 | "; |
470 | 470 | } |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | if ($check_realm === FALSE) { |
492 | 492 | print "<p>$error_message</p>"; |
493 | 493 | } else { |
494 | - print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n"; |
|
494 | + print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n"; |
|
495 | 495 | ?> |
496 | 496 | <div id="debug_out" style="display: none"></div> |
497 | 497 | <div id="tabs" style="min-width: 600px; max-width:800px"> |
@@ -508,12 +508,12 @@ discard block |
||
508 | 508 | </legend> |
509 | 509 | <?php |
510 | 510 | // NAPTR existence check |
511 | - echo "<strong>" . _("DNS chekcs") . "</strong><div>"; |
|
511 | + echo "<strong>"._("DNS chekcs")."</strong><div>"; |
|
512 | 512 | $naptr = $rfc7585suite->relevantNAPTR(); |
513 | 513 | if ($naptr != \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) { |
514 | 514 | echo "<table>"; |
515 | 515 | // output in friendly words |
516 | - echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>"; |
|
516 | + echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>"; |
|
517 | 517 | switch ($naptr) { |
518 | 518 | case \core\diag\RFC7585Tests::RETVAL_NONAPTR: |
519 | 519 | echo _("This realm has no NAPTR records."); |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | |
529 | 529 | // compliance checks for NAPTRs |
530 | 530 | if ($naptr > 0) { |
531 | - echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>"; |
|
531 | + echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>"; |
|
532 | 532 | $naptr_valid = $rfc7585suite->relevantNAPTRcompliance(); |
533 | 533 | switch ($naptr_valid) { |
534 | 534 | case \core\diag\RADIUSTests::RETVAL_OK: |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | |
546 | 546 | if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) { |
547 | 547 | $srv = $rfc7585suite->relevantNAPTRsrvResolution(); |
548 | - echo "<tr><td>" . _("Checking SRVs:") . "</td><td>"; |
|
548 | + echo "<tr><td>"._("Checking SRVs:")."</td><td>"; |
|
549 | 549 | switch ($srv) { |
550 | 550 | case \core\diag\RADIUSTests::RETVAL_SKIPPED: |
551 | 551 | echo _("This check was skipped."); |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | // IP addresses for the hosts |
562 | 562 | if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) { |
563 | 563 | $hosts = $rfc7585suite->relevantNAPTRhostnameResolution(); |
564 | - echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>"; |
|
564 | + echo "<tr><td>"._("Checking IP address resolution:")."</td><td>"; |
|
565 | 565 | switch ($srv) { |
566 | 566 | case \core\diag\RADIUSTests::RETVAL_SKIPPED: |
567 | 567 | echo _("This check was skipped."); |
@@ -577,12 +577,12 @@ discard block |
||
577 | 577 | |
578 | 578 | echo "</table><br/><br/>"; |
579 | 579 | if (count($testsuite->listerrors()) == 0) { |
580 | - echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!"); |
|
580 | + echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!"); |
|
581 | 581 | } else { |
582 | - echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("but there were DNS errors! Check them!") . " " . _("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below."); |
|
582 | + echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("but there were DNS errors! Check them!")." "._("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below."); |
|
583 | 583 | echo "<div class='notacceptable'><table>"; |
584 | 584 | foreach ($testsuite->listerrors() as $details) { |
585 | - echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>"; |
|
585 | + echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>"; |
|
586 | 586 | } |
587 | 587 | echo "</table></div>"; |
588 | 588 | } |
@@ -598,26 +598,26 @@ discard block |
||
598 | 598 | $("#dynamic_tests").show(); |
599 | 599 | '; |
600 | 600 | foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) { |
601 | - $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port']; |
|
601 | + $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port']; |
|
602 | 602 | $expectedName = $addr['hostname']; |
603 | 603 | print " |
604 | 604 | running_ajax_dyn++; |
605 | - $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); |
|
605 | + $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); |
|
606 | 606 | running_ajax_dyn++; |
607 | - $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); |
|
607 | + $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex' }, error: eee, success: clients, dataType: 'json'}); |
|
608 | 608 | "; |
609 | 609 | } |
610 | 610 | echo "} |
611 | 611 | </script><hr>"; |
612 | 612 | } else { |
613 | - echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>"; |
|
613 | + echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>"; |
|
614 | 614 | } |
615 | - echo "<strong>" . _("Static connectivity tests") . "</strong> |
|
615 | + echo "<strong>"._("Static connectivity tests")."</strong> |
|
616 | 616 | <table><tr> |
617 | 617 | <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_static_ico' class='icon'></td><td id='main_static_result' style='display:none'> </td> |
618 | 618 | </tr></table>"; |
619 | 619 | if ($naptr > 0) { |
620 | - echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong> |
|
620 | + echo "<hr><strong>"._("Dynamic connectivity tests")."</strong> |
|
621 | 621 | <table><tr> |
622 | 622 | <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_dynamic_ico' class='icon'></td><td id='main_dynamic_result' style='display:none'> </td> |
623 | 623 | </tr></table>"; |
@@ -637,12 +637,12 @@ discard block |
||
637 | 637 | print "<p>"; |
638 | 638 | foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) { |
639 | 639 | print "<hr>"; |
640 | - printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>"); |
|
640 | + printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>"); |
|
641 | 641 | print "<table id='results$hostindex' style='width:100%' class='udp_results'> |
642 | 642 | <tr> |
643 | -<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td> |
|
643 | +<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td> |
|
644 | 644 | <td id='src$hostindex' colspan=2> |
645 | -" . _("testing...") . " |
|
645 | +"._("testing...")." |
|
646 | 646 | </td> |
647 | 647 | </tr> |
648 | 648 | </table>"; |
@@ -661,21 +661,21 @@ discard block |
||
661 | 661 | |
662 | 662 | <?php |
663 | 663 | echo "<div id='dynamic_tests'><fieldset class='option_container'> |
664 | - <legend><strong>" . _("DYNAMIC connectivity tests") . "</strong></legend>"; |
|
664 | + <legend><strong>" . _("DYNAMIC connectivity tests")."</strong></legend>"; |
|
665 | 665 | |
666 | 666 | $resultstoprint = []; |
667 | 667 | if (count($rfc7585suite->NAPTR_hostname_records) > 0) { |
668 | - $resultstoprint[] = '<div style="align:right; display: none;" id="dynamic_result_fail">' . _("Some errors were found during the tests, see below") . '</div><div style="align:right; display: none;" id="dynamic_result_pass">' . _("All tests passed, congratulations!") . '</div>'; |
|
669 | - $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>"; |
|
668 | + $resultstoprint[] = '<div style="align:right; display: none;" id="dynamic_result_fail">'._("Some errors were found during the tests, see below").'</div><div style="align:right; display: none;" id="dynamic_result_pass">'._("All tests passed, congratulations!").'</div>'; |
|
669 | + $resultstoprint[] = '<div style="align:right;"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>"; |
|
670 | 670 | foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) { |
671 | - $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]); |
|
672 | - $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong>'; |
|
671 | + $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]); |
|
672 | + $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong>'; |
|
673 | 673 | $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>'; |
674 | 674 | $resultstoprint[] = "<table id='caresults$hostindex' style='width:100%'> |
675 | 675 | <tr> |
676 | -<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca" . $hostindex . "_img'></td> |
|
676 | +<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcca".$hostindex."_img'></td> |
|
677 | 677 | <td id='srcca$hostindex'> |
678 | -" . _("testing...") . " |
|
678 | +"._("testing...")." |
|
679 | 679 | </td> |
680 | 680 | </tr> |
681 | 681 | </table>"; |
@@ -683,12 +683,12 @@ discard block |
||
683 | 683 | } |
684 | 684 | $clientstest = []; |
685 | 685 | foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) { |
686 | - $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>'; |
|
686 | + $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>'; |
|
687 | 687 | $clientstest[] = "<span id='clientresults$hostindex$clinx'><table style='width:100%'> |
688 | 688 | <tr> |
689 | -<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient" . $hostindex . "_img'></td> |
|
689 | +<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='srcclient".$hostindex."_img'></td> |
|
690 | 690 | <td id='srcclient$hostindex'> |
691 | -" . _("testing...") . " |
|
691 | +"._("testing...")." |
|
692 | 692 | </td> |
693 | 693 | </tr> |
694 | 694 | </table></span>"; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | } |
697 | 697 | echo '<div style="align:right;">'; |
698 | 698 | echo join('', $resultstoprint); |
699 | - echo '<span id="clientstest" style="display: none;"><p><hr><b>' . _('Checking if certificates from CAs are accepted...') . '</b><p>' . _('A few client certificates will be tested to check if servers are resistant to some certificate problems.') . '<p>'; |
|
699 | + echo '<span id="clientstest" style="display: none;"><p><hr><b>'._('Checking if certificates from CAs are accepted...').'</b><p>'._('A few client certificates will be tested to check if servers are resistant to some certificate problems.').'<p>'; |
|
700 | 700 | print join('', $clientstest); |
701 | 701 | echo '</span>'; |
702 | 702 | echo '</div>'; |
@@ -710,7 +710,7 @@ discard block |
||
710 | 710 | // check if truncates/dies on Operator-Name |
711 | 711 | if ($my_profile !== NULL) { |
712 | 712 | echo "<div id='tabs-4'><fieldset class='option_container'> |
713 | - <legend><strong>" . _("Live login test") . "</strong></legend>"; |
|
713 | + <legend><strong>" . _("Live login test")."</strong></legend>"; |
|
714 | 714 | $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1); |
715 | 715 | if (count($prof_compl) > 0) { |
716 | 716 | $passwordReqired = FALSE; |
@@ -723,34 +723,34 @@ discard block |
||
723 | 723 | $clientCertRequired = TRUE; |
724 | 724 | } |
725 | 725 | } |
726 | - echo "<div id='disposable_credential_container'><p>" . _("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.") . "</p> |
|
727 | - <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.") . "</p> |
|
728 | - <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!") . "</p></div> |
|
726 | + echo "<div id='disposable_credential_container'><p>"._("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.")."</p> |
|
727 | + <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.")."</p> |
|
728 | + <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!")."</p></div> |
|
729 | 729 | <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'> |
730 | 730 | <input type='hidden' name='test_type' value='udp_login'> |
731 | - <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang() . "'> |
|
732 | - <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'> |
|
731 | + <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang()."'> |
|
732 | + <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'> |
|
733 | 733 | <table id='live_tests'>"; |
734 | 734 | // if any password based EAP methods are available enable this section |
735 | 735 | if ($passwordReqired) { |
736 | - echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr> |
|
737 | - <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>"; |
|
738 | - echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>"; |
|
739 | - echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>"; |
|
736 | + echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr> |
|
737 | + <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>"; |
|
738 | + echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>"; |
|
739 | + echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>"; |
|
740 | 740 | } |
741 | 741 | // ask for cert + privkey if TLS-based method is active |
742 | 742 | if ($clientCertRequired) { |
743 | - echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr> |
|
744 | - <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr> |
|
745 | - <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr> |
|
746 | - <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>"; |
|
743 | + echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr> |
|
744 | + <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr> |
|
745 | + <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr> |
|
746 | + <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>"; |
|
747 | 747 | } |
748 | - echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>"; |
|
748 | + echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>"; |
|
749 | 749 | echo "<div id='live_login_results' style='display:none'>"; |
750 | 750 | foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) { |
751 | 751 | print "<hr>"; |
752 | - printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>"); |
|
753 | - print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src" . $hostindex . "_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>"; |
|
752 | + printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>"); |
|
753 | + print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src".$hostindex."_img' style='width:24px; position: absolute; left: 20px; bottom: 0px; '></span>"; |
|
754 | 754 | print "<div id='eap_test$hostindex' class='eap_test_results'></div>"; |
755 | 755 | } |
756 | 756 | echo "</div>"; |
@@ -765,9 +765,9 @@ discard block |
||
765 | 765 | } |
766 | 766 | |
767 | 767 | if (isset($_POST['comefrom'])) { |
768 | - $return = htmlspecialchars_decode($_POST['comefrom']) . ( $inst_id ? "?inst_id=" . $inst_id : "" ); |
|
768 | + $return = htmlspecialchars_decode($_POST['comefrom']).($inst_id ? "?inst_id=".$inst_id : ""); |
|
769 | 769 | echo "<form method='post' action='$return' accept-charset='UTF-8'> |
770 | - <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst) . "</button>" |
|
770 | + <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_inst)."</button>" |
|
771 | 771 | . "</form>"; |
772 | 772 | } |
773 | 773 | if ($check_realm !== FALSE) { |
@@ -4,12 +4,12 @@ |
||
4 | 4 | define('OPNAME_SUFFIX', '.hosted.eduroam.org'); |
5 | 5 | |
6 | 6 | function cat_socket($obj) { |
7 | - $sock = socket_create(AF_UNIX, SOCK_STREAM, 0); |
|
8 | - $conn = socket_connect($sock, SOCKET); |
|
9 | - if ( $conn ) { |
|
10 | - socket_write ($sock, $obj, strlen($obj)); |
|
11 | - $out = socket_read ($sock, 2048); |
|
12 | - return $out; |
|
13 | - } |
|
14 | - return 'FAILURE'; |
|
7 | + $sock = socket_create(AF_UNIX, SOCK_STREAM, 0); |
|
8 | + $conn = socket_connect($sock, SOCKET); |
|
9 | + if ( $conn ) { |
|
10 | + socket_write ($sock, $obj, strlen($obj)); |
|
11 | + $out = socket_read ($sock, 2048); |
|
12 | + return $out; |
|
13 | + } |
|
14 | + return 'FAILURE'; |
|
15 | 15 | } |
@@ -6,9 +6,9 @@ |
||
6 | 6 | function cat_socket($obj) { |
7 | 7 | $sock = socket_create(AF_UNIX, SOCK_STREAM, 0); |
8 | 8 | $conn = socket_connect($sock, SOCKET); |
9 | - if ( $conn ) { |
|
10 | - socket_write ($sock, $obj, strlen($obj)); |
|
11 | - $out = socket_read ($sock, 2048); |
|
9 | + if ($conn) { |
|
10 | + socket_write($sock, $obj, strlen($obj)); |
|
11 | + $out = socket_read($sock, 2048); |
|
12 | 12 | return $out; |
13 | 13 | } |
14 | 14 | return 'FAILURE'; |
@@ -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(dirname(__FILE__)))) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php"; |
|
23 | 23 | |
24 | 24 | $auth = new \web\lib\admin\Authentication(); |
25 | 25 | $loggerInstance = new \core\common\Logging(); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $remaining_attribs = $my_profile->beginFlushMethodLevelAttributes($eaptype->getIntegerRep(), NULL); |
86 | 86 | $optionParser->processSubmittedFields($my_profile, $_POST, $_FILES, $eaptype->getIntegerRep(), NULL); |
87 | 87 | } |
88 | - $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $my_profile->identifier . " - device/EAP-Type settings changed"); |
|
88 | + $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile ".$my_profile->identifier." - device/EAP-Type settings changed"); |
|
89 | 89 | header("Location: ../overview_installers.php?inst_id=$my_inst->identifier&profile_id=$my_profile->identifier"); |
90 | 90 | exit; |
91 | 91 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | $captiontext = sprintf(_("device <strong>%s</strong>"), $device['display']); |
101 | 101 | $keyword = "device-specific"; |
102 | - $extrainput = "<input type='hidden' name='device' value='" . $device_key . "'/>"; |
|
102 | + $extrainput = "<input type='hidden' name='device' value='".$device_key."'/>"; |
|
103 | 103 | } elseif ($eaptype !== NULL) { |
104 | 104 | foreach ($my_profile->getAttributes() as $attrib) { |
105 | 105 | if (isset($attrib['eapmethod']) && $attrib['eapmethod'] == $eaptype->getArrayRep()) { |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | |
110 | 110 | $captiontext = sprintf(_("EAP-Type <strong>%s</strong>"), $eaptype->getPrintableRep()); |
111 | 111 | $keyword = "eap-specific"; |
112 | - $extrainput = "<input type='hidden' name='eaptype' value='" . $eaptype->getIntegerRep() . "'>"; |
|
112 | + $extrainput = "<input type='hidden' name='eaptype' value='".$eaptype->getIntegerRep()."'>"; |
|
113 | 113 | } else { |
114 | 114 | throw new Exception("previous type checks make it impossible to reach this code path."); |
115 | 115 | } |
116 | 116 | ?> |
117 | -<p><?php echo _("Fine-tuning options for ") . $captiontext; ?></p> |
|
117 | +<p><?php echo _("Fine-tuning options for ").$captiontext; ?></p> |
|
118 | 118 | <hr/> |
119 | 119 | |
120 | 120 | <form action='inc/toggleRedirect.inc.php?inst_id=<?php echo $my_inst->identifier; ?>&profile_id=<?php echo $my_profile->identifier; ?>' method='post' accept-charset='UTF-8'><?php echo $extrainput; ?> |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $interesting_attribs = []; |
124 | 124 | |
125 | 125 | foreach ($attribs as $attrib) { |
126 | - if ($attrib['level'] == \core\Options::LEVEL_METHOD && preg_match('/^' . $keyword . ':/', $attrib['name'])) { |
|
126 | + if ($attrib['level'] == \core\Options::LEVEL_METHOD && preg_match('/^'.$keyword.':/', $attrib['name'])) { |
|
127 | 127 | $interesting_attribs[] = $attrib; |
128 | 128 | } |
129 | 129 | } |