@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $deployment->deactivate(); |
| 110 | 110 | } |
| 111 | 111 | header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . |
| 112 | - $deployment->identifier); |
|
| 112 | + $deployment->identifier); |
|
| 113 | 113 | exit(0); |
| 114 | 114 | case web\lib\common\FormElements::BUTTON_REMOVESP: |
| 115 | 115 | $deployment->remove(); |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | case web\lib\common\FormElements::BUTTON_RENEWTLS: |
| 119 | 119 | $data = openssl_x509_parse($deployment->radsec_cert); |
| 120 | 120 | $certdata = array( |
| 121 | - strtoupper(dechex($data['serialNumber'])), |
|
| 122 | - date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('YmdHis') |
|
| 123 | - ); |
|
| 121 | + strtoupper(dechex($data['serialNumber'])), |
|
| 122 | + date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('YmdHis') |
|
| 123 | + ); |
|
| 124 | 124 | $torevoke = implode('#', $certdata); |
| 125 | 125 | $response = $deployment->setRADIUSconfig(0, 0, $torevoke); |
| 126 | 126 | $deployment->renewtls(); |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | ?> |
| 29 | 29 | <?php |
| 30 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 30 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 31 | 31 | |
| 32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
| 33 | 33 | $validator = new \web\lib\common\InputValidation(); |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | ( $_POST['consortium'] == "OpenRoaming" && count($myfed->getAttributes("fed:openroaming")) > 0 ) |
| 42 | 42 | ) |
| 43 | 43 | ) {*/ |
| 44 | - if (isset($_POST['consortium']) && $_POST['consortium'] == "eduroam") |
|
| 44 | + if (isset($_POST['consortium']) && $_POST['consortium'] == "eduroam") |
|
| 45 | 45 | { |
| 46 | 46 | $deployment = $my_inst->newDeployment(\core\AbstractDeployment::DEPLOYMENTTYPE_MANAGED, $_POST['consortium']); |
| 47 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier); |
|
| 47 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier); |
|
| 48 | 48 | exit(0); |
| 49 | 49 | } else { |
| 50 | 50 | throw new Exception("Desired consortium for Managed SP needs to be specified, and allowed!"); |
@@ -101,19 +101,19 @@ discard block |
||
| 101 | 101 | if (isset($_POST['agreement']) && $_POST['agreement'] == "true") { |
| 102 | 102 | $deployment->addAttribute("hiddenmanagedsp:tou_accepted", NULL, 1); |
| 103 | 103 | } |
| 104 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier); |
|
| 104 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier); |
|
| 105 | 105 | exit(0); |
| 106 | 106 | case web\lib\common\FormElements::BUTTON_DELETE: |
| 107 | 107 | $response = $deployment->setRADIUSconfig(); |
| 108 | 108 | if (in_array('OK', $response)) { |
| 109 | 109 | $deployment->deactivate(); |
| 110 | 110 | } |
| 111 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . |
|
| 111 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'. |
|
| 112 | 112 | $deployment->identifier); |
| 113 | 113 | exit(0); |
| 114 | 114 | case web\lib\common\FormElements::BUTTON_REMOVESP: |
| 115 | 115 | $deployment->remove(); |
| 116 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier); |
|
| 116 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier); |
|
| 117 | 117 | exit(0); |
| 118 | 118 | case web\lib\common\FormElements::BUTTON_RENEWTLS: |
| 119 | 119 | $data = openssl_x509_parse($deployment->radsec_cert); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $torevoke = implode('#', $certdata); |
| 125 | 125 | $response = $deployment->setRADIUSconfig(0, 0, $torevoke); |
| 126 | 126 | $deployment->renewtls(); |
| 127 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier); |
|
| 127 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier); |
|
| 128 | 128 | exit(0); |
| 129 | 129 | case web\lib\common\FormElements::BUTTON_ACTIVATE: |
| 130 | 130 | if (count($deployment->getAttributes("hiddenmanagedsp:tou_accepted")) > 0) { |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | if (in_array('OK', $response)) { |
| 133 | 133 | $deployment->activate(); |
| 134 | 134 | } |
| 135 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier); |
|
| 135 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier); |
|
| 136 | 136 | exit(0); |
| 137 | 137 | } else { |
| 138 | 138 | throw new Exception("Activate button pushed without acknowledged ToUs!"); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } else { |
| 162 | 162 | $response = ['NOOP', 'NOOP']; |
| 163 | 163 | } |
| 164 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '&' . urldecode(http_build_query($response)) . '#profilebox_' . $deployment->identifier); |
|
| 164 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'&'.urldecode(http_build_query($response)).'#profilebox_'.$deployment->identifier); |
|
| 165 | 165 | exit(0); |
| 166 | 166 | default: |
| 167 | 167 | throw new Exception("Unknown button action requested!"); |
@@ -170,10 +170,10 @@ discard block |
||
| 170 | 170 | if (isset($_POST['command'])) { |
| 171 | 171 | switch ($_POST['command']) { |
| 172 | 172 | case web\lib\common\FormElements::BUTTON_CLOSE: |
| 173 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier) . '#profilebox_' . $deployment->identifier; |
|
| 173 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier).'#profilebox_'.$deployment->identifier; |
|
| 174 | 174 | exit(0); |
| 175 | 175 | default: |
| 176 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier); |
|
| 176 | + header("Location: overview_org.php?inst_id=".$my_inst->identifier.'#profilebox_'.$deployment->identifier); |
|
| 177 | 177 | exit(0); |
| 178 | 178 | } |
| 179 | 179 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | echo $uiElements->instLevelInfoBoxes($my_inst); |
| 201 | 201 | $deploymentOptions = $deployment->getAttributes(); |
| 202 | 202 | echo "<form enctype='multipart/form-data' action='edit_hotspot.php?inst_id=$my_inst->identifier&deployment_id=$deployment->identifier' method='post' accept-charset='UTF-8'> |
| 203 | - <input type='hidden' name='MAX_FILE_SIZE' value='" . \config\Master::MAX_UPLOAD_SIZE . "'>"; |
|
| 203 | + <input type='hidden' name='MAX_FILE_SIZE' value='".\config\Master::MAX_UPLOAD_SIZE."'>"; |
|
| 204 | 204 | $optionDisplay = new \web\lib\admin\OptionDisplay($deploymentOptions, \core\Options::LEVEL_PROFILE); |
| 205 | 205 | ?> |
| 206 | 206 | <fieldset class='option_container' id='managedsp_override'> |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | <!-- input for VLAN identifier for home users--> |
| 235 | 235 | <td> |
| 236 | 236 | <span id='vlan_label'> |
| 237 | - <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " " . _("(unset with '0')"))); ?> |
|
| 237 | + <?php echo sprintf(_("VLAN tag for own users%s:"), ($vlan === NULL ? "" : " "._("(unset with '0')"))); ?> |
|
| 238 | 238 | </span> |
| 239 | 239 | </td> |
| 240 | 240 | <td> |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | </fieldset> |
| 255 | 255 | |
| 256 | 256 | <?php |
| 257 | - echo "<p><button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_SAVE . "'>" . _("Save data") . "</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>" . _("Discard changes") . "</button></p></form>"; |
|
| 257 | + echo "<p><button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_SAVE."'>"._("Save data")."</button><button type='button' class='delete' name='abortbutton' value='abort' onclick='javascript:window.location = \"overview_org.php?inst_id=$my_inst->identifier\"'>"._("Discard changes")."</button></p></form>"; |
|
| 258 | 258 | echo $deco->footer(); |
| 259 | 259 | |
| 260 | 260 | |
| 261 | 261 | \ No newline at end of file |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | <?php |
| 441 | 441 | if ($deploymentObject->radsec_cert != NULL) { |
| 442 | 442 | echo _('If your certificate is close to expiry or you need to create new RADSEC over TLS credentials') . '<br>' . |
| 443 | - _('click on "Renew RADSEC over TLS credentials" button'); |
|
| 443 | + _('click on "Renew RADSEC over TLS credentials" button'); |
|
| 444 | 444 | } |
| 445 | 445 | ?> |
| 446 | 446 | </td></tr> |
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | } |
| 557 | 557 | } |
| 558 | 558 | } |
| 559 | - ?> |
|
| 559 | + ?> |
|
| 560 | 560 | </form> |
| 561 | 561 | <div align="right"> |
| 562 | 562 | <form action='edit_hotspot.php?inst_id=<?php echo $deploymentObject->institution; ?>&deployment_id=<?php echo $deploymentObject->identifier; ?>' method='post' accept-charset='UTF-8'> |
@@ -644,9 +644,9 @@ discard block |
||
| 644 | 644 | foreach (array($dsp->host1_v4, $dsp->host2_v4) as $host) { |
| 645 | 645 | $connection = @fsockopen($host, \config\Master::MANAGEDSP['radiusconfigport']); |
| 646 | 646 | if (is_resource($connection)) { |
| 647 | - fclose($connection); |
|
| 647 | + fclose($connection); |
|
| 648 | 648 | } else { |
| 649 | - return false; |
|
| 649 | + return false; |
|
| 650 | 650 | } |
| 651 | 651 | } |
| 652 | 652 | return true; |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | </button> |
| 880 | 880 | <span style='color: red;'> |
| 881 | 881 | <?php if ($hasMail == 0) { |
| 882 | - echo _("Helpdesk mail address is required but missing!"); |
|
| 882 | + echo _("Helpdesk mail address is required but missing!"); |
|
| 883 | 883 | } |
| 884 | 884 | ?> |
| 885 | 885 | </span> |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | ?> |
| 29 | 29 | <?php |
| 30 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 30 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 31 | 31 | |
| 32 | 32 | function displaySilverbulletPropertyWidget(&$theProfile, $readonly, &$uiElements) { |
| 33 | 33 | ?> |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | <ul style='margin:1px'> |
| 45 | 45 | <?php |
| 46 | 46 | foreach ($completeness as $missing_attrib) { |
| 47 | - echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>"; |
|
| 47 | + echo "<li>".$uiElements->displayName($missing_attrib)."</li>"; |
|
| 48 | 48 | } |
| 49 | 49 | ?> |
| 50 | 50 | </ul> |
| 51 | 51 | </div> |
| 52 | 52 | <?php |
| 53 | 53 | } else { |
| 54 | - echo sprintf(_("You can create up to %d users."), $maxusers[0]['value']) . "<br/>" . sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm); |
|
| 54 | + echo sprintf(_("You can create up to %d users."), $maxusers[0]['value'])."<br/>".sprintf(_("Their credentials will carry the name <strong>%s</strong>."), $theProfile->realm); |
|
| 55 | 55 | } |
| 56 | 56 | ?> |
| 57 | 57 | <br/> |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | if ($readonly === FALSE) { |
| 61 | 61 | ?> |
| 62 | 62 | <form action='edit_silverbullet.php?inst_id=<?php echo $theProfile->institution; ?>&profile_id=<?php echo $theProfile->identifier; ?>' method='POST'> |
| 63 | - <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
| 63 | + <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
| 64 | 64 | </form> |
| 65 | 65 | <?php |
| 66 | 66 | } |
@@ -96,21 +96,21 @@ discard block |
||
| 96 | 96 | $has_overrides = TRUE; |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | - $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>"; |
|
| 99 | + $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>"; |
|
| 100 | 100 | $typelist = $theProfile->getEapMethodsinOrderOfPreference(); |
| 101 | 101 | $allcomplete = TRUE; |
| 102 | 102 | foreach ($typelist as $eaptype) { |
| 103 | 103 | $buffer_eaptypediv .= $eaptype->getPrintableRep(); |
| 104 | 104 | $completeness = $theProfile->isEapTypeDefinitionComplete($eaptype); |
| 105 | 105 | if ($completeness === true) { |
| 106 | - $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>"; |
|
| 106 | + $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>"; |
|
| 107 | 107 | } else { |
| 108 | 108 | $buffer_eaptypediv .= " <div class='notacceptable'>"; |
| 109 | 109 | $buffer_eaptypediv .= _("Information needed!"); |
| 110 | 110 | if (is_array($completeness)) { |
| 111 | 111 | $buffer_eaptypediv .= "<ul style='margin:1px'>"; |
| 112 | 112 | foreach ($completeness as $missing_attrib) { |
| 113 | - $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>"; |
|
| 113 | + $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>"; |
|
| 114 | 114 | } |
| 115 | 115 | $buffer_eaptypediv .= "</ul>"; |
| 116 | 116 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | foreach ($attribs as $attrib) { |
| 123 | 123 | if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) { |
| 124 | 124 | $justOnce = TRUE; |
| 125 | - $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='" . _("Options on EAP Method/Device level are in effect.") . "'>"; |
|
| 125 | + $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='"._("Options on EAP Method/Device level are in effect.")."'>"; |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | $buffer_eaptypediv .= "<br/>"; |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if ($theProfile->isRedirected()) { |
| 149 | 149 | $iconData = $uiElements->iconData('PROFILES_REDIRECTED'); |
| 150 | 150 | $iconData['text'] = _("Profile redirected"); |
| 151 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 151 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 152 | 152 | |
| 153 | 153 | } |
| 154 | 154 | |
@@ -156,15 +156,15 @@ discard block |
||
| 156 | 156 | switch ($certStatus) { |
| 157 | 157 | case core\AbstractProfile::CERT_STATUS_OK: |
| 158 | 158 | $iconData = $uiElements->iconData('CERT_STATUS_OK'); |
| 159 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 159 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 160 | 160 | break; |
| 161 | 161 | case core\AbstractProfile::CERT_STATUS_WARN: |
| 162 | 162 | $iconData = $uiElements->iconData('CERT_STATUS_WARN'); |
| 163 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 163 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 164 | 164 | break; |
| 165 | 165 | case core\AbstractProfile::CERT_STATUS_ERROR: |
| 166 | 166 | $iconData = $uiElements->iconData('CERT_STATUS_ERROR'); |
| 167 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 167 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 168 | 168 | break; |
| 169 | 169 | } |
| 170 | 170 | $buffer_headline .= "</div>"; |
@@ -190,11 +190,11 @@ discard block |
||
| 190 | 190 | if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") { |
| 191 | 191 | $diagUrl = "../diag/"; |
| 192 | 192 | } else { |
| 193 | - $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/"; |
|
| 193 | + $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/"; |
|
| 194 | 194 | } |
| 195 | 195 | ?> |
| 196 | - <form action='<?php echo $diagUrl . "action_realmcheck.php?inst_id=" . $theProfile->institution . "&profile_id=" . $theProfile->identifier ?>' method='post' accept-charset='UTF-8'> |
|
| 197 | - <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link . $_SERVER['SCRIPT_NAME']); ?>'/> |
|
| 196 | + <form action='<?php echo $diagUrl."action_realmcheck.php?inst_id=".$theProfile->institution."&profile_id=".$theProfile->identifier ?>' method='post' accept-charset='UTF-8'> |
|
| 197 | + <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link.$_SERVER['SCRIPT_NAME']); ?>'/> |
|
| 198 | 198 | <button type='submit' name='profile_action' value='check' <?php echo ($has_realm ? "" : "disabled='disabled'"); ?> title='<?php echo _("The realm can only be checked if you configure the realm!"); ?>'> |
| 199 | 199 | <?php echo _("Check realm reachability"); ?> |
| 200 | 200 | </button> |
@@ -241,9 +241,9 @@ discard block |
||
| 241 | 241 | ?> |
| 242 | 242 | <div style='display: flex;'> |
| 243 | 243 | <?php |
| 244 | - $idpLevelUrl = $link . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $theProfile->institution; |
|
| 245 | - $displayurl = $idpLevelUrl . "&profile=" . $theProfile->identifier; |
|
| 246 | - $QRurl = $idpLevelUrl . "&profile=" . $theProfile->identifier; |
|
| 244 | + $idpLevelUrl = $link.dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$theProfile->institution; |
|
| 245 | + $displayurl = $idpLevelUrl."&profile=".$theProfile->identifier; |
|
| 246 | + $QRurl = $idpLevelUrl."&profile=".$theProfile->identifier; |
|
| 247 | 247 | $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([ |
| 248 | 248 | 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG, |
| 249 | 249 | 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H, |
@@ -255,9 +255,9 @@ discard block |
||
| 255 | 255 | if (empty($rawQr)) { |
| 256 | 256 | throw new Exception("Something went seriously wrong during QR code generation!"); |
| 257 | 257 | } |
| 258 | - $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL)); |
|
| 258 | + $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL)); |
|
| 259 | 259 | $size = getimagesize($uri); |
| 260 | - echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>"; |
|
| 260 | + echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>"; |
|
| 261 | 261 | |
| 262 | 262 | //echo "<nobr>$displayurl</nobr></a>"; |
| 263 | 263 | echo "<p>$displayurl</p></a>"; |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $radius_status = array(); |
| 287 | 287 | $radius_status[0] = $deploymentObject->radius_status_1; |
| 288 | 288 | $radius_status[1] = $deploymentObject->radius_status_2; |
| 289 | - $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 289 | + $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 290 | 290 | $retry = $deploymentObject->checkRADIUSHostandConfigDaemon(); |
| 291 | 291 | $isradiusready = radius_ready($deploymentObject); |
| 292 | 292 | if (is_array($retry)) { |
@@ -298,11 +298,11 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | ?> |
| 300 | 300 | <div style='display: table-row_id;'> |
| 301 | - <div class='profilebox' id="profilebox_<?php echo $deploymentObject->identifier;?>" style='display: table-cell;'> |
|
| 301 | + <div class='profilebox' id="profilebox_<?php echo $deploymentObject->identifier; ?>" style='display: table-cell;'> |
|
| 302 | 302 | <h2><?php |
| 303 | 303 | switch ($deploymentObject->consortium) { |
| 304 | 304 | case "eduroam": |
| 305 | - $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME; |
|
| 305 | + $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME; |
|
| 306 | 306 | break; |
| 307 | 307 | case "OpenRoaming": |
| 308 | 308 | $displayname = "OpenRoaming ANP"; |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | default: |
| 311 | 311 | throw new Exception("We are supposed to operate on a roaming consortium we don't know."); |
| 312 | 312 | } |
| 313 | - echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)"; |
|
| 313 | + echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)"; |
|
| 314 | 314 | ?></h2> |
| 315 | 315 | <table> |
| 316 | 316 | <caption><?php echo _("Deployment Details"); ?></caption> |
@@ -328,13 +328,13 @@ discard block |
||
| 328 | 328 | <td> |
| 329 | 329 | <?php |
| 330 | 330 | if ($deploymentObject->host1_v4 !== NULL) { |
| 331 | - echo _("IPv4") . ": " . $deploymentObject->host1_v4; |
|
| 331 | + echo _("IPv4").": ".$deploymentObject->host1_v4; |
|
| 332 | 332 | } |
| 333 | 333 | if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) { |
| 334 | 334 | echo "<br/>"; |
| 335 | 335 | } |
| 336 | 336 | if ($deploymentObject->host1_v6 !== NULL) { |
| 337 | - echo _("IPv6") . ": " . $deploymentObject->host1_v6; |
|
| 337 | + echo _("IPv6").": ".$deploymentObject->host1_v6; |
|
| 338 | 338 | } |
| 339 | 339 | ?> |
| 340 | 340 | </td> |
@@ -350,9 +350,9 @@ discard block |
||
| 350 | 350 | <td> |
| 351 | 351 | <?php |
| 352 | 352 | if ($deploymentObject->status) { |
| 353 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] . |
|
| 354 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . |
|
| 355 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>"; |
|
| 353 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon']. |
|
| 354 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text']. |
|
| 355 | + "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>"; |
|
| 356 | 356 | } |
| 357 | 357 | ?> |
| 358 | 358 | </td> |
@@ -364,13 +364,13 @@ discard block |
||
| 364 | 364 | <td> |
| 365 | 365 | <?php |
| 366 | 366 | if ($deploymentObject->host2_v4 !== NULL) { |
| 367 | - echo _("IPv4") . ": " . $deploymentObject->host2_v4; |
|
| 367 | + echo _("IPv4").": ".$deploymentObject->host2_v4; |
|
| 368 | 368 | } |
| 369 | 369 | if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) { |
| 370 | 370 | echo "<br/>"; |
| 371 | 371 | } |
| 372 | 372 | if ($deploymentObject->host2_v6 !== NULL) { |
| 373 | - echo _("IPv6") . ": " . $deploymentObject->host2_v6; |
|
| 373 | + echo _("IPv6").": ".$deploymentObject->host2_v6; |
|
| 374 | 374 | } |
| 375 | 375 | ?> |
| 376 | 376 | </td> |
@@ -386,9 +386,9 @@ discard block |
||
| 386 | 386 | <td> |
| 387 | 387 | <?php |
| 388 | 388 | if ($deploymentObject->status) { |
| 389 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] . |
|
| 390 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . |
|
| 391 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>"; |
|
| 389 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon']. |
|
| 390 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text']. |
|
| 391 | + "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>"; |
|
| 392 | 392 | } |
| 393 | 393 | ?> |
| 394 | 394 | </td> |
@@ -414,32 +414,32 @@ discard block |
||
| 414 | 414 | <tr> |
| 415 | 415 | <td><strong><?php echo _("RADSEC over TLS credentials"); ?></strong></td> |
| 416 | 416 | <td> |
| 417 | - <input type="hidden" id="priv_key_data_<?php echo $deploymentObject->identifier;?>" value="<?php echo $deploymentObject->radsec_priv;?>"> |
|
| 418 | - <input type="hidden" id="cert_data_<?php echo $deploymentObject->identifier;?>" value="<?php echo $deploymentObject->radsec_cert;?>"> |
|
| 419 | - <input type="hidden" id="ca_cert_data" value="<?php echo $cacert;?>"> |
|
| 420 | - <button class="sp_priv_key" id="priv_key_<?php echo $deploymentObject->identifier;?>" name="showc" type="submit"><?php echo _('private key');?></button> |
|
| 421 | - <button class="sp_cert" id="cert_<?php echo $deploymentObject->identifier;?>" name="showp" type="submit"><?php echo _('certificate');?></button> |
|
| 422 | - <button class="ca_cert" name="showca" type="submit"><?php echo _('CA certificate');?></button> |
|
| 423 | - <button name="sendzip" onclick="location.href='inc/sendzip.inc.php?inst_id=<?php echo $deploymentObject->institution;?>&dep_id=<?php echo $deploymentObject->identifier;?>'" type="button"><?php echo _('download ZIP-file with full data');?></button> |
|
| 417 | + <input type="hidden" id="priv_key_data_<?php echo $deploymentObject->identifier; ?>" value="<?php echo $deploymentObject->radsec_priv; ?>"> |
|
| 418 | + <input type="hidden" id="cert_data_<?php echo $deploymentObject->identifier; ?>" value="<?php echo $deploymentObject->radsec_cert; ?>"> |
|
| 419 | + <input type="hidden" id="ca_cert_data" value="<?php echo $cacert; ?>"> |
|
| 420 | + <button class="sp_priv_key" id="priv_key_<?php echo $deploymentObject->identifier; ?>" name="showc" type="submit"><?php echo _('private key'); ?></button> |
|
| 421 | + <button class="sp_cert" id="cert_<?php echo $deploymentObject->identifier; ?>" name="showp" type="submit"><?php echo _('certificate'); ?></button> |
|
| 422 | + <button class="ca_cert" name="showca" type="submit"><?php echo _('CA certificate'); ?></button> |
|
| 423 | + <button name="sendzip" onclick="location.href='inc/sendzip.inc.php?inst_id=<?php echo $deploymentObject->institution; ?>&dep_id=<?php echo $deploymentObject->identifier; ?>'" type="button"><?php echo _('download ZIP-file with full data'); ?></button> |
|
| 424 | 424 | </td |
| 425 | 425 | </tr> |
| 426 | 426 | <tr> <td></td><td> |
| 427 | 427 | <?php |
| 428 | - echo _('Serial number:') . ' ' . strtoupper(dechex($data['serialNumber'])) . '<br>'; |
|
| 429 | - $dleft = floor(($data['validTo_time_t']-time())/(24*60*60)); |
|
| 428 | + echo _('Serial number:').' '.strtoupper(dechex($data['serialNumber'])).'<br>'; |
|
| 429 | + $dleft = floor(($data['validTo_time_t'] - time()) / (24 * 60 * 60)); |
|
| 430 | 430 | if ($dleft < 30) echo '<font color="red">'; |
| 431 | - echo _('Not valid after:') . ' '. date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s') . ' UTC'; |
|
| 431 | + echo _('Not valid after:').' '.date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s').' UTC'; |
|
| 432 | 432 | if ($dleft > 2) { |
| 433 | - echo '<br>' . _('Number of days to expiry:') . ' ' . $dleft; |
|
| 433 | + echo '<br>'._('Number of days to expiry:').' '.$dleft; |
|
| 434 | 434 | } else { |
| 435 | - echo '<br>' . _('If you are using RADSEC over TLS you should urgently renew your credentisls') . '!'; |
|
| 435 | + echo '<br>'._('If you are using RADSEC over TLS you should urgently renew your credentisls').'!'; |
|
| 436 | 436 | } |
| 437 | 437 | if ($dleft < 30) { echo '</font>'; } |
| 438 | 438 | ?></td></tr> |
| 439 | 439 | <tr> <td></td><td> |
| 440 | 440 | <?php |
| 441 | 441 | if ($deploymentObject->radsec_cert != NULL) { |
| 442 | - echo _('If your certificate is close to expiry or you need to create new RADSEC over TLS credentials') . '<br>' . |
|
| 442 | + echo _('If your certificate is close to expiry or you need to create new RADSEC over TLS credentials').'<br>'. |
|
| 443 | 443 | _('click on "Renew RADSEC over TLS credentials" button'); |
| 444 | 444 | } |
| 445 | 445 | ?> |
@@ -451,14 +451,14 @@ discard block |
||
| 451 | 451 | <tr> |
| 452 | 452 | <td><strong><?php echo _("RADSEC TLS-PSK identity"); ?></strong></td> |
| 453 | 453 | <td> |
| 454 | - SP_<?php echo $deploymentObject->identifier . '-' . $deploymentObject->institution;?> |
|
| 454 | + SP_<?php echo $deploymentObject->identifier.'-'.$deploymentObject->institution; ?> |
|
| 455 | 455 | </td> |
| 456 | 456 | </tr> |
| 457 | 457 | |
| 458 | 458 | <tr> |
| 459 | 459 | <td><strong><?php echo _("RADSEC TLS-PSK key"); ?></strong></td> |
| 460 | 460 | <td> |
| 461 | - <?php echo $deploymentObject->pskkey;?> |
|
| 461 | + <?php echo $deploymentObject->pskkey; ?> |
|
| 462 | 462 | </td> |
| 463 | 463 | </tr> |
| 464 | 464 | <?php } ?> |
@@ -514,12 +514,12 @@ discard block |
||
| 514 | 514 | if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) { |
| 515 | 515 | echo '<br>'; |
| 516 | 516 | if ($res['FAILURE'] == 2) { |
| 517 | - echo ' <span style="color: red;">' . _("Activation failure.") . '</span>'; |
|
| 517 | + echo ' <span style="color: red;">'._("Activation failure.").'</span>'; |
|
| 518 | 518 | } else { |
| 519 | 519 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
| 520 | - echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>'; |
|
| 520 | + echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>'; |
|
| 521 | 521 | } else { |
| 522 | - echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>'; |
|
| 522 | + echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>'; |
|
| 523 | 523 | } |
| 524 | 524 | } |
| 525 | 525 | } |
@@ -546,12 +546,12 @@ discard block |
||
| 546 | 546 | if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) { |
| 547 | 547 | echo '<br>'; |
| 548 | 548 | if ($res['FAILURE'] == 2) { |
| 549 | - echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>'; |
|
| 549 | + echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>'; |
|
| 550 | 550 | } else { |
| 551 | 551 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
| 552 | - echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>'; |
|
| 552 | + echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>'; |
|
| 553 | 553 | } else { |
| 554 | - echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>'; |
|
| 554 | + echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>'; |
|
| 555 | 555 | } |
| 556 | 556 | } |
| 557 | 557 | } |
@@ -575,29 +575,29 @@ discard block |
||
| 575 | 575 | </div> |
| 576 | 576 | |
| 577 | 577 | </div> |
| 578 | - <?php if (!$isradiusready) { echo '<p>'. _("We are not able to handle a new configuration request requiring contact with RADIUS servers now.") . '<br>' . _("Check later.");} ?> |
|
| 578 | + <?php if (!$isradiusready) { echo '<p>'._("We are not able to handle a new configuration request requiring contact with RADIUS servers now.").'<br>'._("Check later."); } ?> |
|
| 579 | 579 | </div> |
| 580 | 580 | <div style='width:20px;'></div> <!-- QR code space, reserved --> |
| 581 | 581 | <div style='display: table-cell; min-width:200px;'> |
| 582 | - <?php $tablecaption = _("Hotspot Usage Statistics");?> |
|
| 582 | + <?php $tablecaption = _("Hotspot Usage Statistics"); ?> |
|
| 583 | 583 | <h1><?php echo $tablecaption; ?></h1> |
| 584 | - <h2><?php echo _("5 most recent authentications");?></h2> |
|
| 585 | - <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)");?></p> |
|
| 584 | + <h2><?php echo _("5 most recent authentications"); ?></h2> |
|
| 585 | + <p><?php echo _("(AP Identifier is a /-separated tuple of NAS-Identifier/NAS-IP-Address/NAS-IPv6-Address/Called-Station-Id)"); ?></p> |
|
| 586 | 586 | <table class='authrecord'> |
| 587 | - <caption><?php echo $tablecaption;?></caption> |
|
| 587 | + <caption><?php echo $tablecaption; ?></caption> |
|
| 588 | 588 | <tr style='text-align: left;'> |
| 589 | - <th scope="col"><strong><?php echo _("Timestamp (UTC)");?></strong></th> |
|
| 590 | - <th scope="col"><strong><?php echo _("Realm");?></strong></th> |
|
| 591 | - <th scope="col"><strong><?php echo _("MAC Address");?></strong></th> |
|
| 592 | - <th scope="col"><strong><?php echo _("Chargeable-User-Identity");?></strong></th> |
|
| 593 | - <th scope="col"><strong><?php echo _("Result");?></strong></th> |
|
| 594 | - <th scope="col"><strong><?php echo _("AP Identifier");?></strong></th> |
|
| 595 | - <th scope="col"><strong><?php echo _("Protocol");?></strong></th> |
|
| 589 | + <th scope="col"><strong><?php echo _("Timestamp (UTC)"); ?></strong></th> |
|
| 590 | + <th scope="col"><strong><?php echo _("Realm"); ?></strong></th> |
|
| 591 | + <th scope="col"><strong><?php echo _("MAC Address"); ?></strong></th> |
|
| 592 | + <th scope="col"><strong><?php echo _("Chargeable-User-Identity"); ?></strong></th> |
|
| 593 | + <th scope="col"><strong><?php echo _("Result"); ?></strong></th> |
|
| 594 | + <th scope="col"><strong><?php echo _("AP Identifier"); ?></strong></th> |
|
| 595 | + <th scope="col"><strong><?php echo _("Protocol"); ?></strong></th> |
|
| 596 | 596 | </tr> |
| 597 | 597 | <?php |
| 598 | - $userAuthData = $deploymentObject->retrieveStatistics(0,5); |
|
| 598 | + $userAuthData = $deploymentObject->retrieveStatistics(0, 5); |
|
| 599 | 599 | foreach ($userAuthData as $oneRecord) { |
| 600 | - echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail" )."'>" |
|
| 600 | + echo "<tr class='".($oneRecord['result'] == "OK" ? "auth-success" : "auth-fail")."'>" |
|
| 601 | 601 | . "<td>".$oneRecord['activity_time']."</td>" |
| 602 | 602 | . "<td>".$oneRecord['realm']."</td>" |
| 603 | 603 | . "<td>".$oneRecord['mac']."</td>" |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | } |
| 807 | 807 | ?> |
| 808 | 808 | </h2> |
| 809 | - <?php if(count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?> |
|
| 809 | + <?php if (count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?> |
|
| 810 | 810 | <form method='post' action='sort_profiles.php?inst_id=<?php echo $my_inst->identifier; ?>' accept-charset='UTF-8'> |
| 811 | 811 | <div> |
| 812 | 812 | <button type='submit' name='profile_sorting'> |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | <div> |
| 876 | 876 | <input type="hidden" name="consortium" value="eduroam"/> |
| 877 | 877 | <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'> |
| 878 | - <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?> |
|
| 878 | + <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?> |
|
| 879 | 879 | </button> |
| 880 | 880 | <span style='color: red;'> |
| 881 | 881 | <?php if ($hasMail == 0) { |
@@ -427,7 +427,9 @@ |
||
| 427 | 427 | <?php |
| 428 | 428 | echo _('Serial number:') . ' ' . strtoupper(dechex($data['serialNumber'])) . '<br>'; |
| 429 | 429 | $dleft = floor(($data['validTo_time_t']-time())/(24*60*60)); |
| 430 | - if ($dleft < 30) echo '<font color="red">'; |
|
| 430 | + if ($dleft < 30) { |
|
| 431 | + echo '<font color="red">'; |
|
| 432 | + } |
|
| 431 | 433 | echo _('Not valid after:') . ' '. date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s') . ' UTC'; |
| 432 | 434 | if ($dleft > 2) { |
| 433 | 435 | echo '<br>' . _('Number of days to expiry:') . ' ' . $dleft; |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id; |
| 316 | 316 | } |
| 317 | 317 | if ($clients > $maxSupportedClients * 0.9) { |
| 318 | - $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!"); |
|
| 318 | + $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!"); |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | if (count($serverCandidates) == 0 && $federation != "DEFAULT") { |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | */ |
| 340 | 340 | private function createTLScredentials() |
| 341 | 341 | { |
| 342 | - $clientName = "SP_" . $this->identifier . '-' . $this->institution; |
|
| 342 | + $clientName = "SP_".$this->identifier.'-'.$this->institution; |
|
| 343 | 343 | $dn = array( |
| 344 | 344 | "organizationName" => "eduroam", |
| 345 | 345 | "organizationalUnitName" => "eduroam Managed SP", |
@@ -353,13 +353,13 @@ discard block |
||
| 353 | 353 | openssl_pkey_export($privkey, $this->radsec_priv); |
| 354 | 354 | // Generate a certificate signing request |
| 355 | 355 | $csr = openssl_csr_new($dn, $privkey, |
| 356 | - array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf")); |
|
| 356 | + array('digest_alg' => 'sha256', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf")); |
|
| 357 | 357 | // get CA certificate and private key |
| 358 | - $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"), |
|
| 358 | + $caprivkey = array(file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.key"), |
|
| 359 | 359 | \config\Master::MANAGEDSP['capass']); |
| 360 | - $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 360 | + $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 361 | 361 | $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'], |
| 362 | - array('digest_alg'=>'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), rand()); |
|
| 362 | + array('digest_alg'=>'sha256', 'config' => ROOT."/config/ManagedSPCerts/openssl.cnf"), rand()); |
|
| 363 | 363 | openssl_x509_export($clientcert, $this->radsec_cert); |
| 364 | 364 | } |
| 365 | 365 | /** |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | $conditional1 = "AND activity_time > DATE_SUB(NOW(), INTERVAL $backlog SECOND)"; |
| 385 | 385 | $conditional2 = ""; |
| 386 | 386 | } |
| 387 | - $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id, prot FROM activity WHERE operatorname = ? $conditional1 ORDER BY activity_time $conditional2", "s", $opName ); |
|
| 387 | + $stats = $this->databaseHandle->exec("SELECT activity_time, realm, mac, cui, result, ap_id, prot FROM activity WHERE operatorname = ? $conditional1 ORDER BY activity_time $conditional2", "s", $opName); |
|
| 388 | 388 | return mysqli_fetch_all($stats, \MYSQLI_ASSOC); |
| 389 | 389 | } |
| 390 | 390 | |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | { |
| 516 | 516 | $customAttrib = $this->getAttributes("managedsp:operatorname"); |
| 517 | 517 | if (count($customAttrib) == 0) { |
| 518 | - return "1sp." . $this->identifier . "-" . $this->institution . \config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
| 518 | + return "1sp.".$this->identifier."-".$this->institution.\config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
| 519 | 519 | } |
| 520 | 520 | return $customAttrib[0]["value"]; |
| 521 | 521 | } |
@@ -530,14 +530,14 @@ discard block |
||
| 530 | 530 | private function sendToRADIUS(int $idx, $post) |
| 531 | 531 | { |
| 532 | 532 | $hostname = "radius_hostname_$idx"; |
| 533 | - $ch = curl_init("http://" . $this->$hostname . ':' . \config\Master::MANAGEDSP['radiusconfigport']); |
|
| 533 | + $ch = curl_init("http://".$this->$hostname.':'.\config\Master::MANAGEDSP['radiusconfigport']); |
|
| 534 | 534 | if ($ch === FALSE) { |
| 535 | 535 | $res = 'FAILURE'; |
| 536 | 536 | } else { |
| 537 | 537 | curl_setopt($ch, CURLOPT_USERAGENT, "CAT-ManagedSP"); |
| 538 | 538 | curl_setopt($ch, CURLOPT_POST, 1); |
| 539 | 539 | curl_setopt($ch, CURLOPT_POSTFIELDS, $post); |
| 540 | - $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ':' . \config\Master::MANAGEDSP['radiusconfigport'] . "/$post\n"); |
|
| 540 | + $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.':'.\config\Master::MANAGEDSP['radiusconfigport']."/$post\n"); |
|
| 541 | 541 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
| 542 | 542 | curl_setopt($ch, CURLOPT_HEADER, 0); |
| 543 | 543 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
@@ -576,19 +576,19 @@ discard block |
||
| 576 | 576 | } else { |
| 577 | 577 | $txt = $remove ? _('Profile deactivation failed') : _('Profile activation/modification failed'); |
| 578 | 578 | } |
| 579 | - $txt = $txt . ' '; |
|
| 579 | + $txt = $txt.' '; |
|
| 580 | 580 | if (array_count_values($response)[$status] == 2) { |
| 581 | - $txt = $txt . _('on both RADIUS servers: primary and backup') . '.'; |
|
| 581 | + $txt = $txt._('on both RADIUS servers: primary and backup').'.'; |
|
| 582 | 582 | } else { |
| 583 | 583 | if ($response['res[1]'] == $status) { |
| 584 | - $txt = $txt . _('on primary RADIUS server') . '.'; |
|
| 584 | + $txt = $txt._('on primary RADIUS server').'.'; |
|
| 585 | 585 | } else { |
| 586 | - $txt = $txt . _('on backup RADIUS server') . '.'; |
|
| 586 | + $txt = $txt._('on backup RADIUS server').'.'; |
|
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | $mail = \core\common\OutsideComm::mailHandle(); |
| 590 | 590 | $email = $this->getAttributes("support:email")[0]['value']; |
| 591 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Notification System"; |
|
| 591 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Notification System"; |
|
| 592 | 592 | $mail->addAddress($email); |
| 593 | 593 | if ($status == 'OK') { |
| 594 | 594 | $mail->Subject = _('RADIUS profile update problem fixed'); |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | return NULL; |
| 623 | 623 | } |
| 624 | 624 | $timeout = 10; |
| 625 | - curl_setopt($ch, CURLOPT_URL, 'http://' . $host); |
|
| 625 | + curl_setopt($ch, CURLOPT_URL, 'http://'.$host); |
|
| 626 | 626 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 627 | 627 | curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
| 628 | 628 | curl_exec($ch); |
@@ -714,49 +714,49 @@ discard block |
||
| 714 | 714 | { |
| 715 | 715 | $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => '')); |
| 716 | 716 | if ($torevoke != '') { |
| 717 | - $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . |
|
| 717 | + $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier. |
|
| 718 | 718 | "&torevoke=$torevoke"; |
| 719 | 719 | foreach (array_keys($toPost) as $key) { |
| 720 | 720 | $toPost[$key] = $toPostTemplate; |
| 721 | 721 | } |
| 722 | 722 | } else { |
| 723 | 723 | $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1; |
| 724 | - $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . |
|
| 725 | - '&secret=' . $this->secret . |
|
| 726 | - '&country=' . $this->getAttributes("internal:country")[0]['value'] . |
|
| 727 | - '&pskkey=' . $this->pskkey . '&'; |
|
| 724 | + $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier. |
|
| 725 | + '&secret='.$this->secret. |
|
| 726 | + '&country='.$this->getAttributes("internal:country")[0]['value']. |
|
| 727 | + '&pskkey='.$this->pskkey.'&'; |
|
| 728 | 728 | if ($remove) { |
| 729 | - $toPostTemplate = $toPostTemplate . 'remove=1&'; |
|
| 729 | + $toPostTemplate = $toPostTemplate.'remove=1&'; |
|
| 730 | 730 | } else { |
| 731 | - $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getOperatorName() . '&'; |
|
| 731 | + $toPostTemplate = $toPostTemplate.'operatorname='.$this->getOperatorName().'&'; |
|
| 732 | 732 | if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) { |
| 733 | 733 | $allRealms = $this->getAllRealms(); |
| 734 | 734 | if (!empty($allRealms)) { |
| 735 | - $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&'; |
|
| 736 | - $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&'; |
|
| 735 | + $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&'; |
|
| 736 | + $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&'; |
|
| 737 | 737 | } |
| 738 | 738 | } |
| 739 | 739 | } |
| 740 | 740 | foreach (array_keys($toPost) as $key) { |
| 741 | - $elem = 'port' . $key; |
|
| 742 | - $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem; |
|
| 741 | + $elem = 'port'.$key; |
|
| 742 | + $toPost[$key] = $toPostTemplate.'port='.$this->$elem; |
|
| 743 | 743 | } |
| 744 | 744 | } |
| 745 | 745 | $response = array(); |
| 746 | 746 | foreach ($toPost as $key => $value) { |
| 747 | - $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n"); |
|
| 747 | + $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n"); |
|
| 748 | 748 | // temporarly one server $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
| 749 | 749 | //if ($key == 2) { |
| 750 | 750 | // $response['res[2]'] = 'OK'; |
| 751 | 751 | //} else { |
| 752 | - $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
| 752 | + $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
| 753 | 753 | //} |
| 754 | 754 | } |
| 755 | 755 | if ($onlyone) { |
| 756 | - $response['res[' . ($onlyone == 1) ? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK; |
|
| 756 | + $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK; |
|
| 757 | 757 | } |
| 758 | 758 | foreach (array('OK', 'FAILURE') as $status) { |
| 759 | - if ( ( ($status == 'OK' && $notify) || ($status == 'FAILURE') ) && ( in_array($status, $response) ) ) { |
|
| 759 | + if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && (in_array($status, $response))) { |
|
| 760 | 760 | $this->sendMailtoAdmin($remove, $response, $status); |
| 761 | 761 | } |
| 762 | 762 | } |