@@ -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 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 2 => ["AREA" => AbstractTest::INFRA_DEVICE, |
63 | 63 | "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), |
64 | 64 | "FACTOR" => 0.33, |
65 | - "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at home, but can not be used when roaming. %s"),$confAssistantText)], |
|
65 | + "VERDICTLECTURE" => sprintf(_("If roaming consistently does not work, then very likely your device configuration is wrong. Typical errors causing this symptom include: using a routing ('outer') username without the @realm.tld suffix - those potentially work at home, but can not be used when roaming. %s"), $confAssistantText)], |
|
66 | 66 | 3 => ["AREA" => AbstractTest::INFRA_DEVICE, |
67 | 67 | "TXT" => _("Did you recently change the configuration on your device?"), |
68 | 68 | "FACTOR" => 3, |
@@ -99,12 +99,12 @@ discard block |
||
99 | 99 | $questionDetails = $this->qaArray[$questionNumber]; |
100 | 100 | if ($answer === TRUE) { |
101 | 101 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR"]; |
102 | - $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR"]."\n"); |
|
102 | + $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR"] . "\n"); |
|
103 | 103 | $factor = $questionDetails["FACTOR"]; |
104 | 104 | } elseif ($answer === FALSE) { |
105 | 105 | $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] / $questionDetails["FACTOR"]; |
106 | - $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by 1/".$questionDetails["FACTOR"]."\n"); |
|
107 | - $factor = 1/$questionDetails["FACTOR"]; |
|
106 | + $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by 1/" . $questionDetails["FACTOR"] . "\n"); |
|
107 | + $factor = 1 / $questionDetails["FACTOR"]; |
|
108 | 108 | } else { |
109 | 109 | $factor = 1; |
110 | 110 | } |
@@ -113,8 +113,8 @@ discard block |
||
113 | 113 | $this->additionalFindings["QUESTIONSASKED"] = $this->previousQuestions; |
114 | 114 | $_SESSION["SUSPECTS"] = $this->possibleFailureReasons; |
115 | 115 | $_SESSION["EVIDENCE"] = $this->additionalFindings; |
116 | - $this->loggerInstance->debug(3,$_SESSION['SUSPECTS']); |
|
117 | - $this->loggerInstance->debug(3,$_SESSION['EVIDENCE']); |
|
116 | + $this->loggerInstance->debug(3, $_SESSION['SUSPECTS']); |
|
117 | + $this->loggerInstance->debug(3, $_SESSION['EVIDENCE']); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | public function questionOracle() { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | // if both are identical, take any of the questions in the pool of both |
129 | 129 | foreach ($this->qaArray as $questionNumber => $questionDetails) { |
130 | 130 | // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it |
131 | - if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory) ) { |
|
131 | + if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) { |
|
132 | 132 | return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]); |
133 | 133 | } |
134 | 134 | } |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | } |
138 | 138 | |
139 | 139 | public function getCurrentGuessState() { |
140 | - return json_encode([ "SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings ]); |
|
140 | + return json_encode(["SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings]); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | public function verdictText($area) { |
144 | 144 | $text = $this->genericVerdictTexts[$area]; |
145 | 145 | foreach ($this->previousQuestions as $number => $factor) { |
146 | 146 | if ($this->qaArray[$number]["AREA"] == $area && $factor > 1) { |
147 | - $text .= "\n\n".$this->qaArray[$number]["VERDICTLECTURE"]; |
|
147 | + $text .= "\n\n" . $this->qaArray[$number]["VERDICTLECTURE"]; |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | return $text; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $dummy_inst2 = _("organisation"); |
103 | 103 | // and do something useless with the strings so that there's no "unused" complaint |
104 | 104 | // by Scrutinizer |
105 | - if( $dummy_NRO . $dummy_inst1 . $dummy_inst2 == "") { |
|
105 | + if ($dummy_NRO . $dummy_inst1 . $dummy_inst2 == "") { |
|
106 | 106 | // oh well. |
107 | 107 | } |
108 | 108 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | if (isset($this->attributes['general:logo_file'])) { |
214 | 214 | $this->loggerInstance->debug(5, "saving IDP logo\n"); |
215 | - $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'],'idp'); |
|
215 | + $this->attributes['internal:logo_file'] = $this->saveLogoFile($this->attributes['general:logo_file'], 'idp'); |
|
216 | 216 | } |
217 | 217 | if (isset($this->attributes['fed:logo_file'])) { |
218 | 218 | $this->loggerInstance->debug(5, "saving FED logo\n"); |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | 'application/pdf' => 'pdf', |
553 | 553 | ]; |
554 | 554 | |
555 | - private function saveLogoFile($logos,$type) { |
|
555 | + private function saveLogoFile($logos, $type) { |
|
556 | 556 | $iterator = 0; |
557 | 557 | $returnarray = []; |
558 | 558 | foreach ($logos as $blob) { |
@@ -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 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | $lookFor .= "$name"; |
188 | 188 | } |
189 | - $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches); |
|
189 | + $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches); |
|
190 | 190 | if ($finding === 0 || $finding === FALSE) { |
191 | 191 | return FALSE; |
192 | 192 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $url = CONFIG_DIAGNOSTICS['eduGainResolver']['url'] . "?action=get_entity_name&type=idp&e_id=$idp&lang=pl"; |
208 | 208 | $ch = curl_init($url); |
209 | 209 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
210 | - curl_setopt($ch,CURLOPT_TIMEOUT, CONFIG_DIAGNOSTICS['eduGainResolver']['timeout']); |
|
210 | + curl_setopt($ch, CURLOPT_TIMEOUT, CONFIG_DIAGNOSTICS['eduGainResolver']['timeout']); |
|
211 | 211 | $response = curl_exec($ch); |
212 | 212 | if ($response == FALSE) { |
213 | 213 | $skipCurl = 1; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | case $providerStrings[3]: |
225 | 225 | case $providerStrings[4]: |
226 | 226 | case $providerStrings[5]: |
227 | - if (!in_array(User::PROVIDER_STRINGS[$matches[1]],$listOfProviders)) { |
|
227 | + if (!in_array(User::PROVIDER_STRINGS[$matches[1]], $listOfProviders)) { |
|
228 | 228 | $listOfProviders[] = User::PROVIDER_STRINGS[$matches[1]]; |
229 | 229 | } |
230 | 230 | break; |
@@ -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."); |