@@ -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\Master::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,13 +302,13 @@ 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); |
|
| 305 | + header("Content-type: ".$filetype); |
|
| 306 | 306 | if ($filetype !== "application/x-wifi-config") { // for those installers to work on Android, Content-Disposition MUST NOT be set |
| 307 | - header('Content-Disposition: inline; filename="' . basename($file) . '"'); |
|
| 307 | + header('Content-Disposition: inline; filename="'.basename($file).'"'); |
|
| 308 | 308 | } else { |
| 309 | 309 | header('Content-Transfer-Encoding: base64'); |
| 310 | 310 | } |
| 311 | - header('Content-Length: ' . filesize($file)); |
|
| 311 | + header('Content-Length: '.filesize($file)); |
|
| 312 | 312 | ob_clean(); |
| 313 | 313 | flush(); |
| 314 | 314 | readfile($file); |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | $filetype = $info->buffer($inputImage, FILEINFO_MIME_TYPE); |
| 330 | 330 | $offset = 60 * 60 * 24 * 30; |
| 331 | 331 | // gmdate cannot fail here - time() is its default argument (and integer), and we are adding an integer to it |
| 332 | - $expiresString = "Expires: " . /** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset) . " GMT"; |
|
| 332 | + $expiresString = "Expires: "./** @scrutinizer ignore-type */ gmdate("D, d M Y H:i:s", time() + $offset)." GMT"; |
|
| 333 | 333 | $blob = $inputImage; |
| 334 | 334 | |
| 335 | 335 | if ($resize === TRUE) { |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $filetype = 'image/png'; // default, only one code path where it can become different |
| 385 | 385 | list($width, $height, $resize) = $this->testForResize($widthIn, $heightIn); |
| 386 | 386 | if ($resize) { |
| 387 | - $logoFile = ROOT . '/web/downloads/logos/' . $identifier . '_' . $width . '_' . $height . '.png'; |
|
| 387 | + $logoFile = ROOT.'/web/downloads/logos/'.$identifier.'_'.$width.'_'.$height.'.png'; |
|
| 388 | 388 | } |
| 389 | 389 | if (is_file($logoFile)) { // $logoFile could be an empty string but then we will get a FALSE |
| 390 | 390 | $this->loggerInstance->debug(4, "Using cached logo $logoFile for: $identifier\n"); |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | if (!isset($device['match'])) { |
| 478 | 478 | continue; |
| 479 | 479 | } |
| 480 | - if (preg_match('/' . $device['match'] . '/', $browser)) { |
|
| 480 | + if (preg_match('/'.$device['match'].'/', $browser)) { |
|
| 481 | 481 | return $this->returnDevice($devId, $device); |
| 482 | 482 | } |
| 483 | 483 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | ?> |
| 22 | 22 | <?php |
| 23 | -require_once dirname(dirname(dirname(dirname(__FILE__)))) . "/config/_config.php"; |
|
| 23 | +require_once dirname(dirname(dirname(dirname(__FILE__))))."/config/_config.php"; |
|
| 24 | 24 | |
| 25 | 25 | $auth = new \web\lib\admin\Authentication(); |
| 26 | 26 | $languageInstance = new \core\common\Language(); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $invitationObject = new core\SilverbulletInvitation($validator->token(filter_input(INPUT_POST, 'token'))); |
| 39 | 39 | header("Content-Type:text/html;charset=utf-8"); |
| 40 | 40 | ?> |
| 41 | -<h1 style='text-align:center;'><?php echo _("Invitation Token QR Code");?></h1> |
|
| 41 | +<h1 style='text-align:center;'><?php echo _("Invitation Token QR Code"); ?></h1> |
|
| 42 | 42 | <img style='float:none' src='data:image/png;base64,<?php |
| 43 | 43 | $size = 10; |
| 44 | 44 | $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([ |
@@ -51,5 +51,5 @@ discard block |
||
| 51 | 51 | if (empty($rawQr)) { |
| 52 | 52 | throw new Exception("Something went seriously wrong during QR code generation!"); |
| 53 | 53 | } |
| 54 | -echo base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, $size));?>'/> |
|
| 55 | -<p>(<a href='<?php echo $invitationObject->link();?>'><?php echo $invitationObject->link();?>)</a></p> |
|
| 54 | +echo base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, $size)); ?>'/> |
|
| 55 | +<p>(<a href='<?php echo $invitationObject->link(); ?>'><?php echo $invitationObject->link(); ?>)</a></p> |
|
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | ?> |
| 28 | 28 | <?php |
| 29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 30 | 30 | |
| 31 | 31 | $deco = new \web\lib\admin\PageDecoration(); |
| 32 | 32 | $validator = new \web\lib\common\InputValidation(); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | } else { |
| 39 | 39 | $link = 'http://'; |
| 40 | 40 | } |
| 41 | -$link .= $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME']; |
|
| 41 | +$link .= $_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']; |
|
| 42 | 42 | $link = htmlspecialchars($link); |
| 43 | 43 | |
| 44 | 44 | echo $deco->defaultPagePrelude(sprintf(_("%s: %s Dashboard"), \config\Master::APPEARANCE['productname'], $uiElements->nomenclatureInst)); |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | $readonly = \config\Master::DB['INST']['readonly']; |
| 85 | 85 | $profiles_for_this_idp = $my_inst->listProfiles(); |
| 86 | 86 | if (count($profiles_for_this_idp) == 0) { // no profiles yet. |
| 87 | - echo "<h2>" . sprintf(_("There are not yet any profiles for your %s."), $uiElements->nomenclatureInst) . "</h2>"; |
|
| 87 | + echo "<h2>".sprintf(_("There are not yet any profiles for your %s."), $uiElements->nomenclatureInst)."</h2>"; |
|
| 88 | 88 | } |
| 89 | 89 | if (count($profiles_for_this_idp) > 0) { // no profiles yet. |
| 90 | - echo "<h2>" . sprintf(_("Profiles for this %s"), $uiElements->nomenclatureInst) . "</h2>"; |
|
| 90 | + echo "<h2>".sprintf(_("Profiles for this %s"), $uiElements->nomenclatureInst)."</h2>"; |
|
| 91 | 91 | } |
| 92 | 92 | // if there is one profile and it is of type Silver Bullet, display a very |
| 93 | 93 | // simple widget with just a "Manage" button |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | echo _("Information needed!"); |
| 114 | 114 | echo "<ul style='margin:1px'>"; |
| 115 | 115 | foreach ($completeness as $missing_attrib) { |
| 116 | - echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>"; |
|
| 116 | + echo "<li>".$uiElements->displayName($missing_attrib)."</li>"; |
|
| 117 | 117 | } |
| 118 | 118 | echo "</ul>"; |
| 119 | 119 | echo "</div>"; |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if ($readonly === FALSE) { |
| 128 | 128 | ?> |
| 129 | 129 | <form action='edit_silverbullet.php?inst_id=<?php echo $my_inst->identifier; ?>&profile_id=<?php echo $profile_list->identifier; ?>' method='POST'> |
| 130 | - <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
| 130 | + <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
| 131 | 131 | </form> |
| 132 | 132 | <?php |
| 133 | 133 | } |
@@ -159,21 +159,21 @@ discard block |
||
| 159 | 159 | $has_overrides = TRUE; |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | - $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>"; |
|
| 162 | + $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>"; |
|
| 163 | 163 | $typelist = $profile_list->getEapMethodsinOrderOfPreference(); |
| 164 | 164 | $allcomplete = TRUE; |
| 165 | 165 | foreach ($typelist as $eaptype) { |
| 166 | 166 | $buffer_eaptypediv .= $eaptype->getPrintableRep(); |
| 167 | 167 | $completeness = $profile_list->isEapTypeDefinitionComplete($eaptype); |
| 168 | 168 | if ($completeness === true) { |
| 169 | - $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>"; |
|
| 169 | + $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>"; |
|
| 170 | 170 | } else { |
| 171 | 171 | $buffer_eaptypediv .= " <div class='notacceptable'>"; |
| 172 | 172 | $buffer_eaptypediv .= _("Information needed!"); |
| 173 | 173 | if (is_array($completeness)) { |
| 174 | 174 | $buffer_eaptypediv .= "<ul style='margin:1px'>"; |
| 175 | 175 | foreach ($completeness as $missing_attrib) { |
| 176 | - $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>"; |
|
| 176 | + $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>"; |
|
| 177 | 177 | } |
| 178 | 178 | $buffer_eaptypediv .= "</ul>"; |
| 179 | 179 | } |
@@ -185,12 +185,12 @@ discard block |
||
| 185 | 185 | foreach ($attribs as $attrib) { |
| 186 | 186 | if ($attrib['level'] == "Method" && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) { |
| 187 | 187 | $justOnce = TRUE; |
| 188 | - $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>"; |
|
| 188 | + $buffer_eaptypediv .= "<img src='../resources/images/icons/Letter-E-blue-icon.png' alt='"._("Options on EAP Method/Device level are in effect.")."'>"; |
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | $buffer_eaptypediv .= "<br/>"; |
| 192 | 192 | } |
| 193 | - $buffer_headline = "<div style='padding-bottom:20px;'><h2 style='overflow:auto; display:inline; padding-bottom: 10px;'>" . sprintf(_("Profile: %s"), $profile_name) . "</h2>"; |
|
| 193 | + $buffer_headline = "<div style='padding-bottom:20px;'><h2 style='overflow:auto; display:inline; padding-bottom: 10px;'>".sprintf(_("Profile: %s"), $profile_name)."</h2>"; |
|
| 194 | 194 | |
| 195 | 195 | $buffer_headline .= "<span style='float:right;'>"; |
| 196 | 196 | $readiness = $profile_list->readinessLevel(); |
@@ -222,18 +222,18 @@ discard block |
||
| 222 | 222 | if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") { |
| 223 | 223 | $diagUrl = "../diag/"; |
| 224 | 224 | } else { |
| 225 | - $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/"; |
|
| 225 | + $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/"; |
|
| 226 | 226 | } |
| 227 | - echo "<form action='" . $diagUrl . "action_realmcheck.php?inst_id=$my_inst->identifier&profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'> |
|
| 227 | + echo "<form action='".$diagUrl."action_realmcheck.php?inst_id=$my_inst->identifier&profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'> |
|
| 228 | 228 | <input type='hidden' name='comefrom' id='comefrom-$profilecount' value='$link'/> |
| 229 | - <button type='submit' name='profile_action' value='check' " . ($has_realm ? "" : "disabled='disabled' title='" . _("The realm can only be checked if you configure the realm!") . "'") . "> |
|
| 230 | - " . _("Check realm reachability") . " |
|
| 229 | + <button type='submit' name='profile_action' value='check' ".($has_realm ? "" : "disabled='disabled' title='"._("The realm can only be checked if you configure the realm!")."'")."> |
|
| 230 | + " . _("Check realm reachability")." |
|
| 231 | 231 | </button> |
| 232 | 232 | </form>"; |
| 233 | 233 | } |
| 234 | 234 | echo "<form action='overview_installers.php?inst_id=$my_inst->identifier&profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'> |
| 235 | - <button type='submit' name='profile_action' value='check' " . ($has_eaptypes ? "" : "disabled='disabled' title='" . _("You have not fully configured any supported EAP types!") . "'") . "> |
|
| 236 | - " . _("Installer Fine-Tuning and Download") . " |
|
| 235 | + <button type='submit' name='profile_action' value='check' ".($has_eaptypes ? "" : "disabled='disabled' title='"._("You have not fully configured any supported EAP types!")."'")."> |
|
| 236 | + " . _("Installer Fine-Tuning and Download")." |
|
| 237 | 237 | </button> |
| 238 | 238 | </form> |
| 239 | 239 | </div>"; |
@@ -242,11 +242,11 @@ discard block |
||
| 242 | 242 | echo " <div class='buttongroupprofilebox' style='clear:both;'> |
| 243 | 243 | <form action='edit_profile.php?inst_id=$my_inst->identifier&profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'> |
| 244 | 244 | <hr/> |
| 245 | - <button type='submit' name='profile_action' value='edit'>" . _("Edit") . "</button> |
|
| 245 | + <button type='submit' name='profile_action' value='edit'>"._("Edit")."</button> |
|
| 246 | 246 | </form> |
| 247 | 247 | <form action='edit_profile_result.php?inst_id=$my_inst->identifier&profile_id=$profile_list->identifier' method='post' accept-charset='UTF-8'> |
| 248 | - <button class='delete' type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_DELETE . "' onclick=\"return confirm('" . sprintf(_("Do you really want to delete the profile %s?"), $profile_name) . "')\"> |
|
| 249 | - " . _("Delete") . " |
|
| 248 | + <button class='delete' type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_DELETE."' onclick=\"return confirm('".sprintf(_("Do you really want to delete the profile %s?"), $profile_name)."')\"> |
|
| 249 | + " . _("Delete")." |
|
| 250 | 250 | </button> |
| 251 | 251 | </form> |
| 252 | 252 | </div>"; |
@@ -255,10 +255,10 @@ discard block |
||
| 255 | 255 | // dummy width to keep a little distance |
| 256 | 256 | echo "<div style='width:20px;'></div>"; |
| 257 | 257 | if ($readiness == core\AbstractProfile::READINESS_LEVEL_SHOWTIME) { |
| 258 | - $idpLevelUrl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier; |
|
| 259 | - echo "<div style='display: table-cell; text-align:center;'><p><strong>" . _("User Download Link") . "</strong></p>"; |
|
| 260 | - $displayurl = $idpLevelUrl . "&profile=" . $profile_list->identifier; |
|
| 261 | - $QRurl = $idpLevelUrl . "&profile=" . $profile_list->identifier; |
|
| 258 | + $idpLevelUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$my_inst->identifier; |
|
| 259 | + echo "<div style='display: table-cell; text-align:center;'><p><strong>"._("User Download Link")."</strong></p>"; |
|
| 260 | + $displayurl = $idpLevelUrl."&profile=".$profile_list->identifier; |
|
| 261 | + $QRurl = $idpLevelUrl."&profile=".$profile_list->identifier; |
|
| 262 | 262 | $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([ |
| 263 | 263 | 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG, |
| 264 | 264 | 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H, |
@@ -270,16 +270,16 @@ discard block |
||
| 270 | 270 | if (empty($rawQr)) { |
| 271 | 271 | throw new Exception("Something went seriously wrong during QR code generation!"); |
| 272 | 272 | } |
| 273 | - $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL)); |
|
| 273 | + $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL)); |
|
| 274 | 274 | $size = getimagesize($uri); |
| 275 | - echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>"; |
|
| 275 | + echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>"; |
|
| 276 | 276 | |
| 277 | 277 | //echo "<nobr>$displayurl</nobr></a>"; |
| 278 | 278 | echo "<p>$displayurl</p></a>"; |
| 279 | 279 | echo "</div>"; |
| 280 | 280 | // dummy width to keep a little distance |
| 281 | 281 | echo "<div style='width:20px;'></div>"; |
| 282 | - echo "<div style='display: table-cell; min-width:200px;'><p><strong>" . _("User Downloads") . "</strong></p><table>"; |
|
| 282 | + echo "<div style='display: table-cell; min-width:200px;'><p><strong>"._("User Downloads")."</strong></p><table>"; |
|
| 283 | 283 | $stats = $profile_list->getUserDownloadStats(); |
| 284 | 284 | foreach ($stats as $dev => $count) { |
| 285 | 285 | echo "<tr><td><strong>$dev</strong></td><td>$count</td></tr>"; |
@@ -92,10 +92,10 @@ discard block |
||
| 92 | 92 | <NodeName>AAAServerTrustRoot</NodeName>'; |
| 93 | 93 | foreach ($this->attributes['internal:CAs'][0] as $oneCert) { |
| 94 | 94 | $retval .= '<Node> |
| 95 | - <NodeName>' . $oneCert['uuid'] . '</NodeName> |
|
| 95 | + <NodeName>' . $oneCert['uuid'].'</NodeName> |
|
| 96 | 96 | <Node> |
| 97 | 97 | <NodeName>CertSHA256Fingerprint</NodeName> |
| 98 | - <Value>' . $oneCert['sha256'] . '</Value> |
|
| 98 | + <Value>' . $oneCert['sha256'].'</Value> |
|
| 99 | 99 | </Node> |
| 100 | 100 | </Node> |
| 101 | 101 | '; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $now = new \DateTime(); |
| 115 | 115 | return '<Node> |
| 116 | 116 | <NodeName>CreationDate</NodeName> |
| 117 | - <Value>' . $now->format("Y-m-d") . "T" . $now->format("H:i:s") . "Z" . '</Value> |
|
| 117 | + <Value>' . $now->format("Y-m-d")."T".$now->format("H:i:s")."Z".'</Value> |
|
| 118 | 118 | </Node>'; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -128,11 +128,11 @@ discard block |
||
| 128 | 128 | <NodeName>HomeSP</NodeName> |
| 129 | 129 | <Node> |
| 130 | 130 | <NodeName>FriendlyName</NodeName> |
| 131 | - <Value>' . sprintf(_("%s via Passpoint"), \config\ConfAssistant::CONSORTIUM['display_name']) . '</Value> |
|
| 131 | + <Value>' . sprintf(_("%s via Passpoint"), \config\ConfAssistant::CONSORTIUM['display_name']).'</Value> |
|
| 132 | 132 | </Node> |
| 133 | 133 | <Node> |
| 134 | 134 | <NodeName>FQDN</NodeName> |
| 135 | - <Value>' . $this->attributes['eap:server_name'][0] /* what, only one FQDN allowed? */ . '</Value> |
|
| 135 | + <Value>' . $this->attributes['eap:server_name'][0] /* what, only one FQDN allowed? */.'</Value> |
|
| 136 | 136 | </Node> |
| 137 | 137 | <Node> |
| 138 | 138 | <NodeName>RoamingConsortiumOI</NodeName> |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $oiList .= ","; |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | - $retval .= $oiList . '</Value> |
|
| 151 | + $retval .= $oiList.'</Value> |
|
| 152 | 152 | </Node> |
| 153 | 153 | </Node> |
| 154 | 154 | '; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | <NodeName>Credential</NodeName> |
| 166 | 166 | <Node> |
| 167 | 167 | <NodeName>Realm</NodeName> |
| 168 | - <Value>' . $this->attributes['internal:realm'][0] . '</Value> |
|
| 168 | + <Value>' . $this->attributes['internal:realm'][0].'</Value> |
|
| 169 | 169 | </Node>'; |
| 170 | 170 | /* the example file I got did not include CreationDate, so omit it |
| 171 | 171 | * |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | </Node> |
| 181 | 181 | <Node> |
| 182 | 182 | <NodeName>CertSHA256Fingerprint</NodeName> |
| 183 | - <Value>' . strtoupper($this->clientCert["sha256"]) /* the actual cert has to go... where? */ . '</Value> |
|
| 183 | + <Value>' . strtoupper($this->clientCert["sha256"]) /* the actual cert has to go... where? */.'</Value> |
|
| 184 | 184 | </Node> |
| 185 | 185 | </Node> |
| 186 | 186 | </Node> |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | // foresee signing. |
| 299 | 299 | // but if they ever change their mind, we are prepared |
| 300 | 300 | |
| 301 | - $outputFromSigning = system($this->sign . " installer_profile '$fileName' > /dev/null"); |
|
| 301 | + $outputFromSigning = system($this->sign." installer_profile '$fileName' > /dev/null"); |
|
| 302 | 302 | if ($outputFromSigning === FALSE) { |
| 303 | 303 | $this->loggerInstance->debug(2, "Signing the ONC installer $fileName FAILED!\n"); |
| 304 | 304 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | ?> |
| 28 | 28 | <?php |
| 29 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 29 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 30 | 30 | |
| 31 | 31 | $auth = new \web\lib\admin\Authentication(); |
| 32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | foreach ($theFed->listTlsCertificates() as $oneCert) { // fetch list a second time, in case we got a cert |
| 82 | 82 | $status = $oneCert['STATUS']; |
| 83 | 83 | if ($status == "ISSUED") { |
| 84 | - $status = "<span onclick='alert(\"".str_replace("\n","\\n",$oneCert['CERT'])."\");'>$status</span>"; |
|
| 84 | + $status = "<span onclick='alert(\"".str_replace("\n", "\\n", $oneCert['CERT'])."\");'>$status</span>"; |
|
| 85 | 85 | } |
| 86 | 86 | echo "<tr><td>".$oneCert['REQSERIAL']."</td><td>".$oneCert['DN']."</td><td>".$status."</td><td>".$oneCert['EXPIRY']."</td></tr>"; |
| 87 | 87 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | foreach ($this->attributes['internal:consortia'] as $oneCons) { |
| 98 | 98 | $knownOiName = array_search($oneCons, \config\ConfAssistant::CONSORTIUM['interworking-consortium-oi']); |
| 99 | 99 | if ($knownOiName === FALSE) { // a custom RCOI as set by the IdP admin; do not use the term "eduroam" in that one! |
| 100 | - $knownOiName = $this->attributes['general:instname'][0] . " "._("Roaming Partner") . " $roamingPartner"; |
|
| 100 | + $knownOiName = $this->attributes['general:instname'][0]." "._("Roaming Partner")." $roamingPartner"; |
|
| 101 | 101 | $roamingPartner++; |
| 102 | 102 | } |
| 103 | 103 | $ssid = 'cat-passpoint-profile'; |
@@ -149,12 +149,12 @@ discard block |
||
| 149 | 149 | if (empty($this->attributes['internal:realm'][0])) { |
| 150 | 150 | $retval .= \config\ConfAssistant::CONSORTIUM['interworking-domainname-fallback']; |
| 151 | 151 | } else { |
| 152 | - $retval .= $this->attributes['internal:realm'][0]; |
|
| 152 | + $retval .= $this->attributes['internal:realm'][0]; |
|
| 153 | 153 | } |
| 154 | 154 | $retval .= '</DomainName>'; |
| 155 | - $retval .= '<RoamingConsortium><OUI>' . $oi . |
|
| 155 | + $retval .= '<RoamingConsortium><OUI>'.$oi. |
|
| 156 | 156 | '</OUI></RoamingConsortium>'; |
| 157 | - $retval .= '</Hotspot2>'; |
|
| 157 | + $retval .= '</Hotspot2>'; |
|
| 158 | 158 | return($retval); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -163,11 +163,11 @@ discard block |
||
| 163 | 163 | $profileFileCont = '<EAPConfig><EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig"> |
| 164 | 164 | <EapMethod> |
| 165 | 165 | '; |
| 166 | - $profileFileCont .= '<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">' . |
|
| 167 | - $this->selectedEap["OUTER"] . '</Type> |
|
| 166 | + $profileFileCont .= '<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">'. |
|
| 167 | + $this->selectedEap["OUTER"].'</Type> |
|
| 168 | 168 | <VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId> |
| 169 | 169 | <VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType> |
| 170 | -<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">' . $authorId . '</AuthorId> |
|
| 170 | +<AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">' . $authorId.'</AuthorId> |
|
| 171 | 171 | </EapMethod> |
| 172 | 172 | '; |
| 173 | 173 | return($profileFileCont); |
@@ -178,10 +178,10 @@ discard block |
||
| 178 | 178 | <eapTls:ServerValidation> |
| 179 | 179 | <eapTls:DisableUserPromptForServerValidation>true</eapTls:DisableUserPromptForServerValidation> |
| 180 | 180 | '; |
| 181 | - $profileFileCont .= '<eapTls:ServerNames>' . $this->servers . '</eapTls:ServerNames>'; |
|
| 181 | + $profileFileCont .= '<eapTls:ServerNames>'.$this->servers.'</eapTls:ServerNames>'; |
|
| 182 | 182 | foreach ($this->caArray as $certAuthority) { |
| 183 | 183 | if ($certAuthority['root']) { |
| 184 | - $profileFileCont .= "<eapTls:TrustedRootCA>" . $certAuthority['sha1'] . "</eapTls:TrustedRootCA>\n"; |
|
| 184 | + $profileFileCont .= "<eapTls:TrustedRootCA>".$certAuthority['sha1']."</eapTls:TrustedRootCA>\n"; |
|
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | $profileFileCont .= '</eapTls:ServerValidation> |
@@ -193,10 +193,10 @@ discard block |
||
| 193 | 193 | $profileFileCont = ' |
| 194 | 194 | <ServerValidation> |
| 195 | 195 | '; |
| 196 | - $profileFileCont .= '<ServerNames>' . $this->servers . '</ServerNames> '; |
|
| 196 | + $profileFileCont .= '<ServerNames>'.$this->servers.'</ServerNames> '; |
|
| 197 | 197 | foreach ($this->caArray as $certAuthority) { |
| 198 | 198 | if ($certAuthority['root']) { |
| 199 | - $profileFileCont .= "<TrustedRootCAHash>" . chunk_split($certAuthority['sha1'], 2, ' ') . "</TrustedRootCAHash>\n"; |
|
| 199 | + $profileFileCont .= "<TrustedRootCAHash>".chunk_split($certAuthority['sha1'], 2, ' ')."</TrustedRootCAHash>\n"; |
|
| 200 | 200 | } |
| 201 | 201 | } |
| 202 | 202 | $profileFileCont .= '<DisablePrompt>true</DisablePrompt> |
@@ -228,10 +228,10 @@ discard block |
||
| 228 | 228 | $profileFileCont = ' |
| 229 | 229 | <ServerValidation> |
| 230 | 230 | <DisableUserPromptForServerValidation>true</DisableUserPromptForServerValidation> |
| 231 | -<ServerNames>' . $this->servers . '</ServerNames>'; |
|
| 231 | +<ServerNames>' . $this->servers.'</ServerNames>'; |
|
| 232 | 232 | foreach ($this->caArray as $certAuthority) { |
| 233 | 233 | if ($certAuthority['root']) { |
| 234 | - $profileFileCont .= "<TrustedRootCA>" . $certAuthority['sha1'] . "</TrustedRootCA>\n"; |
|
| 234 | + $profileFileCont .= "<TrustedRootCA>".$certAuthority['sha1']."</TrustedRootCA>\n"; |
|
| 235 | 235 | } |
| 236 | 236 | } |
| 237 | 237 | $profileFileCont .= '</ServerValidation> |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | if ($this->useAnon) { |
| 288 | 288 | $profileFileCont .= '<IdentityPrivacy>true</IdentityPrivacy> |
| 289 | 289 | '; |
| 290 | - $profileFileCont .= '<AnonymousIdentity>' . $this->outerId . '</AnonymousIdentity> |
|
| 290 | + $profileFileCont .= '<AnonymousIdentity>'.$this->outerId.'</AnonymousIdentity> |
|
| 291 | 291 | '; |
| 292 | 292 | } else { |
| 293 | 293 | $profileFileCont .= '<IdentityPrivacy>false</IdentityPrivacy> |
@@ -304,10 +304,10 @@ discard block |
||
| 304 | 304 | $profileFileCont = ' |
| 305 | 305 | <Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig"> |
| 306 | 306 | <EAPIdentityProviderList xmlns="urn:ietf:params:xml:ns:yang:ietf-eap-metadata"> |
| 307 | -<EAPIdentityProvider ID="' . $this->deviceUUID . '" namespace="urn:UUID"> |
|
| 307 | +<EAPIdentityProvider ID="' . $this->deviceUUID.'" namespace="urn:UUID"> |
|
| 308 | 308 | |
| 309 | 309 | <ProviderInfo> |
| 310 | -<DisplayName>' . $this->translateString($this->attributes['general:instname'][0], $this->codePage) . '</DisplayName> |
|
| 310 | +<DisplayName>' . $this->translateString($this->attributes['general:instname'][0], $this->codePage).'</DisplayName> |
|
| 311 | 311 | </ProviderInfo> |
| 312 | 312 | <AuthenticationMethods> |
| 313 | 313 | <AuthenticationMethod> |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | if ($this->outerUser == '') { |
| 320 | 320 | $profileFileCont .= '<AnonymousIdentity>@</AnonymousIdentity>'; |
| 321 | 321 | } else { |
| 322 | - $profileFileCont .= '<AnonymousIdentity>' . $this->outerId . '</AnonymousIdentity>'; |
|
| 322 | + $profileFileCont .= '<AnonymousIdentity>'.$this->outerId.'</AnonymousIdentity>'; |
|
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | $profileFileCont .= '</ClientSideCredential> |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $profileFileCont .= $this->glTtlsServerValidation(); |
| 328 | 328 | $profileFileCont .= ' |
| 329 | 329 | <InnerAuthenticationMethod> |
| 330 | -<NonEAPAuthMethod>' . \core\common\EAP::eapDisplayName($this->selectedEap)['INNER'] . '</NonEAPAuthMethod> |
|
| 330 | +<NonEAPAuthMethod>' . \core\common\EAP::eapDisplayName($this->selectedEap)['INNER'].'</NonEAPAuthMethod> |
|
| 331 | 331 | </InnerAuthenticationMethod> |
| 332 | 332 | <VendorSpecific> |
| 333 | 333 | <SessionResumption>false</SessionResumption> |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | <UseWinLogonCredentials>false</UseWinLogonCredentials> |
| 359 | 359 | </EapType> |
| 360 | 360 | </Eap> |
| 361 | -<EnableQuarantineChecks>' . $nea . '</EnableQuarantineChecks> |
|
| 361 | +<EnableQuarantineChecks>' . $nea.'</EnableQuarantineChecks> |
|
| 362 | 362 | <RequireCryptoBinding>false</RequireCryptoBinding> |
| 363 | 363 | '; |
| 364 | 364 | if ($this->useAnon) { |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | $profileFileCont .= '<AnonymousUserName/> |
| 371 | 371 | '; |
| 372 | 372 | } else { |
| 373 | - $profileFileCont .= '<AnonymousUserName>' . $this->outerUser . '</AnonymousUserName> |
|
| 373 | + $profileFileCont .= '<AnonymousUserName>'.$this->outerUser.'</AnonymousUserName> |
|
| 374 | 374 | '; |
| 375 | 375 | } |
| 376 | 376 | $profileFileCont .= '</IdentityPrivacy> |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | private function prepareEapConfig() { |
| 401 | 401 | if ($this->useAnon) { |
| 402 | 402 | $this->outerUser = $this->attributes['internal:anon_local_value'][0]; |
| 403 | - $this->outerId = $this->outerUser . '@' . $this->attributes['internal:realm'][0]; |
|
| 403 | + $this->outerId = $this->outerUser.'@'.$this->attributes['internal:realm'][0]; |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | $profileFileCont = $this->eapConfigHeader(); |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | default: |
| 426 | 426 | break; |
| 427 | 427 | } |
| 428 | - return(['win' => $profileFileCont . '</EapHostConfig></EAPConfig>']); |
|
| 428 | + return(['win' => $profileFileCont.'</EapHostConfig></EAPConfig>']); |
|
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | /** |
@@ -443,10 +443,10 @@ discard block |
||
| 443 | 443 | private function writeWLANprofile($wlanProfileName, $ssid, $auth, $encryption, $eapConfig, $profileNumber, $oi = '') { |
| 444 | 444 | $profileFileCont = '<?xml version="1.0"?> |
| 445 | 445 | <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"> |
| 446 | -<name>' . $wlanProfileName . '</name> |
|
| 446 | +<name>' . $wlanProfileName.'</name> |
|
| 447 | 447 | <SSIDConfig> |
| 448 | 448 | <SSID> |
| 449 | -<name>' . $ssid . '</name> |
|
| 449 | +<name>' . $ssid.'</name> |
|
| 450 | 450 | </SSID> |
| 451 | 451 | <nonBroadcast>true</nonBroadcast> |
| 452 | 452 | </SSIDConfig>'; |
@@ -458,8 +458,8 @@ discard block |
||
| 458 | 458 | <MSM> |
| 459 | 459 | <security> |
| 460 | 460 | <authEncryption> |
| 461 | -<authentication>' . $auth . '</authentication> |
|
| 462 | -<encryption>' . $encryption . '</encryption> |
|
| 461 | +<authentication>' . $auth.'</authentication> |
|
| 462 | +<encryption>' . $encryption.'</encryption> |
|
| 463 | 463 | <useOneX>true</useOneX> |
| 464 | 464 | </authEncryption> |
| 465 | 465 | '; |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | mkdir('w8'); |
| 487 | 487 | } |
| 488 | 488 | $xmlFname = "w8/wlan_prof-$profileNumber.xml"; |
| 489 | - file_put_contents($xmlFname, $profileFileCont . $eapConfig['win'] . $closing); |
|
| 489 | + file_put_contents($xmlFname, $profileFileCont.$eapConfig['win'].$closing); |
|
| 490 | 490 | $this->loggerInstance->debug(2, "Installer has been written into directory $this->FPATH\n"); |
| 491 | 491 | $hs20 = $oi == '' ? 0 : 1; |
| 492 | 492 | return("\"$wlanProfileName\" \"$encryption\" $hs20"); |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | mkdir('w8'); |
| 515 | 515 | } |
| 516 | 516 | $xmlFname = "w8/lan_prof.xml"; |
| 517 | - file_put_contents($xmlFname, $profileFileCont . $eapConfig['win'] . $closing); |
|
| 517 | + file_put_contents($xmlFname, $profileFileCont.$eapConfig['win'].$closing); |
|
| 518 | 518 | $this->loggerInstance->debug(2, "Installer has been written into directory $this->FPATH\n"); |
| 519 | 519 | } |
| 520 | 520 | |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | } |
| 536 | 536 | foreach ($caArray as $certAuthority) { |
| 537 | 537 | $store = $certAuthority['root'] ? "root" : "ca"; |
| 538 | - $fcontentsCerts .= '!insertmacro install_ca_cert "' . $certAuthority['file'] . '" "' . $certAuthority['sha1'] . '" "' . $store . "\"\n"; |
|
| 538 | + $fcontentsCerts .= '!insertmacro install_ca_cert "'.$certAuthority['file'].'" "'.$certAuthority['sha1'].'" "'.$store."\"\n"; |
|
| 539 | 539 | } |
| 540 | 540 | fwrite($fileHandleCerts, $fcontentsCerts); |
| 541 | 541 | fclose($fileHandleCerts); |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | private function writeMainNSH($eap, $attr) { |
| 545 | 545 | $this->loggerInstance->debug(4, "writeMainNSH"); |
| 546 | 546 | $this->loggerInstance->debug(4, $attr); |
| 547 | - $this->loggerInstance->debug(4, "Device_id = " . $this->device_id . "\n"); |
|
| 547 | + $this->loggerInstance->debug(4, "Device_id = ".$this->device_id."\n"); |
|
| 548 | 548 | $fcontents = "!define W8\n"; |
| 549 | 549 | if ($this->device_id == 'w10') { |
| 550 | 550 | $fcontents .= "!define W10\n"; |
@@ -574,8 +574,8 @@ discard block |
||
| 574 | 574 | if ($eap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
| 575 | 575 | $fcontents .= "!define SILVERBULLET\n"; |
| 576 | 576 | } |
| 577 | - $fcontents .= '!define ' . $eapStr; |
|
| 578 | - $fcontents .= "\n" . '!define EXECLEVEL "' . $execLevel . '"'; |
|
| 577 | + $fcontents .= '!define '.$eapStr; |
|
| 578 | + $fcontents .= "\n".'!define EXECLEVEL "'.$execLevel.'"'; |
|
| 579 | 579 | $fcontents .= $this->writeNsisDefines($attr); |
| 580 | 580 | file_put_contents('main.nsh', $fcontents); |
| 581 | 581 | } |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | */ |
| 47 | 47 | public function writeInstaller() { |
| 48 | - $installerPath = $this->installerBasename . ".sh"; |
|
| 48 | + $installerPath = $this->installerBasename.".sh"; |
|
| 49 | 49 | $this->copyFile("eduroam_linux_main.sh", $installerPath); |
| 50 | 50 | |
| 51 | - if ( !file_exists($installerPath) ) { |
|
| 51 | + if (!file_exists($installerPath)) { |
|
| 52 | 52 | throw new Exception('File not found.'); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | fseek($installer, 0, SEEK_END); |
| 62 | 62 | $this->writeMessages($installer); |
| 63 | 63 | $this->writeConfigVars($installer); |
| 64 | - fwrite($installer, 'printf -v INIT_INFO "$INIT_INFO_TMP" "$ORGANISATION" "$EMAIL" "$URL"' . "\n"); |
|
| 65 | - fwrite($installer, 'printf -v INIT_CONFIRMATION "$INIT_CONFIRMATION_TMP" "$ORGANISATION"' . "\n\n"); |
|
| 66 | - fwrite($installer, 'main "$@"; exit' . "\n"); |
|
| 64 | + fwrite($installer, 'printf -v INIT_INFO "$INIT_INFO_TMP" "$ORGANISATION" "$EMAIL" "$URL"'."\n"); |
|
| 65 | + fwrite($installer, 'printf -v INIT_CONFIRMATION "$INIT_CONFIRMATION_TMP" "$ORGANISATION"'."\n\n"); |
|
| 66 | + fwrite($installer, 'main "$@"; exit'."\n"); |
|
| 67 | 67 | } catch (Exception $e) { |
| 68 | - echo 'Error message: ' .$e->getMessage(); |
|
| 68 | + echo 'Error message: '.$e->getMessage(); |
|
| 69 | 69 | } finally { |
| 70 | 70 | fclose($installer); |
| 71 | 71 | return($installerPath); |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | $out .= "<p>"; |
| 88 | 88 | if ($ssidCount > 1) { |
| 89 | 89 | if ($ssidCount > 2) { |
| 90 | - $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"), implode(', ', \config\ConfAssistant::CONSORTIUM['ssid'])) . " "; |
|
| 90 | + $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to the following networks:"), implode(', ', \config\ConfAssistant::CONSORTIUM['ssid']))." "; |
|
| 91 | 91 | } else { |
| 92 | - $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"), implode(', ', \config\ConfAssistant::CONSORTIUM['ssid'])) . " "; |
|
| 92 | + $out .= sprintf(_("In addition to <strong>%s</strong> the installer will also configure access to:"), implode(', ', \config\ConfAssistant::CONSORTIUM['ssid']))." "; |
|
| 93 | 93 | } |
| 94 | 94 | $iterator = 0; |
| 95 | 95 | foreach ($this->attributes['internal:SSID'] as $ssid => $v) { |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @return void |
| 127 | 127 | */ |
| 128 | 128 | private function writeConfigLine($file, $name, $text) { |
| 129 | - $out = $name . '="' . $text . '"' . "\n"; |
|
| 129 | + $out = $name.'="'.$text.'"'."\n"; |
|
| 130 | 130 | // fwrite($file, wordwrap($out, 70, "\n")); |
| 131 | 131 | fwrite($file, $out); |
| 132 | 132 | |
@@ -209,18 +209,18 @@ discard block |
||
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | if ($outerId !== NULL) { |
| 212 | - $configRaw['ANONYMOUS_IDENTITY'] = '"' . $outerId . '"'; |
|
| 212 | + $configRaw['ANONYMOUS_IDENTITY'] = '"'.$outerId.'"'; |
|
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | if (!empty($this->attributes['internal:realm'][0])) { |
| 216 | 216 | $config['USER_REALM'] = $this->attributes['internal:realm'][0]; |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - if(!empty($this->attributes['internal:hint_userinput_suffix'][0]) && $this->attributes['internal:hint_userinput_suffix'][0] == 1) { |
|
| 219 | + if (!empty($this->attributes['internal:hint_userinput_suffix'][0]) && $this->attributes['internal:hint_userinput_suffix'][0] == 1) { |
|
| 220 | 220 | $configRaw['HINT_USER_INPUT'] = true; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - if(!empty($this->attributes['internal:verify_userinput_suffix'][0]) && $this->attributes['internal:verify_userinput_suffix'][0] == 1) { |
|
| 223 | + if (!empty($this->attributes['internal:verify_userinput_suffix'][0]) && $this->attributes['internal:verify_userinput_suffix'][0] == 1) { |
|
| 224 | 224 | $configRaw['VERIFY_USER_REALM_INPUT'] = true; |
| 225 | 225 | } else { |
| 226 | 226 | $configRaw['VERIFY_USER_REALM_INPUT'] = false; |
@@ -231,19 +231,19 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | foreach ($configRaw as $name => $value) { |
| 234 | - fwrite($file, $name ."=". $value . "\n"); |
|
| 234 | + fwrite($file, $name."=".$value."\n"); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | if ($tou === '') { |
| 238 | 238 | fwrite($file, "TOU=\"\"\n"); |
| 239 | 239 | } else { |
| 240 | - fwrite($file, "TOU=\"" . $tou . "\"\n"); |
|
| 240 | + fwrite($file, "TOU=\"".$tou."\"\n"); |
|
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - fwrite($file, "CA_CERTIFICATE=\"" . $this->mkCAfile() . "\"\n"); |
|
| 243 | + fwrite($file, "CA_CERTIFICATE=\"".$this->mkCAfile()."\"\n"); |
|
| 244 | 244 | $sbUserFile = $this->mkSbUserFile(); |
| 245 | 245 | if ($sbUserFile !== '') { |
| 246 | - fwrite($file, "SB_USER_FILE=\"" . $sbUserFile . "\"\n"); |
|
| 246 | + fwrite($file, "SB_USER_FILE=\"".$sbUserFile."\"\n"); |
|
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | 249 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | } |
| 296 | 296 | $out .= "'DNS:$oneServer'"; |
| 297 | 297 | } |
| 298 | - return "(" . $out. ")"; |
|
| 298 | + return "(".$out.")"; |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | foreach ($ssids as $ssid => $cipher) { |
| 310 | 310 | $outArray[] = "'$ssid'"; |
| 311 | 311 | } |
| 312 | - return '(' . implode(' ', $outArray) . ')'; |
|
| 312 | + return '('.implode(' ', $outArray).')'; |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | /** |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | $outArray[] = "'$ssid'"; |
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | - return '(' . implode(', ', $outArray) . ')'; |
|
| 328 | + return '('.implode(', ', $outArray).')'; |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | * |
| 334 | 334 | * @return string |
| 335 | 335 | */ |
| 336 | - private function mkCAfile(){ |
|
| 336 | + private function mkCAfile() { |
|
| 337 | 337 | $out = ''; |
| 338 | 338 | $cAlist = $this->attributes['internal:CAs'][0]; |
| 339 | 339 | foreach ($cAlist as $oneCa) { |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | */ |
| 350 | 350 | private function mkIntro() { |
| 351 | 351 | \core\common\Entity::intoThePotatoes(); |
| 352 | - $out = _("This installer has been prepared for %s") . '\n\n' . _("More information and comments:") . '\n\nE-Mail: %s\nWWW: %s\n\n' . |
|
| 352 | + $out = _("This installer has been prepared for %s").'\n\n'._("More information and comments:").'\n\nE-Mail: %s\nWWW: %s\n\n'. |
|
| 353 | 353 | _("Installer created with software from the GEANT project."); |
| 354 | 354 | \core\common\Entity::outOfThePotatoes(); |
| 355 | 355 | return $out; |
@@ -66,24 +66,24 @@ discard block |
||
| 66 | 66 | case "EXTERNAL": |
| 67 | 67 | case "FRONTEND": |
| 68 | 68 | case "DIAGNOSTICS": |
| 69 | - if (!isset(self::${"instance" . $theDb})) { |
|
| 69 | + if (!isset(self::${"instance".$theDb})) { |
|
| 70 | 70 | $class = __CLASS__; |
| 71 | - self::${"instance" . $theDb} = new $class($database); |
|
| 72 | - DBConnection::${"instance" . $theDb}->databaseInstance = $theDb; |
|
| 71 | + self::${"instance".$theDb} = new $class($database); |
|
| 72 | + DBConnection::${"instance".$theDb}->databaseInstance = $theDb; |
|
| 73 | 73 | } |
| 74 | - return self::${"instance" . $theDb}; |
|
| 74 | + return self::${"instance".$theDb}; |
|
| 75 | 75 | case "RADIUS": |
| 76 | - if (!isset(self::${"instance" . $theDb})) { |
|
| 76 | + if (!isset(self::${"instance".$theDb})) { |
|
| 77 | 77 | $class = __CLASS__; |
| 78 | 78 | foreach (\config\ConfAssistant::DB as $name => $oneRadiusAuthDb) { |
| 79 | 79 | $theInstance = new $class($name); |
| 80 | - self::${"instance" . $theDb}[] = $theInstance; |
|
| 80 | + self::${"instance".$theDb}[] = $theInstance; |
|
| 81 | 81 | $theInstance->databaseInstance = $theDb; |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | - return self::${"instance" . $theDb}; |
|
| 84 | + return self::${"instance".$theDb}; |
|
| 85 | 85 | default: |
| 86 | - throw new Exception("This type of database (" . strtoupper($database) . ") is not known!"); |
|
| 86 | + throw new Exception("This type of database (".strtoupper($database).") is not known!"); |
|
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
@@ -125,18 +125,18 @@ discard block |
||
| 125 | 125 | } |
| 126 | 126 | } |
| 127 | 127 | // log exact query to debug log, if log level is at 5 |
| 128 | - $this->loggerInstance->debug(5, "DB ATTEMPT: " . $querystring . "\n"); |
|
| 128 | + $this->loggerInstance->debug(5, "DB ATTEMPT: ".$querystring."\n"); |
|
| 129 | 129 | if ($types !== NULL) { |
| 130 | - $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: " . print_r($arguments, true)); |
|
| 130 | + $this->loggerInstance->debug(5, "Argument type sequence: $types, parameters are: ".print_r($arguments, true)); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if ($this->connection->connect_error) { |
| 134 | - throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number" . $this->connection->connect_error . ")!"); |
|
| 134 | + throw new Exception("ERROR: Cannot send query to $this->databaseInstance database (no connection, error number".$this->connection->connect_error.")!"); |
|
| 135 | 135 | } |
| 136 | 136 | if ($types === NULL) { |
| 137 | 137 | $result = $this->connection->query($querystring); |
| 138 | 138 | if ($result === FALSE) { |
| 139 | - throw new Exception("DB: Unable to execute simple statement! Error was --> " . $this->connection->error . " <--"); |
|
| 139 | + throw new Exception("DB: Unable to execute simple statement! Error was --> ".$this->connection->error." <--"); |
|
| 140 | 140 | } |
| 141 | 141 | } else { |
| 142 | 142 | // fancy! prepared statement with dedicated argument list |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | $prepResult = $statementObject->prepare($querystring); |
| 154 | 154 | if ($prepResult === FALSE) { |
| 155 | - throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--."); |
|
| 155 | + throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ".$statementObject->error." <--."); |
|
| 156 | 156 | } |
| 157 | 157 | $this->preparedStatements[$querystring] = $statementObject; |
| 158 | 158 | } |
@@ -165,11 +165,11 @@ discard block |
||
| 165 | 165 | array_unshift($localArray, $types); |
| 166 | 166 | $retval = call_user_func_array([$statementObject, "bind_param"], $localArray); |
| 167 | 167 | if ($retval === FALSE) { |
| 168 | - throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--"); |
|
| 168 | + throw new Exception("DB: Unable to bind parameters to prepared statement! Argument array was --> ".var_export($localArray, TRUE)." <--. Error was --> ".$statementObject->error." <--"); |
|
| 169 | 169 | } |
| 170 | 170 | $result = $statementObject->execute(); |
| 171 | 171 | if ($result === FALSE) { |
| 172 | - throw new Exception("DB: Unable to execute prepared statement! Error was --> " . $statementObject->error . " <--"); |
|
| 172 | + throw new Exception("DB: Unable to execute prepared statement! Error was --> ".$statementObject->error." <--"); |
|
| 173 | 173 | } |
| 174 | 174 | $selectResult = $statementObject->get_result(); |
| 175 | 175 | if ($selectResult !== FALSE) { |
@@ -179,14 +179,14 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | // all cases where $result could be FALSE have been caught earlier |
| 181 | 181 | if ($this->connection->errno) { |
| 182 | - throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was " . $this->connection->errno . "!"); |
|
| 182 | + throw new Exception("ERROR: Cannot execute query in $this->databaseInstance database - (hopefully escaped) query was '$querystring', errno was ".$this->connection->errno."!"); |
|
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | if ($isMoreThanSelect) { |
| 187 | - $this->loggerInstance->writeSQLAudit("[DB: " . strtoupper($this->databaseInstance) . "] " . $querystring); |
|
| 187 | + $this->loggerInstance->writeSQLAudit("[DB: ".strtoupper($this->databaseInstance)."] ".$querystring); |
|
| 188 | 188 | if ($types !== NULL) { |
| 189 | - $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: " . print_r($arguments, true)); |
|
| 189 | + $this->loggerInstance->writeSQLAudit("Argument type sequence: $types, parameters are: ".print_r($arguments, true)); |
|
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | return $result; |
@@ -281,13 +281,13 @@ discard block |
||
| 281 | 281 | if (isset(\config\Master::DB[$databaseCapitalised])) { |
| 282 | 282 | $this->connection = new \mysqli(\config\Master::DB[$databaseCapitalised]['host'], \config\Master::DB[$databaseCapitalised]['user'], \config\Master::DB[$databaseCapitalised]['pass'], \config\Master::DB[$databaseCapitalised]['db']); |
| 283 | 283 | if ($this->connection->connect_error) { |
| 284 | - throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ")."); |
|
| 284 | + throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.")."); |
|
| 285 | 285 | } |
| 286 | 286 | $this->readOnly = \config\Master::DB[$databaseCapitalised]['readonly']; |
| 287 | 287 | } else { // one of the RADIUS DBs |
| 288 | 288 | $this->connection = new \mysqli(\config\ConfAssistant::DB[$databaseCapitalised]['host'], \config\ConfAssistant::DB[$databaseCapitalised]['user'], \config\ConfAssistant::DB[$databaseCapitalised]['pass'], \config\ConfAssistant::DB[$databaseCapitalised]['db']); |
| 289 | 289 | if ($this->connection->connect_error) { |
| 290 | - throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number " . $this->connection->connect_errno . ")."); |
|
| 290 | + throw new Exception("ERROR: Unable to connect to $database database! This is a fatal error, giving up (error number ".$this->connection->connect_errno.")."); |
|
| 291 | 291 | } |
| 292 | 292 | $this->readOnly = \config\ConfAssistant::DB[$databaseCapitalised]['readonly']; |
| 293 | 293 | } |
@@ -115,12 +115,12 @@ discard block |
||
| 115 | 115 | $this->name = $this->languageInstance->getLocalisedValue($this->getAttributes('general:instname')); |
| 116 | 116 | $eligibility = $this->eligibility(); |
| 117 | 117 | if (in_array(IdP::ELIGIBILITY_IDP, $eligibility) && in_array(IdP::ELIGIBILITY_SP, $eligibility)) { |
| 118 | - $eligType = IdP::TYPE_IDPSP . ""; |
|
| 118 | + $eligType = IdP::TYPE_IDPSP.""; |
|
| 119 | 119 | $this->type = $eligType; |
| 120 | 120 | } elseif (in_array(IdP::ELIGIBILITY_IDP, $eligibility)) { |
| 121 | - $eligType = IdP::TYPE_IDP . ""; |
|
| 121 | + $eligType = IdP::TYPE_IDP.""; |
|
| 122 | 122 | } else { |
| 123 | - $eligType = IdP::TYPE_SP . ""; |
|
| 123 | + $eligType = IdP::TYPE_SP.""; |
|
| 124 | 124 | } |
| 125 | 125 | $this->type = $eligType; |
| 126 | 126 | $this->loggerInstance->debug(3, "--- END Constructing new IdP object ... ---\n"); |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | public function listProfiles(bool $activeOnly = FALSE) |
| 136 | 136 | { |
| 137 | - $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier" . ($activeOnly ? " AND showtime = 1" : ""); |
|
| 137 | + $query = "SELECT profile_id FROM profile WHERE inst_id = $this->identifier".($activeOnly ? " AND showtime = 1" : ""); |
|
| 138 | 138 | $allProfiles = $this->databaseHandle->exec($query); |
| 139 | 139 | $returnarray = []; |
| 140 | 140 | // SELECT -> resource, not boolean |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $returnarray[] = $oneProfile; |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - $this->loggerInstance->debug(4, "listProfiles: " . print_r($returnarray, true)); |
|
| 147 | + $this->loggerInstance->debug(4, "listProfiles: ".print_r($returnarray, true)); |
|
| 148 | 148 | return $returnarray; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public function listDeployments(bool $activeOnly = FALSE) |
| 158 | 158 | { |
| 159 | - $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier" . ($activeOnly ? " AND status = " . AbstractDeployment::ACTIVE : ""); |
|
| 159 | + $query = "SELECT deployment_id FROM deployment WHERE inst_id = $this->identifier".($activeOnly ? " AND status = ".AbstractDeployment::ACTIVE : ""); |
|
| 160 | 160 | $allDeployments = $this->databaseHandle->exec($query); |
| 161 | 161 | $returnarray = []; |
| 162 | 162 | // SELECT -> resource, not boolean |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $returnarray[] = new DeploymentManaged($this, $deploymentQuery->deployment_id); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - $this->loggerInstance->debug(4, "listDeployments: " . print_r($returnarray, true)); |
|
| 167 | + $this->loggerInstance->debug(4, "listDeployments: ".print_r($returnarray, true)); |
|
| 168 | 168 | return $returnarray; |
| 169 | 169 | } |
| 170 | 170 | |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | case AbstractProfile::PROFILETYPE_SILVERBULLET: |
| 307 | 307 | $theProfile = new ProfileSilverbullet($identifier, $this); |
| 308 | 308 | $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1); |
| 309 | - $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix'])); |
|
| 309 | + $theProfile->setRealm($this->identifier."-".$theProfile->identifier.".".strtolower($this->federation).strtolower(\config\ConfAssistant::SILVERBULLET['realm_suffix'])); |
|
| 310 | 310 | return $theProfile; |
| 311 | 311 | default: |
| 312 | 312 | throw new Exception("This type of profile is unknown and can not be added."); |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | public function getExternalDBId() |
| 448 | 448 | { |
| 449 | 449 | if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam" && isset(\config\ConfAssistant::CONSORTIUM['deployment-voodoo']) && \config\ConfAssistant::CONSORTIUM['deployment-voodoo'] == "Operations Team") { // SW: APPROVED |
| 450 | - $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = " . self::EXTERNAL_DB_SYNCSTATE_SYNCED); |
|
| 450 | + $idQuery = $this->databaseHandle->exec("SELECT external_db_id FROM institution WHERE inst_id = $this->identifier AND external_db_syncstate = ".self::EXTERNAL_DB_SYNCSTATE_SYNCED); |
|
| 451 | 451 | // SELECT -> it's a resource, not a boolean |
| 452 | 452 | if (mysqli_num_rows(/** @scrutinizer ignore-type */ $idQuery) == 0) { |
| 453 | 453 | return FALSE; |
@@ -513,16 +513,16 @@ discard block |
||
| 513 | 513 | } |
| 514 | 514 | foreach ($baseline as $lang => $value) { |
| 515 | 515 | if (!key_exists($lang, $newvalues)) { |
| 516 | - $retval[IdP::INSTNAME_CHANGED] .= "#[Language " . strtoupper($lang) . "] DELETED"; |
|
| 516 | + $retval[IdP::INSTNAME_CHANGED] .= "#[Language ".strtoupper($lang)."] DELETED"; |
|
| 517 | 517 | } else { |
| 518 | 518 | if ($value != $newvalues[$lang]) { |
| 519 | - $retval[IdP::INSTNAME_CHANGED] .= "#[Language " . strtoupper($lang) . "] CHANGED from '" . $baseline[$lang] . "' to '" . $newvalues[$lang] . "'"; |
|
| 519 | + $retval[IdP::INSTNAME_CHANGED] .= "#[Language ".strtoupper($lang)."] CHANGED from '".$baseline[$lang]."' to '".$newvalues[$lang]."'"; |
|
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | foreach ($newvalues as $lang => $value) { |
| 524 | 524 | if (!key_exists($lang, $baseline)) { |
| 525 | - $retval[IdP::INSTNAME_CHANGED] .= "#[Language " . strtoupper($lang) . "] ADDED as '" . $value . "'"; |
|
| 525 | + $retval[IdP::INSTNAME_CHANGED] .= "#[Language ".strtoupper($lang)."] ADDED as '".$value."'"; |
|
| 526 | 526 | } |
| 527 | 527 | } |
| 528 | 528 | return $retval; |