@@ -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> |
@@ -225,7 +225,7 @@ |
||
225 | 225 | $handle = DBConnection::handle("INST"); |
226 | 226 | $blobQuery = $handle->exec("SELECT option_value from $table WHERE row = $row"); |
227 | 227 | // SELECT -> returns resource, not boolean |
228 | - while ($returnedData = /** @scrutinizer ignore-type */ mysqli_fetch_object($blobQuery)) { |
|
228 | + while ($returnedData = /** @scrutinizer ignore-type */ mysqli_fetch_object($blobQuery)) { |
|
229 | 229 | $blob = $returnedData->option_value; |
230 | 230 | } |
231 | 231 | if (!isset($blob)) { |
@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | require_once(dirname(dirname(__DIR__)) . "/config/_config.php"); |
12 | 12 | $realm = filter_input(INPUT_GET, 'realm', FILTER_SANITIZE_STRING); |
13 | -$visited = filter_input(INPUT_GET,'visited', FILTER_SANITIZE_STRING); |
|
13 | +$visited = filter_input(INPUT_GET, 'visited', FILTER_SANITIZE_STRING); |
|
14 | 14 | if (session_status != PHP_SESSION_ACTIVE) { |
15 | 15 | session_start(); |
16 | 16 | } |
@@ -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 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $dummy_inst1 = _("identity provider"); |
48 | 48 | $dummy_inst2 = _("organisation"); |
49 | 49 | // and do something useless with the strings so that there's no "unused" complaint |
50 | - if ( $dummy_NRO . $dummy_inst1 . $dummy_inst2 == "") { |
|
50 | + if ($dummy_NRO . $dummy_inst1 . $dummy_inst2 == "") { |
|
51 | 51 | // Oh well. |
52 | 52 | } |
53 | 53 | $this->nomenclature_fed = _(CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_federation']); |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | break; |
188 | 188 | case "boolean": |
189 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>"; |
|
189 | + $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off")) . "</strong></td></tr>"; |
|
190 | 190 | break; |
191 | 191 | default: |
192 | 192 | $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | |
314 | 314 | private function checkROWIDpresence($reference) { |
315 | 315 | $found = preg_match("/^ROWID-.*/", $reference); |
316 | - if ($found != 1) { // get excited on not-found AND on execution error |
|
316 | + if ($found != 1) { // get excited on not-found AND on execution error |
|
317 | 317 | throw new Exception("Error, ROWID expected."); |
318 | 318 | } |
319 | 319 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | |
337 | 337 | $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']); |
338 | 338 | $details['name'] = preg_replace('/\//', "", $details['name']); |
339 | - $certstatus = ( $details['root'] == 1 ? "R" : "I"); |
|
339 | + $certstatus = ($details['root'] == 1 ? "R" : "I"); |
|
340 | 340 | if ($details['ca'] == 0 && $details['root'] != 1) { |
341 | 341 | return "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . _("This is a <strong>SERVER</strong> certificate!") . "<br/>" . $details['name'] . "</div>"; |
342 | 342 | } |
@@ -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 | } |