@@ -95,7 +95,7 @@ |
||
95 | 95 | |
96 | 96 | while ($oneAttrib = mysqli_fetch_object(/** @scrutinizer ignore-type */ $idpWideOptionsQuery)) { |
97 | 97 | if (!isset($profiles[$oneAttrib->institution_id])) { |
98 | - $idp = new \core\IdP((int)$oneAttrib->institution_id); |
|
98 | + $idp = new \core\IdP((int) $oneAttrib->institution_id); |
|
99 | 99 | $profiles[$oneAttrib->institution_id] = ['IdP' => $idp, 'Profiles' => $idp->listProfiles()]; |
100 | 100 | echo "Debug: IdP " . $idp->identifier . " has profiles "; |
101 | 101 | foreach ($profiles[$oneAttrib->institution_id]['Profiles'] as $oneProfileObject) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | function disp_name($eap) { |
29 | 29 | $displayName = \core\common\EAP::eapDisplayName($eap); |
30 | - return $displayName['OUTER'] . ( $displayName['INNER'] != '' ? '-' . $displayName['INNER'] : ''); |
|
30 | + return $displayName['OUTER'] . ($displayName['INNER'] != '' ? '-' . $displayName['INNER'] : ''); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | if (!isset($_REQUEST['test_type']) || !$_REQUEST['test_type']) { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $testsuite = new \core\diag\RADIUSTests($check_realm, $my_profile->getRealmCheckOuterUsername(), $my_profile->getEapMethodsinOrderOfPreference(1), $my_profile->getCollapsedAttributes()['eap:server_name'], $my_profile->getCollapsedAttributes()['eap:ca_file']); |
51 | 51 | } else { |
52 | 52 | $my_profile = NULL; |
53 | - $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm); |
|
53 | + $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | // contains port number; needs to be redacted for filter_var to work |
67 | 67 | // in any case, it's a printable string, so filter it initially |
68 | 68 | |
69 | - $filteredHost = filter_input(INPUT_GET,'src', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST,'src', FILTER_SANITIZE_STRING); |
|
69 | + $filteredHost = filter_input(INPUT_GET, 'src', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'src', FILTER_SANITIZE_STRING); |
|
70 | 70 | $hostonly1 = preg_replace('/:[0-9]*$/', "", $filteredHost); |
71 | 71 | $hostonly2 = preg_replace('/^\[/', "", $hostonly1); |
72 | 72 | $hostonly3 = preg_replace('/\]$/', "", $hostonly2); |
@@ -295,12 +295,12 @@ discard block |
||
295 | 295 | $returnarray['time_millisec'] = sprintf("%d", $testsuite->UDP_reachability_result[$host]['time_millisec']); |
296 | 296 | |
297 | 297 | if (preg_match('/verify error:num=19/', implode($opensslbabble))) { |
298 | - $printedres .= "<tr><td>"._("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!") . $measure ."</td></tr>"; |
|
298 | + $printedres .= "<tr><td>" . _("<strong>ERROR</strong>: the server presented a certificate which is from an unknown authority!") . $measure . "</td></tr>"; |
|
299 | 299 | $my_ip_addrs[$key]["status"] = "FAILED"; |
300 | 300 | $goterror = 1; |
301 | 301 | } |
302 | 302 | if (preg_match('/verify return:1/', implode($opensslbabble))) { |
303 | - $printedres .= "<tr><td>"._("Completed.") . $measure . "</td></tr>"; |
|
303 | + $printedres .= "<tr><td>" . _("Completed.") . $measure . "</td></tr>"; |
|
304 | 304 | $printedres .= "<tr><td></td><td><div class=\"more\">"; |
305 | 305 | $my_ip_addrs[$key]["status"] = "OK"; |
306 | 306 | $servercertRaw = implode("\n", $opensslbabble); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | namespace web\lib\user; |
12 | 12 | |
13 | -require_once(ROOT."/config/_config.php"); |
|
13 | +require_once(ROOT . "/config/_config.php"); |
|
14 | 14 | /** |
15 | 15 | * these constants live in the global space just to ease their use - with class |
16 | 16 | * prefix, the names simply get too long for comfort |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | $this->templates[WELCOME_ABOARD_BACKTODOWNLOADS] = _("Back to downloads"); |
73 | 73 | $this->templates[EDUROAM_WELCOME_ADVERTISING] = sprintf(_("we would like to warmly welcome you among the several million users of %s! From now on, you will be able to use internet access resources on thousands of universities, research centres and other places all over the globe. All of this completely free of charge!"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
74 | 74 | $this->templates[HEADING_TOPLEVEL_GREET] = sprintf(_("Welcome to %s"), CONFIG['APPEARANCE']['productname']); |
75 | - $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"),CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
75 | + $this->templates[HEADING_TOPLEVEL_PURPOSE] = sprintf(_("Connect your device to %s"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
|
76 | 76 | $this->templates[FRONTPAGE_ROLLER_EASY] = sprintf(_("%s installation made easy:"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
77 | - $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = sprintf(_("Custom built for your %s"),$parent->nomenclature_inst); |
|
77 | + $this->templates[FRONTPAGE_ROLLER_CUSTOMBUILT] = sprintf(_("Custom built for your %s"), $parent->nomenclature_inst); |
|
78 | 78 | $this->templates[FRONTPAGE_BIGDOWNLOADBUTTON] = sprintf(_("Click here to download your %s installer"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name'], CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
79 | 79 | $this->templates[PROFILE_SELECTION] = _("Select the user group"); |
80 | 80 | $this->templates[INSTITUTION_SELECTION] = _("select another"); |
@@ -162,7 +162,7 @@ |
||
162 | 162 | $profileFileCont .= ' |
163 | 163 | </ServerSideCredential> |
164 | 164 | <InnerAuthenticationMethod> |
165 | -<NonEAPAuthMethod>' .$innerMethod. '</NonEAPAuthMethod> |
|
165 | +<NonEAPAuthMethod>' .$innerMethod . '</NonEAPAuthMethod> |
|
166 | 166 | </InnerAuthenticationMethod> |
167 | 167 | <VendorSpecific> |
168 | 168 | <SessionResumption>false</SessionResumption> |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @package Developer |
18 | 18 | */ |
19 | -function check_my_nonce($nonce, $optSalt='') { |
|
19 | +function check_my_nonce($nonce, $optSalt = '') { |
|
20 | 20 | $remote = filter_input(INPUT_SERVER, 'REMOTE_ADDR'); |
21 | - $lasthour = date("G")-1<0 ? date('Ymd').'23' : date("YmdG")-1; |
|
22 | - if (hash_hmac('sha256', session_id().$optSalt, date("YmdG").'1qaz2wsx3edc!QAZ@WSX#EDC'.$remote) == $nonce || |
|
23 | - hash_hmac('sha256', session_id().$optSalt, $lasthour.'1qaz2wsx3edc!QAZ@WSX#EDC'.$remote) == $nonce) { |
|
21 | + $lasthour = date("G") - 1 < 0 ? date('Ymd') . '23' : date("YmdG") - 1; |
|
22 | + if (hash_hmac('sha256', session_id() . $optSalt, date("YmdG") . '1qaz2wsx3edc!QAZ@WSX#EDC' . $remote) == $nonce || |
|
23 | + hash_hmac('sha256', session_id() . $optSalt, $lasthour . '1qaz2wsx3edc!QAZ@WSX#EDC' . $remote) == $nonce) { |
|
24 | 24 | return true; |
25 | 25 | } else { |
26 | 26 | return false; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | foreach ($details['admins'] as $admin) { |
53 | 53 | $admins[] = $admin['email']; |
54 | 54 | } |
55 | - $details['admins'] = base64_encode(join(',',$admins)); |
|
55 | + $details['admins'] = base64_encode(join(',', $admins)); |
|
56 | 56 | } else { |
57 | 57 | $details['admins'] = ''; |
58 | 58 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $details = $cat->getExternalDBEntityDetails($realmOu); |
87 | 87 | if (!empty($details)) { |
88 | 88 | $returnArray['status'] = 1; |
89 | - $returnArray['realms'] = explode(',',$details['realmlist']); |
|
89 | + $returnArray['realms'] = explode(',', $details['realmlist']); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | // if we have a pushed close button, submit attributes and send user back to the overview page |
26 | 26 | // if external DB sync is disabled globally, the user never gets to this page. If he came here *anyway* -> send him back immediately. |
27 | -if ((isset($_POST['submitbutton']) && $_POST['submitbutton'] == web\lib\common\FormElements::BUTTON_CLOSE ) || CONFIG['DB']['enforce-external-sync'] == FALSE) { |
|
27 | +if ((isset($_POST['submitbutton']) && $_POST['submitbutton'] == web\lib\common\FormElements::BUTTON_CLOSE) || CONFIG['DB']['enforce-external-sync'] == FALSE) { |
|
28 | 28 | header("Location: ../overview_federation.php"); |
29 | 29 | exit; |
30 | 30 | } |
@@ -159,7 +159,7 @@ |
||
159 | 159 | |
160 | 160 | echo "</td> |
161 | 161 | <td> |
162 | - <form action='inc/manageAdmins.inc.php?inst_id=" . $my_inst->identifier . "' method='post' " . ( $oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "" ) . " accept-charset='UTF-8'> |
|
162 | + <form action='inc/manageAdmins.inc.php?inst_id=" . $my_inst->identifier . "' method='post' " . ($oneowner['ID'] != $_SESSION['user'] ? "onsubmit='popupRedirectWindow(this); return false;'" : "") . " accept-charset='UTF-8'> |
|
163 | 163 | <input type='hidden' name='admin_id' value='" . $oneowner['ID'] . "'></input> |
164 | 164 | <button type='submit' name='submitbutton' class='delete' value='" . web\lib\common\FormElements::BUTTON_DELETE . "'>" . _("Delete Administrator") . "</button> |
165 | 165 | </form> |
@@ -191,7 +191,7 @@ |
||
191 | 191 | case "SILVERBULLET": |
192 | 192 | $theProfile = new ProfileSilverbullet($identifier, $this); |
193 | 193 | $theProfile->addSupportedEapMethod(new \core\common\EAP(\core\common\EAP::EAPTYPE_SILVERBULLET), 1); |
194 | - $theProfile->setRealm($this->identifier."-".$theProfile->identifier."." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix'])); |
|
194 | + $theProfile->setRealm($this->identifier . "-" . $theProfile->identifier . "." . strtolower($this->federation) . strtolower(CONFIG_CONFASSISTANT['SILVERBULLET']['realm_suffix'])); |
|
195 | 195 | return $theProfile; |
196 | 196 | default: |
197 | 197 | throw new Exception("This type of profile is unknown and can not be added."); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | <div class='infobox' style='text-align:center;'> |
57 | 57 | <h2><?php echo sprintf(_("QR Code for %s download area"), $uiElements->nomenclature_inst); ?></h2> |
58 | 58 | <?php |
59 | - $displayurl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier; |
|
59 | + $displayurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier; |
|
60 | 60 | $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo(QRcode::png($displayurl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL), QRCODE_PIXELS_PER_SYMBOL)); |
61 | 61 | $size = getimagesize($uri); |
62 | 62 | echo "<img width='" . ($size[0] / 4) . "' height='" . ($size[1] / 4) . "' src='$uri' alt='QR-code'/>"; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | </td> |
94 | 94 | <td> |
95 | 95 | <form action='edit_idp_result.php?inst_id=<?php echo $my_inst->identifier; ?>' method='post' accept-charset='UTF-8'> |
96 | - <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 IdP, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclature_fed) . " " : "" ) . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclature_inst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclature_inst); ?></button> |
|
96 | + <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 IdP, you can not recreate it yourself - you need a new invitation token from the %s administrator!"), $uiElements->nomenclature_fed) . " " : "") . sprintf(_("Do you really want to delete your %s %s?"), $uiElements->nomenclature_inst, $my_inst->name); ?>')"><?php echo sprintf(_("Delete %s"), $uiElements->nomenclature_inst); ?></button> |
|
97 | 97 | </form> |
98 | 98 | |
99 | 99 | </td> |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if ($readonly === FALSE) { |
182 | 182 | ?> |
183 | 183 | <form action='edit_silverbullet.php?inst_id=<?php echo $my_inst->identifier; ?>&profile_id=<?php echo $profile_list->identifier; ?>' method='POST'> |
184 | - <button <?php echo ( is_array($completeness) ? "disabled" : "" ); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
184 | + <button <?php echo (is_array($completeness) ? "disabled" : ""); ?> type='submit' name='sb_action' value='sb_edit'><?php echo _("Manage User Base"); ?></button> |
|
185 | 185 | </form> |
186 | 186 | <?php |
187 | 187 | } |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | if (isset($URL['device-specific:redirect'])) { |
316 | 316 | $displayurl = $URL['device-specific:redirect'][0]; |
317 | 317 | } else { |
318 | - $displayurl = ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier . "&profile=" . $profile_list->identifier; |
|
318 | + $displayurl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on" ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . dirname(dirname($_SERVER['SCRIPT_NAME'])) . "?idp=" . $my_inst->identifier . "&profile=" . $profile_list->identifier; |
|
319 | 319 | } |
320 | 320 | echo "<a href='$displayurl' style='white-space: nowrap; text-align: center;'>"; |
321 | 321 | $uri = "data:image/png;base64," . base64_encode($uiElements->pngInjectConsortiumLogo(QRcode::png($displayurl, FALSE, QR_ECLEVEL_Q, QRCODE_PIXELS_PER_SYMBOL), QRCODE_PIXELS_PER_SYMBOL)); |