@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $telepath = new \core\diag\Telepath($givenRealm); |
| 109 | 109 | $outerUser = $telepath->getOuter(); |
| 110 | 110 | } |
| 111 | - $testsuite = new \core\diag\RADIUSTests($givenRealm, $outerUser . '@' . $givenRealm); |
|
| 111 | + $testsuite = new \core\diag\RADIUSTests($givenRealm, $outerUser.'@'.$givenRealm); |
|
| 112 | 112 | |
| 113 | 113 | $naptr = $rfc7585suite->relevantNAPTR(); |
| 114 | 114 | if ($naptr != \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED && $naptr > 0) { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $json_data = json_encode($returnArray); |
| 207 | 207 | |
| 208 | 208 | if ($token) { |
| 209 | - $loggerInstance->debug(4, 'JSON data written to ' .$jsonDir.'/'.$token); |
|
| 209 | + $loggerInstance->debug(4, 'JSON data written to '.$jsonDir.'/'.$token); |
|
| 210 | 210 | file_put_contents($jsonDir.'/'.$token.'/realm', $json_data); |
| 211 | 211 | } |
| 212 | 212 | header("Content-type: application/json; utf-8"); |
@@ -158,12 +158,12 @@ |
||
| 158 | 158 | } |
| 159 | 159 | if (isset($_POST['command'])) { |
| 160 | 160 | switch ($_POST['command']) { |
| 161 | - case web\lib\common\FormElements::BUTTON_CLOSE: |
|
| 162 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier) . '#profilebox_' . $deployment->identifier; |
|
| 163 | - exit(0); |
|
| 164 | - default: |
|
| 165 | - header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier); |
|
| 166 | - exit(0); |
|
| 161 | + case web\lib\common\FormElements::BUTTON_CLOSE: |
|
| 162 | + header("Location: overview_org.php?inst_id=" . $my_inst->identifier) . '#profilebox_' . $deployment->identifier; |
|
| 163 | + exit(0); |
|
| 164 | + default: |
|
| 165 | + header("Location: overview_org.php?inst_id=" . $my_inst->identifier . '#profilebox_' . $deployment->identifier); |
|
| 166 | + exit(0); |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | $vlan = $deployment->getAttributes("managedsp:vlan")[0]['value'] ?? NULL; |
@@ -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 |
@@ -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 | - $data['serialNumberHex'], |
|
| 122 | - date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('YmdHis') |
|
| 123 | - ); |
|
| 121 | + $data['serialNumberHex'], |
|
| 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(); |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | // for now (no OpenRoaming client certs available) only run server-side tests |
| 333 | 333 | foreach ($listOfIPs as $oneIP) { |
| 334 | 334 | $connectionResult = $connectionTests->cApathCheck($oneIP); |
| 335 | - if ($connectionResult != \core\diag\AbstractTest::RETVAL_OK || ( isset($connectionTests->TLS_CA_checks_result['cert_oddity']) && count($connectionTests->TLS_CA_checks_result['cert_oddity']) > 0)) { |
|
| 335 | + if ($connectionResult != \core\diag\AbstractTest::RETVAL_OK || (isset($connectionTests->TLS_CA_checks_result['cert_oddity']) && count($connectionTests->TLS_CA_checks_result['cert_oddity']) > 0)) { |
|
| 336 | 336 | $allHostsOkay = FALSE; |
| 337 | 337 | } else { |
| 338 | 338 | $oneHostOkay = TRUE; |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | // which is different from the outer username we put into installers |
| 487 | 487 | return $this->getAttributes("internal:checkuser_value")[0]['value']."@".$realm; |
| 488 | 488 | } |
| 489 | - if (count($this->getAttributes("internal:use_anon_outer")) > 0 && $this->getAttributes("internal:anon_local_value")[0]['value'] != NULL ) { |
|
| 489 | + if (count($this->getAttributes("internal:use_anon_outer")) > 0 && $this->getAttributes("internal:anon_local_value")[0]['value'] != NULL) { |
|
| 490 | 490 | // no special check username, but there is an anon outer ID for |
| 491 | 491 | // installers - so let's use that one |
| 492 | 492 | return $this->getAttributes("internal:anon_local_value")[0]['value']."@".$realm; |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | $monthlyList = []; |
| 645 | - $monthly = $this->frontendHandle->exec("SELECT downloads_user,device_id FROM downloads_history WHERE profile_id=? AND stat_date=DATE_FORMAT(NOW(),'%Y-%m-01')", "i", $this->identifier); |
|
| 645 | + $monthly = $this->frontendHandle->exec("SELECT downloads_user,device_id FROM downloads_history WHERE profile_id=? AND stat_date=DATE_FORMAT(NOW(),'%Y-%m-01')", "i", $this->identifier); |
|
| 646 | 646 | while ($statsQuery = mysqli_fetch_object(/** @scrutinizer ignore-type */ $monthly)) { |
| 647 | 647 | $monthlyList[$statsQuery->device_id] = $statsQuery->downloads_user; |
| 648 | 648 | } |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | \core\common\Entity::intoThePotatoes(); |
| 657 | - ksort($finalarray, SORT_STRING|SORT_FLAG_CASE); |
|
| 657 | + ksort($finalarray, SORT_STRING | SORT_FLAG_CASE); |
|
| 658 | 658 | \core\common\Entity::outOfThePotatoes(); |
| 659 | 659 | return $finalarray; |
| 660 | 660 | } |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | $profileStatus = self::CERT_STATUS_NONE; |
| 965 | 965 | foreach ($rows as $row) { |
| 966 | 966 | $encodedCert = $row[0]; |
| 967 | - $tm = $x509->processCertificate(base64_decode($encodedCert))['full_details']['validTo_time_t']- time(); |
|
| 967 | + $tm = $x509->processCertificate(base64_decode($encodedCert))['full_details']['validTo_time_t'] - time(); |
|
| 968 | 968 | if ($tm < \config\ConfAssistant::CERT_WARNINGS['expiry_critical']) { |
| 969 | 969 | $certStatus = self::CERT_STATUS_ERROR; |
| 970 | 970 | } elseif ($tm < \config\ConfAssistant::CERT_WARNINGS['expiry_warning']) { |
@@ -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(); |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | echo '<br/>'; |
| 83 | 83 | echo _("In the 'Timestamp' column we show last update time."); |
| 84 | 84 | echo '<p/>'; |
| 85 | - echo _('To check eduroam database specification see') . |
|
| 86 | - ' <a target="_blank" href="https://monitor.eduroam.org/eduroam-database/v2/docs/eduroam-database-ver30112021.pdf">' . |
|
| 87 | - _('this document') . '</a>.<p/>'; |
|
| 85 | + echo _('To check eduroam database specification see'). |
|
| 86 | + ' <a target="_blank" href="https://monitor.eduroam.org/eduroam-database/v2/docs/eduroam-database-ver30112021.pdf">'. |
|
| 87 | + _('this document').'</a>.<p/>'; |
|
| 88 | 88 | echo _('If you cannot find your institution on this list it means that this institiution is not present in your upstream data.'); |
| 89 | 89 | echo '<p/>'; |
| 90 | 90 | $allAuthorizedFeds = $user->getAttributes("user:fedadmin"); |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | ?> |
| 94 | 94 | |
| 95 | 95 | <select name="INST-list" id="INST-list"> |
| 96 | - <option value=""><?php echo _('---PLEASE CHOOSE---');?></option> |
|
| 96 | + <option value=""><?php echo _('---PLEASE CHOOSE---'); ?></option> |
|
| 97 | 97 | <?php |
| 98 | 98 | $instdata = array(); |
| 99 | 99 | foreach ($extInsts as $iid => $oneInst) { |
| 100 | - print '<option value="' . $iid . '">' . $oneInst['name'] . '</option>'; |
|
| 100 | + print '<option value="'.$iid.'">'.$oneInst['name'].'</option>'; |
|
| 101 | 101 | $instdata[$iid] = array(); |
| 102 | 102 | $instdata[$iid]['name'] = $oneInst['name']; |
| 103 | 103 | $instdata[$iid]['type'] = _('no data'); |
@@ -111,22 +111,22 @@ discard block |
||
| 111 | 111 | $contactdata = ''; |
| 112 | 112 | foreach ($oneInst['contacts'] as $oneContact) { |
| 113 | 113 | if ($contactdata != '') { |
| 114 | - $contactdata = $contactdata . '<br>'; |
|
| 114 | + $contactdata = $contactdata.'<br>'; |
|
| 115 | 115 | } |
| 116 | 116 | if ($oneContact['name']) { |
| 117 | - $contactdata = $contactdata . $oneContact['name']; |
|
| 117 | + $contactdata = $contactdata.$oneContact['name']; |
|
| 118 | 118 | } |
| 119 | 119 | if ($contactdata != '') { |
| 120 | - $contactdata = $contactdata . '<br>'; |
|
| 120 | + $contactdata = $contactdata.'<br>'; |
|
| 121 | 121 | } |
| 122 | 122 | if ($oneContact['mail']) { |
| 123 | - $contactdata = $contactdata . $oneContact['mail']; |
|
| 123 | + $contactdata = $contactdata.$oneContact['mail']; |
|
| 124 | 124 | } |
| 125 | 125 | if ($contactdata != '') { |
| 126 | - $contactdata = $contactdata . '<br>'; |
|
| 126 | + $contactdata = $contactdata.'<br>'; |
|
| 127 | 127 | } |
| 128 | 128 | if ($oneContact['phone']) { |
| 129 | - $contactdata = $contactdata . $oneContact['phone']; |
|
| 129 | + $contactdata = $contactdata.$oneContact['phone']; |
|
| 130 | 130 | } |
| 131 | 131 | } |
| 132 | 132 | if ($contactdata == '') { |
@@ -145,11 +145,11 @@ discard block |
||
| 145 | 145 | var instts = []; |
| 146 | 146 | <?php |
| 147 | 147 | foreach (array_keys($instdata) as $iid) { |
| 148 | - echo "instservers['" . $iid . "']='" . $instdata[$iid]['servers']. "';\n"; |
|
| 149 | - echo "instname['" . $iid . "']='" . $instdata[$iid]['name']. "';\n"; |
|
| 150 | - echo "insttype['" . $iid . "']='" . $instdata[$iid]['type']. "';\n"; |
|
| 151 | - echo "instcontact['" . $iid . "']='" . $instdata[$iid]['contacts']. "';\n"; |
|
| 152 | - echo "instts['" . $iid . "']='" . $instdata[$iid]['ts']. "';\n"; |
|
| 148 | + echo "instservers['".$iid."']='".$instdata[$iid]['servers']."';\n"; |
|
| 149 | + echo "instname['".$iid."']='".$instdata[$iid]['name']."';\n"; |
|
| 150 | + echo "insttype['".$iid."']='".$instdata[$iid]['type']."';\n"; |
|
| 151 | + echo "instcontact['".$iid."']='".$instdata[$iid]['contacts']."';\n"; |
|
| 152 | + echo "instts['".$iid."']='".$instdata[$iid]['ts']."';\n"; |
|
| 153 | 153 | } |
| 154 | 154 | ?> |
| 155 | 155 | $(document).ready(function(){ |
@@ -171,18 +171,18 @@ discard block |
||
| 171 | 171 | <div id="instdata_area"> |
| 172 | 172 | <table> |
| 173 | 173 | <tr><th align="left" width="350"> |
| 174 | - <?php echo _('Name');?> |
|
| 174 | + <?php echo _('Name'); ?> |
|
| 175 | 175 | </th><th align="left" width="100"> |
| 176 | - <?php echo _('Type');?> |
|
| 176 | + <?php echo _('Type'); ?> |
|
| 177 | 177 | </th> |
| 178 | 178 | <th align="left" width="200"> |
| 179 | - <?php echo _('Servers');?> |
|
| 179 | + <?php echo _('Servers'); ?> |
|
| 180 | 180 | </th> |
| 181 | 181 | <th align="left" width="200"> |
| 182 | - <?php echo _('Contact data');?> |
|
| 182 | + <?php echo _('Contact data'); ?> |
|
| 183 | 183 | </th> |
| 184 | 184 | <th align="left" width="100"> |
| 185 | - <?php echo _('Timestamp');?> |
|
| 185 | + <?php echo _('Timestamp'); ?> |
|
| 186 | 186 | </th> |
| 187 | 187 | </tr> |
| 188 | 188 | <tr id="toshow"></tr> |
@@ -348,19 +348,19 @@ discard block |
||
| 348 | 348 | ); |
| 349 | 349 | // Generate a new private (and public) key pair |
| 350 | 350 | $privkey = openssl_pkey_new(array( |
| 351 | - "private_key_bits" => 4096, |
|
| 352 | - "private_key_type" => OPENSSL_KEYTYPE_RSA)); |
|
| 351 | + "private_key_bits" => 4096, |
|
| 352 | + "private_key_type" => OPENSSL_KEYTYPE_RSA)); |
|
| 353 | 353 | // export private key to $clientprivateKey (as string) |
| 354 | 354 | openssl_pkey_export($privkey, $this->radsec_priv); |
| 355 | 355 | // Generate a certificate signing request |
| 356 | 356 | $csr = openssl_csr_new($dn, $privkey, |
| 357 | - array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf")); |
|
| 357 | + array('digest_alg' => 'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf")); |
|
| 358 | 358 | // get CA certificate and private key |
| 359 | 359 | $caprivkey = array(file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.key"), |
| 360 | 360 | \config\Master::MANAGEDSP['capass']); |
| 361 | 361 | $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
| 362 | 362 | $clientcert = openssl_csr_sign($csr, $cacert, $caprivkey, \config\Master::MANAGEDSP['daystoexpiry'], |
| 363 | - array('digest_alg'=>'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), rand()); |
|
| 363 | + array('digest_alg'=>'sha256', 'config' => ROOT . "/config/ManagedSPCerts/openssl.cnf"), rand()); |
|
| 364 | 364 | openssl_x509_export($clientcert, $this->radsec_cert); |
| 365 | 365 | } |
| 366 | 366 | /** |
@@ -479,9 +479,9 @@ discard block |
||
| 479 | 479 | */ |
| 480 | 480 | public function renewtls() |
| 481 | 481 | { |
| 482 | - $id = $this->identifier; |
|
| 483 | - $futureTlsClient = $this->createTLScredentials(); |
|
| 484 | - $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = ?, radsec_cert = ? WHERE deployment_id = ?", "ssi", $this->radsec_priv, $this->radsec_cert, $id); |
|
| 482 | + $id = $this->identifier; |
|
| 483 | + $futureTlsClient = $this->createTLScredentials(); |
|
| 484 | + $this->databaseHandle->exec("UPDATE deployment SET radsec_priv = ?, radsec_cert = ? WHERE deployment_id = ?", "ssi", $this->radsec_priv, $this->radsec_cert, $id); |
|
| 485 | 485 | } |
| 486 | 486 | /** |
| 487 | 487 | * marks the deployment as deactivated |
@@ -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 | } |
@@ -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> |
@@ -652,9 +652,9 @@ discard block |
||
| 652 | 652 | foreach (array($dsp->host1_v4, $dsp->host2_v4) as $host) { |
| 653 | 653 | $connection = @fsockopen($host, \config\Master::MANAGEDSP['radiusconfigport']); |
| 654 | 654 | if (is_resource($connection)) { |
| 655 | - fclose($connection); |
|
| 655 | + fclose($connection); |
|
| 656 | 656 | } else { |
| 657 | - return false; |
|
| 657 | + return false; |
|
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | 660 | return true; |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | </button> |
| 888 | 888 | <span style='color: red;'> |
| 889 | 889 | <?php if ($hasMail == 0) { |
| 890 | - echo _("Helpdesk mail address is required but missing!"); |
|
| 890 | + echo _("Helpdesk mail address is required but missing!"); |
|
| 891 | 891 | } |
| 892 | 892 | ?> |
| 893 | 893 | </span> |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | ?> |
| 30 | 30 | <?php |
| 31 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 31 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 32 | 32 | |
| 33 | 33 | function displaySilverbulletPropertyWidget(&$theProfile, $readonly, &$uiElements) { |
| 34 | 34 | ?> |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | <ul style='margin:1px'> |
| 46 | 46 | <?php |
| 47 | 47 | foreach ($completeness as $missing_attrib) { |
| 48 | - echo "<li>" . $uiElements->displayName($missing_attrib) . "</li>"; |
|
| 48 | + echo "<li>".$uiElements->displayName($missing_attrib)."</li>"; |
|
| 49 | 49 | } |
| 50 | 50 | ?> |
| 51 | 51 | </ul> |
| 52 | 52 | </div> |
| 53 | 53 | <?php |
| 54 | 54 | } else { |
| 55 | - 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 | + 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); |
|
| 56 | 56 | } |
| 57 | 57 | ?> |
| 58 | 58 | <br/> |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | if ($readonly === FALSE) { |
| 62 | 62 | ?> |
| 63 | 63 | <form action='edit_silverbullet.php?inst_id=<?php echo $theProfile->institution; ?>&profile_id=<?php echo $theProfile->identifier; ?>' method='POST'> |
| 64 | - <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
| 64 | + <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
| 65 | 65 | </form> |
| 66 | 66 | <?php |
| 67 | 67 | } |
@@ -97,21 +97,21 @@ discard block |
||
| 97 | 97 | $has_overrides = TRUE; |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | - $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>" . _("<strong>EAP Types</strong> (in order of preference):") . "<br/>"; |
|
| 100 | + $buffer_eaptypediv = "<div style='margin-bottom:40px; float:left;'>"._("<strong>EAP Types</strong> (in order of preference):")."<br/>"; |
|
| 101 | 101 | $typelist = $theProfile->getEapMethodsinOrderOfPreference(); |
| 102 | 102 | $allcomplete = TRUE; |
| 103 | 103 | foreach ($typelist as $eaptype) { |
| 104 | 104 | $buffer_eaptypediv .= $eaptype->getPrintableRep(); |
| 105 | 105 | $completeness = $theProfile->isEapTypeDefinitionComplete($eaptype); |
| 106 | 106 | if ($completeness === true) { |
| 107 | - $buffer_eaptypediv .= " <div class='acceptable'>" . _("OK") . "</div>"; |
|
| 107 | + $buffer_eaptypediv .= " <div class='acceptable'>"._("OK")."</div>"; |
|
| 108 | 108 | } else { |
| 109 | 109 | $buffer_eaptypediv .= " <div class='notacceptable'>"; |
| 110 | 110 | $buffer_eaptypediv .= _("Information needed!"); |
| 111 | 111 | if (is_array($completeness)) { |
| 112 | 112 | $buffer_eaptypediv .= "<ul style='margin:1px'>"; |
| 113 | 113 | foreach ($completeness as $missing_attrib) { |
| 114 | - $buffer_eaptypediv .= "<li>" . $uiElements->displayName($missing_attrib) . "</li>"; |
|
| 114 | + $buffer_eaptypediv .= "<li>".$uiElements->displayName($missing_attrib)."</li>"; |
|
| 115 | 115 | } |
| 116 | 116 | $buffer_eaptypediv .= "</ul>"; |
| 117 | 117 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | foreach ($attribs as $attrib) { |
| 124 | 124 | if ($attrib['level'] == \core\Options::LEVEL_METHOD && !preg_match("/^internal:/", $attrib['name']) && !$justOnce) { |
| 125 | 125 | $justOnce = TRUE; |
| 126 | - $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 | + $buffer_eaptypediv .= "<img src='../resources/images/icons/Tabler/square-rounded-letter-e-blue.svg' alt='"._("Options on EAP Method/Device level are in effect.")."'>"; |
|
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | $buffer_eaptypediv .= "<br/>"; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | if ($theProfile->isRedirected()) { |
| 150 | 150 | $iconData = $uiElements->iconData('PROFILES_REDIRECTED'); |
| 151 | 151 | $iconData['text'] = _("Profile redirected"); |
| 152 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 152 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 153 | 153 | |
| 154 | 154 | } |
| 155 | 155 | |
@@ -157,15 +157,15 @@ discard block |
||
| 157 | 157 | switch ($certStatus) { |
| 158 | 158 | case core\AbstractProfile::CERT_STATUS_OK: |
| 159 | 159 | $iconData = $uiElements->iconData('CERT_STATUS_OK'); |
| 160 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 160 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 161 | 161 | break; |
| 162 | 162 | case core\AbstractProfile::CERT_STATUS_WARN: |
| 163 | 163 | $iconData = $uiElements->iconData('CERT_STATUS_WARN'); |
| 164 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 164 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 165 | 165 | break; |
| 166 | 166 | case core\AbstractProfile::CERT_STATUS_ERROR: |
| 167 | 167 | $iconData = $uiElements->iconData('CERT_STATUS_ERROR'); |
| 168 | - $buffer_headline .= "<br/>" . $uiElements->catIcon(($iconData)); |
|
| 168 | + $buffer_headline .= "<br/>".$uiElements->catIcon(($iconData)); |
|
| 169 | 169 | break; |
| 170 | 170 | } |
| 171 | 171 | $buffer_headline .= "</div>"; |
@@ -191,11 +191,11 @@ discard block |
||
| 191 | 191 | if (\config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == "LOCAL") { |
| 192 | 192 | $diagUrl = "../diag/"; |
| 193 | 193 | } else { |
| 194 | - $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] . "/diag/"; |
|
| 194 | + $diagUrl = \config\Master::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS']."/diag/"; |
|
| 195 | 195 | } |
| 196 | 196 | ?> |
| 197 | - <form action='<?php echo $diagUrl . "action_realmcheck.php?inst_id=" . $theProfile->institution . "&profile_id=" . $theProfile->identifier ?>' method='post' accept-charset='UTF-8'> |
|
| 198 | - <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link . $_SERVER['SCRIPT_NAME']); ?>'/> |
|
| 197 | + <form action='<?php echo $diagUrl."action_realmcheck.php?inst_id=".$theProfile->institution."&profile_id=".$theProfile->identifier ?>' method='post' accept-charset='UTF-8'> |
|
| 198 | + <input type='hidden' name='comefrom' value='<?php echo htmlspecialchars($link.$_SERVER['SCRIPT_NAME']); ?>'/> |
|
| 199 | 199 | <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!"); ?>'> |
| 200 | 200 | <?php echo _("Check realm reachability"); ?> |
| 201 | 201 | </button> |
@@ -242,9 +242,9 @@ discard block |
||
| 242 | 242 | ?> |
| 243 | 243 | <div style='display: flex;'> |
| 244 | 244 | <?php |
| 245 | - $idpLevelUrl = $link . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $theProfile->institution; |
|
| 246 | - $displayurl = $idpLevelUrl . "&profile=" . $theProfile->identifier; |
|
| 247 | - $QRurl = $idpLevelUrl . "&profile=" . $theProfile->identifier; |
|
| 245 | + $idpLevelUrl = $link.dirname(dirname($_SERVER['SCRIPT_NAME']))."?idp=".$theProfile->institution; |
|
| 246 | + $displayurl = $idpLevelUrl."&profile=".$theProfile->identifier; |
|
| 247 | + $QRurl = $idpLevelUrl."&profile=".$theProfile->identifier; |
|
| 248 | 248 | $qrCode = new \chillerlan\QRCode\QRCode(new \chillerlan\QRCode\QROptions([ |
| 249 | 249 | 'outputType' => \chillerlan\QRCode\QRCode::OUTPUT_IMAGE_PNG, |
| 250 | 250 | 'eccLevel' => \chillerlan\QRCode\QRCode::ECC_H, |
@@ -256,9 +256,9 @@ discard block |
||
| 256 | 256 | if (empty($rawQr)) { |
| 257 | 257 | throw new Exception("Something went seriously wrong during QR code generation!"); |
| 258 | 258 | } |
| 259 | - $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL)); |
|
| 259 | + $uri = "data:image/png;base64,".base64_encode($uiElements->pngInjectConsortiumLogo($rawQr, web\lib\admin\UIElements::QRCODE_PIXELS_PER_SYMBOL)); |
|
| 260 | 260 | $size = getimagesize($uri); |
| 261 | - echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>"; |
|
| 261 | + echo "<img width='".($size[0] / 4)."' height='".($size[1] / 4)."' src='$uri' alt='QR-code'/>"; |
|
| 262 | 262 | |
| 263 | 263 | //echo "<nobr>$displayurl</nobr></a>"; |
| 264 | 264 | echo "<p>$displayurl</p></a>"; |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $radius_status = array(); |
| 288 | 288 | $radius_status[0] = $deploymentObject->radius_status_1; |
| 289 | 289 | $radius_status[1] = $deploymentObject->radius_status_2; |
| 290 | - $cacert = file_get_contents(ROOT . "/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 290 | + $cacert = file_get_contents(ROOT."/config/ManagedSPCerts/eduroamSP-CA.pem"); |
|
| 291 | 291 | $retry = $deploymentObject->checkRADIUSHostandConfigDaemon(); |
| 292 | 292 | $isradiusready = radius_ready($deploymentObject); |
| 293 | 293 | if (is_array($retry)) { |
@@ -299,11 +299,11 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | ?> |
| 301 | 301 | <div style='display: table-row_id;'> |
| 302 | - <div class='profilebox' id="profilebox_<?php echo $deploymentObject->identifier;?>" style='display: table-cell;'> |
|
| 302 | + <div class='profilebox' id="profilebox_<?php echo $deploymentObject->identifier; ?>" style='display: table-cell;'> |
|
| 303 | 303 | <h2><?php |
| 304 | 304 | switch ($deploymentObject->consortium) { |
| 305 | 305 | case "eduroam": |
| 306 | - $displayname = config\ConfAssistant::CONSORTIUM['name'] . " " . core\DeploymentManaged::PRODUCTNAME; |
|
| 306 | + $displayname = config\ConfAssistant::CONSORTIUM['name']." ".core\DeploymentManaged::PRODUCTNAME; |
|
| 307 | 307 | break; |
| 308 | 308 | case "OpenRoaming": |
| 309 | 309 | $displayname = "OpenRoaming ANP"; |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | default: |
| 312 | 312 | throw new Exception("We are supposed to operate on a roaming consortium we don't know."); |
| 313 | 313 | } |
| 314 | - echo $displayname . " (<span style='color:" . ( $deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>" . _("inactive") : "green;'>" . _("active") ) . "</span>)"; |
|
| 314 | + echo $displayname." (<span style='color:".($deploymentObject->status == \core\AbstractDeployment::INACTIVE ? "red;'>"._("inactive") : "green;'>"._("active"))."</span>)"; |
|
| 315 | 315 | ?></h2> |
| 316 | 316 | <table> |
| 317 | 317 | <caption><?php echo _("Deployment Details"); ?></caption> |
@@ -329,13 +329,13 @@ discard block |
||
| 329 | 329 | <td> |
| 330 | 330 | <?php |
| 331 | 331 | if ($deploymentObject->host1_v4 !== NULL) { |
| 332 | - echo _("IPv4") . ": " . $deploymentObject->host1_v4; |
|
| 332 | + echo _("IPv4").": ".$deploymentObject->host1_v4; |
|
| 333 | 333 | } |
| 334 | 334 | if ($deploymentObject->host1_v4 !== NULL && $deploymentObject->host1_v6 !== NULL) { |
| 335 | 335 | echo "<br/>"; |
| 336 | 336 | } |
| 337 | 337 | if ($deploymentObject->host1_v6 !== NULL) { |
| 338 | - echo _("IPv6") . ": " . $deploymentObject->host1_v6; |
|
| 338 | + echo _("IPv6").": ".$deploymentObject->host1_v6; |
|
| 339 | 339 | } |
| 340 | 340 | ?> |
| 341 | 341 | </td> |
@@ -351,9 +351,9 @@ discard block |
||
| 351 | 351 | <td> |
| 352 | 352 | <?php |
| 353 | 353 | if ($deploymentObject->status) { |
| 354 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_1]['icon'] . |
|
| 355 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . |
|
| 356 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_1]['text'] . "' class='cat-icon'>"; |
|
| 354 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_1]['icon']. |
|
| 355 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_1]['text']. |
|
| 356 | + "' title='".$radiusMessages[$deploymentObject->radius_status_1]['text']."' class='cat-icon'>"; |
|
| 357 | 357 | } |
| 358 | 358 | ?> |
| 359 | 359 | </td> |
@@ -365,13 +365,13 @@ discard block |
||
| 365 | 365 | <td> |
| 366 | 366 | <?php |
| 367 | 367 | if ($deploymentObject->host2_v4 !== NULL) { |
| 368 | - echo _("IPv4") . ": " . $deploymentObject->host2_v4; |
|
| 368 | + echo _("IPv4").": ".$deploymentObject->host2_v4; |
|
| 369 | 369 | } |
| 370 | 370 | if ($deploymentObject->host2_v4 !== NULL && $deploymentObject->host2_v6 !== NULL) { |
| 371 | 371 | echo "<br/>"; |
| 372 | 372 | } |
| 373 | 373 | if ($deploymentObject->host2_v6 !== NULL) { |
| 374 | - echo _("IPv6") . ": " . $deploymentObject->host2_v6; |
|
| 374 | + echo _("IPv6").": ".$deploymentObject->host2_v6; |
|
| 375 | 375 | } |
| 376 | 376 | ?> |
| 377 | 377 | </td> |
@@ -387,9 +387,9 @@ discard block |
||
| 387 | 387 | <td> |
| 388 | 388 | <?php |
| 389 | 389 | if ($deploymentObject->status) { |
| 390 | - echo "<img src='" . $radiusMessages[$deploymentObject->radius_status_2]['icon'] . |
|
| 391 | - "' alt='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . |
|
| 392 | - "' title='" . $radiusMessages[$deploymentObject->radius_status_2]['text'] . "' class='cat-icon'>"; |
|
| 390 | + echo "<img src='".$radiusMessages[$deploymentObject->radius_status_2]['icon']. |
|
| 391 | + "' alt='".$radiusMessages[$deploymentObject->radius_status_2]['text']. |
|
| 392 | + "' title='".$radiusMessages[$deploymentObject->radius_status_2]['text']."' class='cat-icon'>"; |
|
| 393 | 393 | } |
| 394 | 394 | ?> |
| 395 | 395 | </td> |
@@ -415,34 +415,34 @@ discard block |
||
| 415 | 415 | <tr> |
| 416 | 416 | <td><strong><?php echo _("RADSEC over TLS credentials"); ?></strong></td> |
| 417 | 417 | <td> |
| 418 | - <input type="hidden" id="priv_key_data_<?php echo $deploymentObject->identifier;?>" value="<?php echo $deploymentObject->radsec_priv;?>"> |
|
| 419 | - <input type="hidden" id="cert_data_<?php echo $deploymentObject->identifier;?>" value="<?php echo $deploymentObject->radsec_cert;?>"> |
|
| 420 | - <input type="hidden" id="ca_cert_data" value="<?php echo $cacert;?>"> |
|
| 421 | - <button class="sp_priv_key" id="priv_key_<?php echo $deploymentObject->identifier;?>" name="showc" type="submit"><?php echo _('private key');?></button> |
|
| 422 | - <button class="sp_cert" id="cert_<?php echo $deploymentObject->identifier;?>" name="showp" type="submit"><?php echo _('certificate');?></button> |
|
| 423 | - <button class="ca_cert" name="showca" type="submit"><?php echo _('CA certificate');?></button> |
|
| 424 | - <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> |
|
| 418 | + <input type="hidden" id="priv_key_data_<?php echo $deploymentObject->identifier; ?>" value="<?php echo $deploymentObject->radsec_priv; ?>"> |
|
| 419 | + <input type="hidden" id="cert_data_<?php echo $deploymentObject->identifier; ?>" value="<?php echo $deploymentObject->radsec_cert; ?>"> |
|
| 420 | + <input type="hidden" id="ca_cert_data" value="<?php echo $cacert; ?>"> |
|
| 421 | + <button class="sp_priv_key" id="priv_key_<?php echo $deploymentObject->identifier; ?>" name="showc" type="submit"><?php echo _('private key'); ?></button> |
|
| 422 | + <button class="sp_cert" id="cert_<?php echo $deploymentObject->identifier; ?>" name="showp" type="submit"><?php echo _('certificate'); ?></button> |
|
| 423 | + <button class="ca_cert" name="showca" type="submit"><?php echo _('CA certificate'); ?></button> |
|
| 424 | + <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> |
|
| 425 | 425 | </td> |
| 426 | 426 | </tr> |
| 427 | 427 | <tr> <td></td><td> |
| 428 | 428 | <?php |
| 429 | - echo _('Serial number:') . ' ' . $data['serialNumberHex'] . '<br>'; |
|
| 430 | - $dleft = floor(($data['validTo_time_t']-time())/(24*60*60)); |
|
| 429 | + echo _('Serial number:').' '.$data['serialNumberHex'].'<br>'; |
|
| 430 | + $dleft = floor(($data['validTo_time_t'] - time()) / (24 * 60 * 60)); |
|
| 431 | 431 | if ($dleft < 30) { |
| 432 | 432 | echo '<font color="red">'; |
| 433 | 433 | } |
| 434 | - echo _('Not valid after:') . ' '. date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s') . ' UTC'; |
|
| 434 | + echo _('Not valid after:').' '.date_create_from_format('ymdGis', substr($data['validTo'], 0, -1))->format('Y-m-d H:i:s').' UTC'; |
|
| 435 | 435 | if ($dleft > 2) { |
| 436 | - echo '<br>' . _('Number of days to expiry:') . ' ' . $dleft; |
|
| 436 | + echo '<br>'._('Number of days to expiry:').' '.$dleft; |
|
| 437 | 437 | } else { |
| 438 | - echo '<br>' . _('If you are using RADSEC over TLS you should urgently renew your credentisls') . '!'; |
|
| 438 | + echo '<br>'._('If you are using RADSEC over TLS you should urgently renew your credentisls').'!'; |
|
| 439 | 439 | } |
| 440 | 440 | if ($dleft < 30) { echo '</font>'; } |
| 441 | 441 | ?></td></tr> |
| 442 | 442 | <tr> <td></td><td> |
| 443 | 443 | <?php |
| 444 | 444 | if ($deploymentObject->radsec_cert != NULL) { |
| 445 | - echo _('If your certificate is close to expiry or you need to create new RADSEC over TLS credentials') . '<br>' . |
|
| 445 | + echo _('If your certificate is close to expiry or you need to create new RADSEC over TLS credentials').'<br>'. |
|
| 446 | 446 | _('click on "Renew RADSEC over TLS credentials" button'); |
| 447 | 447 | } |
| 448 | 448 | ?> |
@@ -454,14 +454,14 @@ discard block |
||
| 454 | 454 | <tr> |
| 455 | 455 | <td><strong><?php echo _("RADSEC TLS-PSK identity"); ?></strong></td> |
| 456 | 456 | <td> |
| 457 | - SP_<?php echo $deploymentObject->identifier . '-' . $deploymentObject->institution;?> |
|
| 457 | + SP_<?php echo $deploymentObject->identifier.'-'.$deploymentObject->institution; ?> |
|
| 458 | 458 | </td> |
| 459 | 459 | </tr> |
| 460 | 460 | |
| 461 | 461 | <tr> |
| 462 | 462 | <td><strong><?php echo _("RADSEC TLS-PSK key"); ?></strong></td> |
| 463 | 463 | <td> |
| 464 | - <?php echo $deploymentObject->pskkey;?> |
|
| 464 | + <?php echo $deploymentObject->pskkey; ?> |
|
| 465 | 465 | </td> |
| 466 | 466 | </tr> |
| 467 | 467 | <?php } ?> |
@@ -515,12 +515,12 @@ discard block |
||
| 515 | 515 | if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) { |
| 516 | 516 | echo '<br>'; |
| 517 | 517 | if ($res['FAILURE'] == 2) { |
| 518 | - echo ' <span style="color: red;">' . _("Activation failure.") . '</span>'; |
|
| 518 | + echo ' <span style="color: red;">'._("Activation failure.").'</span>'; |
|
| 519 | 519 | } else { |
| 520 | 520 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
| 521 | - echo ' <span style="color: red;">' . _("Activation failure for your primary RADIUS server.") . '</span>'; |
|
| 521 | + echo ' <span style="color: red;">'._("Activation failure for your primary RADIUS server.").'</span>'; |
|
| 522 | 522 | } else { |
| 523 | - echo ' <span style="color: red;">' . _("Activation failure for your backup RADIUS server.") . '</span>'; |
|
| 523 | + echo ' <span style="color: red;">'._("Activation failure for your backup RADIUS server.").'</span>'; |
|
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | } |
@@ -547,12 +547,12 @@ discard block |
||
| 547 | 547 | if (array_key_exists('FAILURE', $res) && $res['FAILURE'] > 0) { |
| 548 | 548 | echo '<br>'; |
| 549 | 549 | if ($res['FAILURE'] == 2) { |
| 550 | - echo ' <span style="color: red;">' . _("Failure during deactivation, your request is queued for handling") . '</span>'; |
|
| 550 | + echo ' <span style="color: red;">'._("Failure during deactivation, your request is queued for handling").'</span>'; |
|
| 551 | 551 | } else { |
| 552 | 552 | if (isset($_GET['res'][1]) && $_GET['res']['1'] == 'FAILURE') { |
| 553 | - echo ' <span style="color: red;">' . _("Deactivation failure for your primary RADIUS server, your request is queued.") . '</span>'; |
|
| 553 | + echo ' <span style="color: red;">'._("Deactivation failure for your primary RADIUS server, your request is queued.").'</span>'; |
|
| 554 | 554 | } else { |
| 555 | - echo ' <span style="color: red;">' . _("Deactivation failure for your backup RADIUS server, your request is queued.") . '</span>'; |
|
| 555 | + echo ' <span style="color: red;">'._("Deactivation failure for your backup RADIUS server, your request is queued.").'</span>'; |
|
| 556 | 556 | } |
| 557 | 557 | } |
| 558 | 558 | } |
@@ -575,29 +575,29 @@ discard block |
||
| 575 | 575 | </form> |
| 576 | 576 | </div> |
| 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>" |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | } |
| 818 | 818 | ?> |
| 819 | 819 | </h2> |
| 820 | - <?php if(count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?> |
|
| 820 | + <?php if (count($profiles_for_this_idp) > 1 && $readonly === FALSE && $editMode === 'fullaccess') { ?> |
|
| 821 | 821 | <form method='post' action='sort_profiles.php?inst_id=<?php echo $my_inst->identifier; ?>' accept-charset='UTF-8'> |
| 822 | 822 | <div> |
| 823 | 823 | <button type='submit' name='profile_sorting'> |
@@ -891,7 +891,7 @@ discard block |
||
| 891 | 891 | <div> |
| 892 | 892 | <input type="hidden" name="consortium" value="eduroam"/> |
| 893 | 893 | <button type='submit' <?php echo ($hasMail > 0 ? "" : "disabled"); ?> name='profile_action' value='new'> |
| 894 | - <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name'] . " " . \core\DeploymentManaged::PRODUCTNAME); ?> |
|
| 894 | + <?php echo sprintf(_("Add %s deployment ..."), \config\ConfAssistant::CONSORTIUM['name']." ".\core\DeploymentManaged::PRODUCTNAME); ?> |
|
| 895 | 895 | </button> |
| 896 | 896 | <span style='color: red;'> |
| 897 | 897 | <?php if ($hasMail == 0) { |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | public function __construct() |
| 36 | 36 | { |
| 37 | 37 | |
| 38 | - if ( \config\ConfAssistant::eduPKI['testing'] === true ) { |
|
| 39 | - $this->locationRaCert = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
| 40 | - $this->locationRaKey = ROOT . "/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
| 41 | - $this->locationWebRoot = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
| 38 | + if (\config\ConfAssistant::eduPKI['testing'] === true) { |
|
| 39 | + $this->locationRaCert = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.pem"; |
|
| 40 | + $this->locationRaKey = ROOT."/config/SilverbulletClientCerts/edupki-test-ra.clearkey"; |
|
| 41 | + $this->locationWebRoot = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
| 42 | 42 | $this->eduPkiRaId = 700; |
| 43 | 43 | $this->eduPkiCertProfileBoth = "Radius Server SOAP"; |
| 44 | 44 | $this->eduPkiCertProfileIdp = "Radius Server SOAP"; |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | $this->eduPkiEndpointPublic = "https://pki.edupki.org/edupki-test-ca/cgi-bin/pub/soap?wsdl=1"; |
| 48 | 48 | $this->eduPkiEndpointRa = "https://ra.edupki.org/edupki-test-ca/cgi-bin/ra/soap?wsdl=1"; |
| 49 | 49 | } else { |
| 50 | - $this->locationRaCert = ROOT . "/config/SilverbulletClientCerts/edupki-prod-ra.pem"; |
|
| 51 | - $this->locationRaKey = ROOT . "/config/SilverbulletClientCerts/edupki-prod-ra.clearkey"; |
|
| 52 | - $this->locationWebRoot = ROOT . "/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
| 50 | + $this->locationRaCert = ROOT."/config/SilverbulletClientCerts/edupki-prod-ra.pem"; |
|
| 51 | + $this->locationRaKey = ROOT."/config/SilverbulletClientCerts/edupki-prod-ra.clearkey"; |
|
| 52 | + $this->locationWebRoot = ROOT."/config/SilverbulletClientCerts/eduPKI-webserver-root.pem"; |
|
| 53 | 53 | $this->eduPkiRaId = 100; |
| 54 | 54 | $this->eduPkiCertProfileBoth = "eduroam IdP and SP"; |
| 55 | 55 | $this->eduPkiCertProfileIdp = "eduroam IdP"; |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | parent::__construct(); |
| 64 | 64 | |
| 65 | 65 | if (stat($this->locationRaCert) === FALSE) { |
| 66 | - throw new Exception("RA operator PEM file not found: " . $this->locationRaCert); |
|
| 66 | + throw new Exception("RA operator PEM file not found: ".$this->locationRaCert); |
|
| 67 | 67 | } |
| 68 | 68 | if (stat($this->locationRaKey) === FALSE) { |
| 69 | - throw new Exception("RA operator private key file not found: " . $this->locationRaKey); |
|
| 69 | + throw new Exception("RA operator private key file not found: ".$this->locationRaKey); |
|
| 70 | 70 | } |
| 71 | 71 | if (stat($this->locationWebRoot) === FALSE) { |
| 72 | - throw new Exception("CA website root CA file not found: " . $this->locationWebRoot); |
|
| 72 | + throw new Exception("CA website root CA file not found: ".$this->locationWebRoot); |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
@@ -136,26 +136,26 @@ discard block |
||
| 136 | 136 | throw new Exception("Unexpected policies requested."); |
| 137 | 137 | } |
| 138 | 138 | $altArray = [# Array mit den Subject Alternative Names |
| 139 | - "email:" . $csr["USERMAIL"] |
|
| 139 | + "email:".$csr["USERMAIL"] |
|
| 140 | 140 | ]; |
| 141 | 141 | foreach ($csr["ALTNAMES"] as $oneAltName) { |
| 142 | 142 | if (!empty($oneAltName) && preg_match('/(?=^.{1,254}$)(^(?:(?!\d|-)[a-z0-9\-]{1,63}(?<!-)\.)+(?:[a-z]{2,})$)/i', $oneAltName) > 0) { |
| 143 | - $altArray[] = "DNS:" . $oneAltName; |
|
| 143 | + $altArray[] = "DNS:".$oneAltName; |
|
| 144 | 144 | } else { |
| 145 | - $altArray[] = "IP:" . $oneAltName; |
|
| 145 | + $altArray[] = "IP:".$oneAltName; |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | $soapPub = $this->initEduPKISoapSession("PUBLIC"); |
| 149 | 149 | $this->loggerInstance->debug(5, "FIRST ACTUAL SOAP REQUEST (Public, newRequest)!\n"); |
| 150 | - $this->loggerInstance->debug(5, "PARAM_1: " . $this->eduPkiRaId . "\n"); |
|
| 151 | - $this->loggerInstance->debug(5, "PARAM_2: " . $csr["CSR_STRING"] . "\n"); |
|
| 150 | + $this->loggerInstance->debug(5, "PARAM_1: ".$this->eduPkiRaId."\n"); |
|
| 151 | + $this->loggerInstance->debug(5, "PARAM_2: ".$csr["CSR_STRING"]."\n"); |
|
| 152 | 152 | $this->loggerInstance->debug(5, "PARAM_3: "); |
| 153 | 153 | $this->loggerInstance->debug(5, $altArray); |
| 154 | - $this->loggerInstance->debug(5, "PARAM_4: " . $profile . "\n"); |
|
| 155 | - $this->loggerInstance->debug(5, "PARAM_5: " . sha1("notused") . "\n"); |
|
| 156 | - $this->loggerInstance->debug(5, "PARAM_6: " . $csr["USERNAME"] . "\n"); |
|
| 157 | - $this->loggerInstance->debug(5, "PARAM_7: " . $csr["USERMAIL"] . "\n"); |
|
| 158 | - $this->loggerInstance->debug(5, "PARAM_8: " . ProfileSilverbullet::PRODUCTNAME . "\n"); |
|
| 154 | + $this->loggerInstance->debug(5, "PARAM_4: ".$profile."\n"); |
|
| 155 | + $this->loggerInstance->debug(5, "PARAM_5: ".sha1("notused")."\n"); |
|
| 156 | + $this->loggerInstance->debug(5, "PARAM_6: ".$csr["USERNAME"]."\n"); |
|
| 157 | + $this->loggerInstance->debug(5, "PARAM_7: ".$csr["USERMAIL"]."\n"); |
|
| 158 | + $this->loggerInstance->debug(5, "PARAM_8: ".ProfileSilverbullet::PRODUCTNAME."\n"); |
|
| 159 | 159 | $this->loggerInstance->debug(5, "PARAM_9: false\n"); |
| 160 | 160 | $soapNewRequest = $soapPub->newRequest( |
| 161 | 161 | $this->eduPkiRaId, # RA-ID |
@@ -177,11 +177,11 @@ discard block |
||
| 177 | 177 | } catch (Exception $e) { |
| 178 | 178 | // PHP 7.1 can do this much better |
| 179 | 179 | if (is_soap_fault($e)) { |
| 180 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: { |
|
| 180 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: { |
|
| 181 | 181 | $e->faultstring |
| 182 | 182 | }\n"); |
| 183 | 183 | } |
| 184 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
| 184 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
| 185 | 185 | } |
| 186 | 186 | try { |
| 187 | 187 | $soap = $this->initEduPKISoapSession("RA"); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
| 214 | 214 | // rather than just using the string. Grr. |
| 215 | 215 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
| 216 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapCleartext); |
|
| 216 | + file_put_contents($tempdir['dir']."/content.txt", $soapCleartext); |
|
| 217 | 217 | // retrieve our RA cert from filesystem |
| 218 | 218 | // the RA certificates are not needed right now because we |
| 219 | 219 | // have resorted to S/MIME signatures with openssl command-line |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
| 226 | 226 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
| 227 | 227 | $this->loggerInstance->debug(2, "Actual content to be signed is this:\n $soapCleartext\n"); |
| 228 | - $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . $this->locationRaKey . " -signer " . $this->locationRaCert; |
|
| 228 | + $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".$this->locationRaKey." -signer ".$this->locationRaCert; |
|
| 229 | 229 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
| 230 | 230 | $output = []; |
| 231 | 231 | $return = 999; |
@@ -234,21 +234,21 @@ discard block |
||
| 234 | 234 | throw new Exception("Non-zero return value from openssl smime!"); |
| 235 | 235 | } |
| 236 | 236 | // and get the signature blob back from the filesystem |
| 237 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
| 237 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
| 238 | 238 | $this->loggerInstance->debug(5, "Request for server approveRequest has parameters:\n"); |
| 239 | - $this->loggerInstance->debug(5, $soapReqnum . "\n"); |
|
| 240 | - $this->loggerInstance->debug(5, $soapCleartext . "\n"); // PHP magically encodes this as base64 while sending! |
|
| 241 | - $this->loggerInstance->debug(5, $detachedSig . "\n"); |
|
| 239 | + $this->loggerInstance->debug(5, $soapReqnum."\n"); |
|
| 240 | + $this->loggerInstance->debug(5, $soapCleartext."\n"); // PHP magically encodes this as base64 while sending! |
|
| 241 | + $this->loggerInstance->debug(5, $detachedSig."\n"); |
|
| 242 | 242 | $soapIssueCert = $soap->approveRequest($soapReqnum, $soapCleartext, $detachedSig); |
| 243 | - $this->loggerInstance->debug(5, "approveRequest Request was: \n" . $soap->__getLastRequest()); |
|
| 244 | - $this->loggerInstance->debug(5, "approveRequest Response was: \n" . $soap->__getLastResponse()); |
|
| 243 | + $this->loggerInstance->debug(5, "approveRequest Request was: \n".$soap->__getLastRequest()); |
|
| 244 | + $this->loggerInstance->debug(5, "approveRequest Response was: \n".$soap->__getLastResponse()); |
|
| 245 | 245 | if ($soapIssueCert === FALSE) { |
| 246 | 246 | throw new Exception("The locally approved request was NOT processed by the CA."); |
| 247 | 247 | } |
| 248 | 248 | } catch (SoapFault $e) { |
| 249 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
| 249 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
| 250 | 250 | } catch (Exception $e) { |
| 251 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
| 251 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
| 252 | 252 | } |
| 253 | 253 | return $soapReqnum; |
| 254 | 254 | } |
@@ -300,9 +300,9 @@ discard block |
||
| 300 | 300 | throw new Exception("CAInfo has no root certificate for us!"); |
| 301 | 301 | } |
| 302 | 302 | } catch (SoapFault $e) { |
| 303 | - throw new Exception("SoapFault: Error when sending or receiving SOAP message: " . "{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
| 303 | + throw new Exception("SoapFault: Error when sending or receiving SOAP message: "."{$e->faultcode}: {$e->faultname}: {$e->faultstring}: {$e->faultactor}: {$e->detail}: {$e->headerfault}\n"); |
|
| 304 | 304 | } catch (Exception $e) { |
| 305 | - throw new Exception("Exception: Something odd happened between the SOAP requests:" . $e->getMessage()); |
|
| 305 | + throw new Exception("Exception: Something odd happened between the SOAP requests:".$e->getMessage()); |
|
| 306 | 306 | } |
| 307 | 307 | return [ |
| 308 | 308 | "CERT" => openssl_x509_read($parsedCert['pem']), |
@@ -335,12 +335,12 @@ discard block |
||
| 335 | 335 | // for obnoxious reasons, we have to dump the request into a file and let pkcs7_sign read from the file |
| 336 | 336 | // rather than just using the string. Grr. |
| 337 | 337 | $tempdir = \core\common\Entity::createTemporaryDirectory("test"); |
| 338 | - file_put_contents($tempdir['dir'] . "/content.txt", $soapRawRevRequest); |
|
| 338 | + file_put_contents($tempdir['dir']."/content.txt", $soapRawRevRequest); |
|
| 339 | 339 | // retrieve our RA cert from filesystem |
| 340 | 340 | // sign the data, using cmdline because openssl_pkcs7_sign produces strange results |
| 341 | 341 | // -binary didn't help, nor switch -md to sha1 sha256 or sha512 |
| 342 | 342 | $this->loggerInstance->debug(5, "Actual content to be signed is this:\n$soapRawRevRequest\n"); |
| 343 | - $execCmd = \config\Master::PATHS['openssl'] . " smime -sign -binary -in " . $tempdir['dir'] . "/content.txt -out " . $tempdir['dir'] . "/signature.txt -outform pem -inkey " . $this->locationRaKey . " -signer " . $this->locationRaCert; |
|
| 343 | + $execCmd = \config\Master::PATHS['openssl']." smime -sign -binary -in ".$tempdir['dir']."/content.txt -out ".$tempdir['dir']."/signature.txt -outform pem -inkey ".$this->locationRaKey." -signer ".$this->locationRaCert; |
|
| 344 | 344 | $this->loggerInstance->debug(2, "Calling openssl smime with following cmdline: $execCmd\n"); |
| 345 | 345 | $output = []; |
| 346 | 346 | $return = 999; |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | throw new Exception("Non-zero return value from openssl smime!"); |
| 350 | 350 | } |
| 351 | 351 | // and get the signature blob back from the filesystem |
| 352 | - $detachedSig = trim(file_get_contents($tempdir['dir'] . "/signature.txt")); |
|
| 352 | + $detachedSig = trim(file_get_contents($tempdir['dir']."/signature.txt")); |
|
| 353 | 353 | $soapIssueRev = $soap->approveRevocationRequest($soapRevocationSerial, $soapRawRevRequest, $detachedSig); |
| 354 | 354 | if ($soapIssueRev === FALSE) { |
| 355 | 355 | throw new Exception("The locally approved revocation request was NOT processed by the CA."); |
@@ -357,9 +357,9 @@ discard block |
||
| 357 | 357 | } catch (Exception $e) { |
| 358 | 358 | // PHP 7.1 can do this much better |
| 359 | 359 | if (is_soap_fault($e)) { |
| 360 | - throw new Exception("Error when sending SOAP request: " . "{$e->faultcode}: {$e->faultstring}\n"); |
|
| 360 | + throw new Exception("Error when sending SOAP request: "."{$e->faultcode}: {$e->faultstring}\n"); |
|
| 361 | 361 | } |
| 362 | - throw new Exception("Something odd happened while doing the SOAP request:" . $e->getMessage()); |
|
| 362 | + throw new Exception("Something odd happened while doing the SOAP request:".$e->getMessage()); |
|
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | |
@@ -459,9 +459,9 @@ discard block |
||
| 459 | 459 | */ |
| 460 | 460 | public function soapToXmlInteger($x) |
| 461 | 461 | { |
| 462 | - return '<' . $x[0] . '>' |
|
| 462 | + return '<'.$x[0].'>' |
|
| 463 | 463 | . htmlentities($x[1], ENT_NOQUOTES | ENT_XML1) |
| 464 | - . '</' . $x[0] . '>'; |
|
| 464 | + . '</'.$x[0].'>'; |
|
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | /** |
@@ -480,9 +480,9 @@ discard block |
||
| 480 | 480 | // dump private key into directory |
| 481 | 481 | $outstring = ""; |
| 482 | 482 | openssl_pkey_export($privateKey, $outstring); |
| 483 | - file_put_contents($tempdir . "/pkey.pem", $outstring); |
|
| 483 | + file_put_contents($tempdir."/pkey.pem", $outstring); |
|
| 484 | 484 | // PHP can only do one DC in the Subject. But we need three. |
| 485 | - $execCmd = \config\Master::PATHS['openssl'] . " req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=" . \config\ConfAssistant::CONSORTIUM['name'] . "/OU=$fed/CN=$username/emailAddress=$username"; |
|
| 485 | + $execCmd = \config\Master::PATHS['openssl']." req -new -sha256 -key $tempdir/pkey.pem -out $tempdir/request.csr -subj /DC=test/DC=test/DC=eduroam/C=$fed/O=".\config\ConfAssistant::CONSORTIUM['name']."/OU=$fed/CN=$username/emailAddress=$username"; |
|
| 486 | 486 | $this->loggerInstance->debug(2, "Calling openssl req with following cmdline: $execCmd\n"); |
| 487 | 487 | $output = []; |
| 488 | 488 | $return = 999; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | /* Messages */ |
| 93 | 93 | $messages = [ |
| 94 | 94 | 'WRONG_SUBJECT' => _('Submitted Certificate Signing Request contains subject field that does not start with') . ' ' . |
| 95 | - $subject_prefix . '<br>' . _("See CSR generation rules below."), |
|
| 95 | + $subject_prefix . '<br>' . _("See CSR generation rules below."), |
|
| 96 | 96 | 'WRONG_CSR' => _('Submitted Certificate Signing Request is broken - unable to extract the public key from CSR') |
| 97 | 97 | ]; |
| 98 | 98 | $settings = array(); |
@@ -127,9 +127,9 @@ discard block |
||
| 127 | 127 | $dc[] = 'DC=' . $v; |
| 128 | 128 | } |
| 129 | 129 | if ($DN !== array_reverse($dc)) { |
| 130 | - $dc = array(); |
|
| 131 | - $_SESSION['CSR_ERRORS'] = 'WRONG_SUBJECT'; |
|
| 132 | - $_SESSION['FORM_SETTINGS'] = $settings; |
|
| 130 | + $dc = array(); |
|
| 131 | + $_SESSION['CSR_ERRORS'] = 'WRONG_SUBJECT'; |
|
| 132 | + $_SESSION['FORM_SETTINGS'] = $settings; |
|
| 133 | 133 | } |
| 134 | 134 | } else { |
| 135 | 135 | $_SESSION['CSR_ERRORS'] = 'WRONG_SUBJECT'; |
@@ -176,15 +176,15 @@ discard block |
||
| 176 | 176 | } else { |
| 177 | 177 | $ou = $serverInfo["names"][$langInstance->getLang()]; |
| 178 | 178 | } |
| 179 | - if (str_contains($ou, ',')) { |
|
| 180 | - $modou = 1; |
|
| 181 | - $ou = str_replace(",", "/,", $ou); |
|
| 182 | - } |
|
| 183 | - $ou = preg_replace('/\s+/', ' ', $ou); |
|
| 184 | - if (strlen($ou) >= 64) { |
|
| 185 | - $ou = substr($ou, 0, 64); |
|
| 186 | - $modou += 2; |
|
| 187 | - } |
|
| 179 | + if (str_contains($ou, ',')) { |
|
| 180 | + $modou = 1; |
|
| 181 | + $ou = str_replace(",", "/,", $ou); |
|
| 182 | + } |
|
| 183 | + $ou = preg_replace('/\s+/', ' ', $ou); |
|
| 184 | + if (strlen($ou) >= 64) { |
|
| 185 | + $ou = substr($ou, 0, 64); |
|
| 186 | + $modou += 2; |
|
| 187 | + } |
|
| 188 | 188 | $DN[] = "O=".iconv('UTF-8', 'ASCII//TRANSLIT', $ou); |
| 189 | 189 | $serverList = explode(",", $serverInfo["servers"]); |
| 190 | 190 | $DN[] = "CN=" . $serverList[0]; |
@@ -209,20 +209,20 @@ discard block |
||
| 209 | 209 | echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties"); |
| 210 | 210 | echo "<ul>"; |
| 211 | 211 | echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>"; |
| 212 | - echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN); |
|
| 213 | - if ($modou > 0) { |
|
| 214 | - echo " ("; |
|
| 212 | + echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN); |
|
| 213 | + if ($modou > 0) { |
|
| 214 | + echo " ("; |
|
| 215 | 215 | echo _("Organization field adjusted"). ': '; |
| 216 | - $desc = array(); |
|
| 217 | - if ($modou >= 2) { |
|
| 218 | - $desc[] = _("truncated to 64 chars"); |
|
| 219 | - } |
|
| 220 | - if ($modou == 1 || $modou == 3) { |
|
| 221 | - $desc[] = _("commas escaped"); |
|
| 216 | + $desc = array(); |
|
| 217 | + if ($modou >= 2) { |
|
| 218 | + $desc[] = _("truncated to 64 chars"); |
|
| 219 | + } |
|
| 220 | + if ($modou == 1 || $modou == 3) { |
|
| 221 | + $desc[] = _("commas escaped"); |
|
| 222 | 222 | } |
| 223 | - echo implode(', ', $desc); |
|
| 224 | - echo ")"; |
|
| 225 | - } |
|
| 223 | + echo implode(', ', $desc); |
|
| 224 | + echo ")"; |
|
| 225 | + } |
|
| 226 | 226 | echo "</li>"; |
| 227 | 227 | echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>"; |
| 228 | 228 | echo "<li>" . _("Requester Contact Details: ") . $firstName . " <" . $firstMail . ">" . "</li>"; |
@@ -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 | $auth = new \web\lib\admin\Authentication(); |
| 32 | 32 | $deco = new \web\lib\admin\PageDecoration(); |
| 33 | 33 | $validator = new \web\lib\common\InputValidation(); |
@@ -91,23 +91,23 @@ discard block |
||
| 91 | 91 | $subject_prefix = implode(', ', array_reverse($DN)); |
| 92 | 92 | /* Messages */ |
| 93 | 93 | $messages = [ |
| 94 | - 'WRONG_SUBJECT' => _('Submitted Certificate Signing Request contains subject field that does not start with') . ' ' . |
|
| 95 | - $subject_prefix . '<br>' . _("See CSR generation rules below."), |
|
| 94 | + 'WRONG_SUBJECT' => _('Submitted Certificate Signing Request contains subject field that does not start with').' '. |
|
| 95 | + $subject_prefix.'<br>'._("See CSR generation rules below."), |
|
| 96 | 96 | 'WRONG_CSR' => _('Submitted Certificate Signing Request is broken - unable to extract the public key from CSR') |
| 97 | 97 | ]; |
| 98 | 98 | $settings = array(); |
| 99 | - if (isset($_SESSION['CSR_ERRORS']) && $_SESSION['CSR_ERRORS'] != '') { |
|
| 100 | - print '<h3 id="errorbox"><font color="red">'. $messages[$_SESSION['CSR_ERRORS']].'</font></h3>'; |
|
| 99 | + if (isset($_SESSION['CSR_ERRORS']) && $_SESSION['CSR_ERRORS'] != '') { |
|
| 100 | + print '<h3 id="errorbox"><font color="red">'.$messages[$_SESSION['CSR_ERRORS']].'</font></h3>'; |
|
| 101 | 101 | unset($_SESSION['CSR_ERRORS']); |
| 102 | 102 | } |
| 103 | - if (isset($_SESSION['FORM_SETTINGS']) && $_SESSION['FORM_SETTINGS'] != '') { |
|
| 103 | + if (isset($_SESSION['FORM_SETTINGS']) && $_SESSION['FORM_SETTINGS'] != '') { |
|
| 104 | 104 | $settings = $_SESSION['FORM_SETTINGS']; |
| 105 | 105 | unset($_SESSION['FORM_SETTINGS']); |
| 106 | 106 | } |
| 107 | 107 | if (empty($settings) && isset($_POST['LEVEL'])) { |
| 108 | 108 | $settings = array('LEVEL' => $_POST['LEVEL'], 'NRO-list' => $_POST['NRO-list'], 'INST-list' => $_POST['INST-list']); |
| 109 | 109 | } |
| 110 | - if ( isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) { |
|
| 110 | + if (isset($_POST['requestcert']) && $_POST['requestcert'] == \web\lib\common\FormElements::BUTTON_SAVE) { |
|
| 111 | 111 | // basic sanity checks before we hand this over to openssl |
| 112 | 112 | $sanitisedCsr = $validator->string($_POST['CSR'] ?? "", TRUE); |
| 113 | 113 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | if (!empty($subject_keys)) { |
| 125 | 125 | if ($subject_keys[0] == 'DC' && $subject['DC']) { |
| 126 | 126 | foreach ($subject['DC'] as $v) { |
| 127 | - $dc[] = 'DC=' . $v; |
|
| 127 | + $dc[] = 'DC='.$v; |
|
| 128 | 128 | } |
| 129 | 129 | if ($DN !== array_reverse($dc)) { |
| 130 | 130 | $dc = array(); |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | $fed = $validator->existingFederation($_POST['NRO-list']); |
| 151 | 151 | $country = strtoupper($fed->tld); |
| 152 | - $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country ; |
|
| 152 | + $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country; |
|
| 153 | 153 | $DN[] = "C=$code"; |
| 154 | - $DN[] = "O=NRO of " . iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']); |
|
| 154 | + $DN[] = "O=NRO of ".iconv('UTF-8', 'ASCII//TRANSLIT', $cat->knownFederations[$country]['name']); |
|
| 155 | 155 | $serverInfo = $externalDb->listExternalTlsServersFederation($fed->tld); |
| 156 | - $DN[] = "CN=" . $serverList[0]; |
|
| 156 | + $DN[] = "CN=".$serverList[0]; |
|
| 157 | 157 | $policies[] = "eduroam IdP"; |
| 158 | 158 | $policies[] = "eduroam SP"; |
| 159 | 159 | $firstName = $serverInfo[array_key_first($serverInfo)][0]["name"]; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | throw new Exception(sprintf("Sorry: you are not %s admin for the %s requested in the form.", $uiElements->nomenclatureFed, $uiElements->nomenclatureFed)); |
| 169 | 169 | } |
| 170 | 170 | $country = strtoupper($matches[1]); |
| 171 | - $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country ; |
|
| 171 | + $code = isset($cat->knownFederations[$country]['code']) ? $cat->knownFederations[$country]['code'] : $country; |
|
| 172 | 172 | $DN[] = "C=$code"; |
| 173 | 173 | $serverInfo = $extInsts[$_POST['INST-list']]; |
| 174 | 174 | if (isset($serverInfo["names"]["en"])) { |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | $modou = 1; |
| 181 | 181 | $ou = str_replace(",", "/,", $ou); |
| 182 | 182 | } |
| 183 | - $ou = preg_replace('/\s+/', ' ', $ou); |
|
| 183 | + $ou = preg_replace('/\s+/', ' ', $ou); |
|
| 184 | 184 | if (strlen($ou) >= 64) { |
| 185 | 185 | $ou = substr($ou, 0, 64); |
| 186 | 186 | $modou += 2; |
| 187 | 187 | } |
| 188 | 188 | $DN[] = "O=".iconv('UTF-8', 'ASCII//TRANSLIT', $ou); |
| 189 | 189 | $serverList = explode(",", $serverInfo["servers"]); |
| 190 | - $DN[] = "CN=" . $serverList[0]; |
|
| 190 | + $DN[] = "CN=".$serverList[0]; |
|
| 191 | 191 | switch ($serverInfo["type"]) { |
| 192 | 192 | case core\IdP::TYPE_IDPSP: |
| 193 | 193 | $policies[] = "eduroam IdP"; |
@@ -206,13 +206,13 @@ discard block |
||
| 206 | 206 | default: |
| 207 | 207 | throw new Exception("Sorry: Unknown level of issuance requested."); |
| 208 | 208 | } |
| 209 | - echo "<p style='font-size: large'>" . _("Requesting a certificate with the following properties"); |
|
| 209 | + echo "<p style='font-size: large'>"._("Requesting a certificate with the following properties"); |
|
| 210 | 210 | echo "<ul>"; |
| 211 | - echo "<li>" . _("Policy OIDs: ") . implode(", ", $policies) . "</li>"; |
|
| 212 | - echo "<li>" . _("Distinguished Name: ") . implode(", ", $DN); |
|
| 211 | + echo "<li>"._("Policy OIDs: ").implode(", ", $policies)."</li>"; |
|
| 212 | + echo "<li>"._("Distinguished Name: ").implode(", ", $DN); |
|
| 213 | 213 | if ($modou > 0) { |
| 214 | 214 | echo " ("; |
| 215 | - echo _("Organization field adjusted"). ': '; |
|
| 215 | + echo _("Organization field adjusted").': '; |
|
| 216 | 216 | $desc = array(); |
| 217 | 217 | if ($modou >= 2) { |
| 218 | 218 | $desc[] = _("truncated to 64 chars"); |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | echo ")"; |
| 225 | 225 | } |
| 226 | 226 | echo "</li>"; |
| 227 | - echo "<li>" . _("subjectAltName:DNS : ") . implode(", ", $serverList) . "</li>"; |
|
| 228 | - echo "<li>" . _("Requester Contact Details: ") . $firstName . " <" . $firstMail . ">" . "</li>"; |
|
| 227 | + echo "<li>"._("subjectAltName:DNS : ").implode(", ", $serverList)."</li>"; |
|
| 228 | + echo "<li>"._("Requester Contact Details: ").$firstName." <".$firstMail.">"."</li>"; |
|
| 229 | 229 | echo "</ul></p>"; |
| 230 | 230 | $vettedCsr = $validator->string($_POST['CSR'], true); |
| 231 | 231 | $newCsrWithMeta = [ |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $loggerInstance->debug(2, $DN, "CERT DN: ", "\n"); |
| 241 | 241 | // our certs can be good for max 5 years |
| 242 | 242 | $fed->requestCertificate($user->identifier, $newCsrWithMeta, $expiryDays); |
| 243 | - echo "<p>" . _("The certificate was requested.") . "</p>"; |
|
| 243 | + echo "<p>"._("The certificate was requested.")."</p>"; |
|
| 244 | 244 | ?> |
| 245 | 245 | <form action="overview_certificates.php" method="GET"> |
| 246 | 246 | <button type="submit"><?php echo _("Back to Certificate Overview"); ?></button> |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | switch (count($feds)) { |
| 259 | 259 | case 0: |
| 260 | 260 | echo "<div>"; |
| 261 | - echo $uiElements->boxRemark("<strong>" . sprintf(_("None of your %s servers has complete information in the database."),$uiElements->nomenclatureFed)."</strong>" . _("At least the DNS names of TLS servers and a role-based contact mail address are required.")); |
|
| 261 | + echo $uiElements->boxRemark("<strong>".sprintf(_("None of your %s servers has complete information in the database."), $uiElements->nomenclatureFed)."</strong>"._("At least the DNS names of TLS servers and a role-based contact mail address are required.")); |
|
| 262 | 262 | echo "</div>"; |
| 263 | 263 | break; |
| 264 | 264 | case 1: |
@@ -266,22 +266,22 @@ discard block |
||
| 266 | 266 | if (empty($settings) || (isset($settings['LEVEL']) && $settings['LEVEL'] == 'NRO')) { |
| 267 | 267 | echo ' checked'; |
| 268 | 268 | } |
| 269 | - echo '>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>'; |
|
| 270 | - echo " <strong>" . $cat->knownFederations[$feds[0]->tld]['name'] . "</strong>"; |
|
| 271 | - echo '<input type="hidden" name="NRO-list" id="NRO-list" value="' . $feds[0]->tld . '"/>'; |
|
| 269 | + echo '>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>'; |
|
| 270 | + echo " <strong>".$cat->knownFederations[$feds[0]->tld]['name']."</strong>"; |
|
| 271 | + echo '<input type="hidden" name="NRO-list" id="NRO-list" value="'.$feds[0]->tld.'"/>'; |
|
| 272 | 272 | break; |
| 273 | 273 | default: |
| 274 | 274 | echo '<input type="radio" name="LEVEL" id="NRO" value="NRO"'; |
| 275 | 275 | if (empty($settings) || isset($settings['LEVEL']) && $settings['LEVEL'] == 'NRO') { |
| 276 | 276 | echo ' checked'; |
| 277 | 277 | } |
| 278 | - echo '>' . sprintf(_("Certificate for %s") ." ", $uiElements->nomenclatureFed) . '</input>'; |
|
| 278 | + echo '>'.sprintf(_("Certificate for %s")." ", $uiElements->nomenclatureFed).'</input>'; |
|
| 279 | 279 | ?> |
| 280 | 280 | <select name="NRO-list" id="NRO-list"> |
| 281 | 281 | <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option> |
| 282 | 282 | <?php |
| 283 | 283 | foreach ($feds as $oneFed) { |
| 284 | - echo '<option value="' . strtoupper($oneFed->tld) . '">' . $cat->knownFederations[$oneFed->tld]['name'] . "</option>"; |
|
| 284 | + echo '<option value="'.strtoupper($oneFed->tld).'">'.$cat->knownFederations[$oneFed->tld]['name']."</option>"; |
|
| 285 | 285 | #echo '<option value="AAA' . strtoupper($oneFed->tld) . '">' . $oneIdP["names"][$langObject->getLang()] . "</option>"; |
| 286 | 286 | |
| 287 | 287 | } |
@@ -294,18 +294,18 @@ discard block |
||
| 294 | 294 | <script> |
| 295 | 295 | var instservers = []; |
| 296 | 296 | var instpolicies = []; |
| 297 | - var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo));?>'; |
|
| 297 | + var nroservers = '<?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?>'; |
|
| 298 | 298 | <?php |
| 299 | 299 | $allIdPs = []; |
| 300 | 300 | foreach ($allAuthorizedFeds as $oneFed) { |
| 301 | 301 | foreach ($externalDb->listExternalTlsServersInstitution($oneFed['value']) as $id => $oneIdP) { |
| 302 | - $allIdPs[$id] = '[' . substr($id, 0, 2) . '] ' . $oneIdP["name"]; |
|
| 303 | - echo "instservers['" . $id . "']='" . str_replace(",", ", ", $oneIdP["servers"]) . "';\n"; |
|
| 304 | - echo "instpolicies['" . $id . "']='"; |
|
| 302 | + $allIdPs[$id] = '['.substr($id, 0, 2).'] '.$oneIdP["name"]; |
|
| 303 | + echo "instservers['".$id."']='".str_replace(",", ", ", $oneIdP["servers"])."';\n"; |
|
| 304 | + echo "instpolicies['".$id."']='"; |
|
| 305 | 305 | if ($oneIdP["type"] == 'IdPSP') { |
| 306 | 306 | echo "eduroam IdP/SP"; |
| 307 | 307 | } else { |
| 308 | - echo "eduroam " . $oneIdP["type"]; |
|
| 308 | + echo "eduroam ".$oneIdP["type"]; |
|
| 309 | 309 | } |
| 310 | 310 | echo "';\n"; |
| 311 | 311 | } |
@@ -351,9 +351,9 @@ discard block |
||
| 351 | 351 | <option value="notset"><?php echo _("---PLEASE CHOOSE---"); ?></option> |
| 352 | 352 | <?php |
| 353 | 353 | foreach ($allIdPs as $id => $name) { |
| 354 | - echo '<option value="' . $id . '"'; |
|
| 354 | + echo '<option value="'.$id.'"'; |
|
| 355 | 355 | if (isset($settings['INST-list']) && $settings['INST-list'] == $id) { echo ' selected'; } |
| 356 | - echo '>' . $name . "</option>"; |
|
| 356 | + echo '>'.$name."</option>"; |
|
| 357 | 357 | } |
| 358 | 358 | ?> |
| 359 | 359 | </select> |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | <?php |
| 368 | 368 | echo _('According to the above settings you will receive') |
| 369 | 369 | ?> |
| 370 | - <span id='certlevel'><?php echo _('NRO level certificate');?></span> |
|
| 370 | + <span id='certlevel'><?php echo _('NRO level certificate'); ?></span> |
|
| 371 | 371 | |
| 372 | 372 | for server names: |
| 373 | 373 | <span id='serversinfo'><?php echo str_replace(",", ", ", array_key_first($serverInfo)); ?></span> |
@@ -384,12 +384,12 @@ discard block |
||
| 384 | 384 | <?php |
| 385 | 385 | } else { |
| 386 | 386 | echo "<div>"; |
| 387 | - echo $uiElements->boxRemark(sprintf(_("<strong>No organisation inside your %s has complete information in the database</strong>."." "._("At least the DNS names of TLS servers and a role-based contact mail address are required.")),$uiElements->nomenclatureFed), "No TLS capable org!", true); |
|
| 387 | + echo $uiElements->boxRemark(sprintf(_("<strong>No organisation inside your %s has complete information in the database</strong>."." "._("At least the DNS names of TLS servers and a role-based contact mail address are required.")), $uiElements->nomenclatureFed), "No TLS capable org!", true); |
|
| 388 | 388 | echo "</div>"; |
| 389 | 389 | } |
| 390 | 390 | ?> |
| 391 | 391 | <?php |
| 392 | - echo '<div id="ondb"><h4 style="margin: 0">' . _("Can't you find an institution on the select list above?") . '</h4>'; |
|
| 392 | + echo '<div id="ondb"><h4 style="margin: 0">'._("Can't you find an institution on the select list above?").'</h4>'; |
|
| 393 | 393 | echo _("Most likely we do not have required data on this institution in the eduroam database."); |
| 394 | 394 | echo '<br/>'; |
| 395 | 395 | ?> |
@@ -397,16 +397,16 @@ discard block |
||
| 397 | 397 | <?php |
| 398 | 398 | echo _('On this page'); |
| 399 | 399 | echo '</a> '; |
| 400 | - echo _('you can check what information is in the datatabase') . '.'; |
|
| 400 | + echo _('you can check what information is in the datatabase').'.'; |
|
| 401 | 401 | echo '</div>'; |
| 402 | 402 | if (count($feds) > 0 || count($allIdPs) > 0) {?> |
| 403 | 403 | <h2><?php echo _("2. CSR generation"); ?></h2> |
| 404 | 404 | <p> |
| 405 | 405 | <?php |
| 406 | - echo _("The CSR subject field has to start with ") .'<b>' . $subject_prefix . '</b><br>'; |
|
| 406 | + echo _("The CSR subject field has to start with ").'<b>'.$subject_prefix.'</b><br>'; |
|
| 407 | 407 | echo _("One way to generate an acceptable certificate request is via this openssl one-liner:"); ?></p> |
| 408 | 408 | <?php |
| 409 | - echo "<b>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /". implode('/', array_reverse($DN)) ."/C=XY/O=WillBeReplaced/CN=will.be.replaced</b>"; |
|
| 409 | + echo "<b>openssl req -new -newkey rsa:4096 -out test.csr -keyout test.key -subj /".implode('/', array_reverse($DN))."/C=XY/O=WillBeReplaced/CN=will.be.replaced</b>"; |
|
| 410 | 410 | ?> |
| 411 | 411 | <h2><?php echo _("3. Submission"); ?></h2> |
| 412 | 412 | <?php echo _("Please paste your CSR here:"); ?><br/><textarea name="CSR" id="CSR" rows="20" cols="85"/></textarea><br/> |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | namespace core; |
| 23 | 23 | |
| 24 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
| 24 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
| 25 | 25 | |
| 26 | 26 | $instMgmt = new \core\UserManagement(); |
| 27 | 27 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | <?php echo $uiElements->infoblock($user->getAttributes(), "user", "User"); ?> |
| 62 | 62 | <tr> |
| 63 | 63 | <td> |
| 64 | - <?php echo "" . _("Unique Identifier") ?> |
|
| 64 | + <?php echo ""._("Unique Identifier") ?> |
|
| 65 | 65 | </td> |
| 66 | 66 | <td> |
| 67 | 67 | </td> |
@@ -74,14 +74,14 @@ discard block |
||
| 74 | 74 | <div> |
| 75 | 75 | <?php |
| 76 | 76 | if (\config\Master::DB['USER']['readonly'] === FALSE) { |
| 77 | - echo "<a href='edit_user.php'><button>" . _("Edit User Details") . "</button></a>"; |
|
| 77 | + echo "<a href='edit_user.php'><button>"._("Edit User Details")."</button></a>"; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | if ($user->isFederationAdmin()) { |
| 81 | - echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed) . "</button></form>"; |
|
| 81 | + echo "<form action='overview_federation.php' method='GET' accept-charset='UTF-8'><button type='submit'>".sprintf(_('Click here for %s management tasks'), $uiElements->nomenclatureFed)."</button></form>"; |
|
| 82 | 82 | } |
| 83 | 83 | if ($user->isSuperadmin()) { |
| 84 | - echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>" . _('Click here to access the superadmin page') . "</button></form>"; |
|
| 84 | + echo "<form action='112365365321.php' method='GET' accept-charset='UTF-8'><button type='submit'>"._('Click here to access the superadmin page')."</button></form>"; |
|
| 85 | 85 | } |
| 86 | 86 | ?> |
| 87 | 87 | </div> |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | if (\config\Master::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == "LOCAL") { |
| 94 | 94 | $target = "https://wiki.geant.org/x/6Zg7Bw"; // Managed IdP manual |
| 95 | 95 | } |
| 96 | - $helptext = "<h3 style='display:inline;'>" . sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureParticipant) . "</h3>"; |
|
| 96 | + $helptext = "<h3 style='display:inline;'>".sprintf(_("(Need help? Refer to the <a href='%s'>%s administrator manual</a>)"), $target, $uiElements->nomenclatureParticipant)."</h3>"; |
|
| 97 | 97 | } else { |
| 98 | 98 | $helptext = ""; |
| 99 | 99 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | // we need to run the Federation constructor |
| 103 | 103 | $cat = new \core\CAT; |
| 104 | 104 | /// first parameter: number of Identity Providers; second param is the literal configured term for 'Identity Provider' (you may or may not be able to add a plural suffix for your locale) |
| 105 | - echo "<h2>" . sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureParticipant) . "</h2>"; |
|
| 105 | + echo "<h2>".sprintf(ngettext("You are managing the following <span style='display:none'>%d </span>%s:", "You are managing the following <strong>%d</strong> %s:", sizeof($hasInst)), sizeof($hasInst), $uiElements->nomenclatureParticipant)."</h2>"; |
|
| 106 | 106 | $instlist = []; |
| 107 | 107 | $my_idps = []; |
| 108 | 108 | $myFeds = []; |
@@ -194,14 +194,14 @@ discard block |
||
| 194 | 194 | <td> |
| 195 | 195 | <?php |
| 196 | 196 | if ($blessedUser && \config\Master::DB['INST']['readonly'] === FALSE) { |
| 197 | - echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=" . $the_inst->identifier . "' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>" . _("Add/Remove Administrators") . "</button></form></div>"; |
|
| 197 | + echo "<div style='white-space: nowrap;'><form method='post' action='inc/manageAdmins.inc.php?inst_id=".$the_inst->identifier."' onsubmit='popupRedirectWindow(this); return false;' accept-charset='UTF-8'><button type='submit'>"._("Add/Remove Administrators")."</button></form></div>"; |
|
| 198 | 198 | } |
| 199 | 199 | ?> |
| 200 | 200 | </td> |
| 201 | 201 | <td> <!-- danger zone --> |
| 202 | 202 | |
| 203 | 203 | <form action='edit_participant_result.php?inst_id=<?php echo $the_inst->identifier; ?>' method='post' accept-charset='UTF-8'> |
| 204 | - <button class='delete' type='submit' name='submitbutton' value='<?php echo \web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo ( \config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL ? sprintf(_("After deleting the %s, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureFed) . " " : "" ) . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclatureParticipant, $the_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclatureParticipant); ?></button> |
|
| 204 | + <button class='delete' type='submit' name='submitbutton' value='<?php echo \web\lib\common\FormElements::BUTTON_DELETE; ?>' onclick="return confirm('<?php echo (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL ? sprintf(_("After deleting the %s, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureFed)." " : "").sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclatureParticipant, $the_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclatureParticipant); ?></button> |
|
| 205 | 205 | </form> |
| 206 | 206 | <form action='edit_participant_result.php?inst_id=<?php echo $the_inst->identifier; ?>' method='post' accept-charset='UTF-8'> |
| 207 | 207 | <button class='delete' type='submit' name='submitbutton' value='<?php echo \web\lib\common\FormElements::BUTTON_FLUSH_AND_RESTART; ?>' onclick="return confirm('<?php echo sprintf(_("This action will delete all properties of the %s and start over the configuration from scratch. Do you really want to reset all settings of the %s %s?"), $uiElements->nomenclatureParticipant, $uiElements->nomenclatureParticipant, $the_inst->name); ?>')"><?php echo sprintf(_("Reset all %s settings"), $uiElements->nomenclatureParticipant); ?></button> |
@@ -216,19 +216,19 @@ discard block |
||
| 216 | 216 | </table> |
| 217 | 217 | <?php |
| 218 | 218 | } else { |
| 219 | - echo "<h2>" . sprintf(_("You are not managing any %s."), $uiElements->nomenclatureParticipant) . "</h2>"; |
|
| 219 | + echo "<h2>".sprintf(_("You are not managing any %s."), $uiElements->nomenclatureParticipant)."</h2>"; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if (\config\Master::DB['INST']['readonly'] === FALSE) { |
| 223 | 223 | if (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL) { |
| 224 | - echo "<p>" . sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant) . "</p>"; |
|
| 224 | + echo "<p>".sprintf(_("Please ask your %s administrator to invite you to become an %s administrator."), $uiElements->nomenclatureFed, $uiElements->nomenclatureParticipant)."</p>"; |
|
| 225 | 225 | echo "<hr/> |
| 226 | 226 | <div style='white-space: nowrap;'> |
| 227 | 227 | <form action='action_enrollment.php' method='get' accept-charset='UTF-8'>" . |
| 228 | - sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureParticipant) . |
|
| 228 | + sprintf(_("Did you receive an invitation token to manage an %s? Please paste it here:"), $uiElements->nomenclatureParticipant). |
|
| 229 | 229 | " <input type='text' id='token' name='token'/> |
| 230 | 230 | <button type='submit'>" . |
| 231 | - _("Go!") . " |
|
| 231 | + _("Go!")." |
|
| 232 | 232 | </button> |
| 233 | 233 | </form> |
| 234 | 234 | </div>"; |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | echo "<table>"; |
| 250 | 250 | foreach ($newInst as $inst) { |
| 251 | 251 | echo "<tr><th>"; |
| 252 | - $i =0; |
|
| 252 | + $i = 0; |
|
| 253 | 253 | foreach ($inst[1] as $lang => $name) { |
| 254 | 254 | if ($i > 0) { |
| 255 | 255 | echo "; "; |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | echo "<input type='hidden' id='token' name='token' value='EDUGAIN-SELF-REGISTER'/>"; |
| 263 | 263 | $extid = strtoupper($inst[2]).'01-'.$inst[0]; |
| 264 | 264 | echo "<input type='hidden' name='extid' value='$extid'>"; |
| 265 | - echo "<button type='submit' accept-charset='UTF-8' onclick='javascript:window.confirm(\""._("Proceed with creating the CAT IdP?")."\")'>" ._("create CAT profile for this institution")."</button><br>"; |
|
| 265 | + echo "<button type='submit' accept-charset='UTF-8' onclick='javascript:window.confirm(\""._("Proceed with creating the CAT IdP?")."\")'>"._("create CAT profile for this institution")."</button><br>"; |
|
| 266 | 266 | echo "</form>"; |
| 267 | 267 | echo "</div></td></tr>"; |
| 268 | 268 | } |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | <div style='white-space: nowrap;'> |
| 276 | 276 | <form action='action_enrollment.php' method='get'><button type='submit' accept-charset='UTF-8'> |
| 277 | 277 | <input type='hidden' id='token' name='token' value='SELF-REGISTER'/>" . |
| 278 | - sprintf(_("New %s Registration"), $uiElements->nomenclatureParticipant) . " |
|
| 278 | + sprintf(_("New %s Registration"), $uiElements->nomenclatureParticipant)." |
|
| 279 | 279 | </button> |
| 280 | 280 | </form> |
| 281 | 281 | </div>"; |
@@ -232,9 +232,7 @@ discard block |
||
| 232 | 232 | </button> |
| 233 | 233 | </form> |
| 234 | 234 | </div>"; |
| 235 | - } |
|
| 236 | - |
|
| 237 | - elseif (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === 'eduGAIN') { |
|
| 235 | + } elseif (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === 'eduGAIN') { |
|
| 238 | 236 | if ($user->edugain === true) { |
| 239 | 237 | $resyncedInst = $instMgmt->currentInstitutions['resynced']; |
| 240 | 238 | $newInst = $instMgmt->currentInstitutions['new']; |
@@ -269,8 +267,7 @@ discard block |
||
| 269 | 267 | echo "</table>"; |
| 270 | 268 | } |
| 271 | 269 | } |
| 272 | - } |
|
| 273 | - else { // self-service registration is allowed! Yay :-) |
|
| 270 | + } else { // self-service registration is allowed! Yay :-) |
|
| 274 | 271 | echo "<hr> |
| 275 | 272 | <div style='white-space: nowrap;'> |
| 276 | 273 | <form action='action_enrollment.php' method='get'><button type='submit' accept-charset='UTF-8'> |