@@ -134,8 +134,9 @@ discard block |
||
134 | 134 | array_multisort($name, SORT_ASC, SORT_LOCALE_STRING, $displaylist); |
135 | 135 | setlocale(LC_ALL, $current_locale); |
136 | 136 | |
137 | - foreach ($displaylist as $id => $oneinst) |
|
138 | - echo "<option id='" . $id . "' value='" . $oneinst['realmlist'] . "'>" . $oneinst['name'] . "</option>"; |
|
137 | + foreach ($displaylist as $id => $oneinst) { |
|
138 | + echo "<option id='" . $id . "' value='" . $oneinst['realmlist'] . "'>" . $oneinst['name'] . "</option>"; |
|
139 | + } |
|
139 | 140 | ?> |
140 | 141 | </select> |
141 | 142 | <button type='submit' class='submit'><?php echo _("Submit Information"); ?></button> |
@@ -197,10 +198,12 @@ discard block |
||
197 | 198 | $checkresult[$number] = $check['instance']->UDP_reachability($number, FALSE, FALSE); |
198 | 199 | if ($checkresult[$number] == \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT) { // so now things work?! |
199 | 200 | // either a packet size or Operator-Name problem! |
200 | - if ($check['instance']->UDP_reachability($number, TRUE, FALSE) != \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT) |
|
201 | - $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "OPERATOR-NAME", "FROM" => $probe['display_name'], "DETAIL" => ""]; |
|
202 | - if ($check['instance']->UDP_reachability($number, FALSE, TRUE) != \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT) |
|
203 | - $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "PACKETSIZE", "FROM" => $probe['display_name'], "DETAIL" => ""]; |
|
201 | + if ($check['instance']->UDP_reachability($number, TRUE, FALSE) != \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT) { |
|
202 | + $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "OPERATOR-NAME", "FROM" => $probe['display_name'], "DETAIL" => ""]; |
|
203 | + } |
|
204 | + if ($check['instance']->UDP_reachability($number, FALSE, TRUE) != \core\diag\RADIUSTests::RETVAL_CONVERSATION_REJECT) { |
|
205 | + $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "PACKETSIZE", "FROM" => $probe['display_name'], "DETAIL" => ""]; |
|
206 | + } |
|
204 | 207 | } else { // still no response or immediate reject |
205 | 208 | // if this is a CAT realm with anon ID set, we can't be seeing an NPS ignorance problem |
206 | 209 | // and consequently, the realm has actual issues |
@@ -234,12 +237,13 @@ discard block |
||
234 | 237 | // re-write check history with that extra knowledge |
235 | 238 | $copycat = $realmproblems; |
236 | 239 | |
237 | - foreach ($realmproblems as &$problem) |
|
238 | - if ($problem['STATUS'] == "REALM_POSSIBLY_NPS") |
|
240 | + foreach ($realmproblems as &$problem) { |
|
241 | + if ($problem['STATUS'] == "REALM_POSSIBLY_NPS") |
|
239 | 242 | foreach ($copycat as $otherproblem) |
240 | 243 | if ($problem['REALM'] == $otherproblem['REALM'] && $problem['FROM'] != $otherproblem['FROM'] && $otherproblem['STATUS'] != "REALM_POSSIBLY_NPS") |
241 | 244 | if ($otherproblem['STATUS'] == "REACHABLE") { // worked elsewhere, but not on this probe: |
242 | 245 | $problem['STATUS'] = "REALM_DOWN"; |
246 | + } |
|
243 | 247 | } else { // inherit other problem; in any case not an NPS problem |
244 | 248 | $problem['STATUS'] = $otherproblem['STATUS']; |
245 | 249 | } |
@@ -249,11 +253,12 @@ discard block |
||
249 | 253 | |
250 | 254 | $copycat = $realmproblems; |
251 | 255 | |
252 | - foreach ($realmproblems as &$problem) |
|
253 | - if ($problem['STATUS'] == "REALM_DOWN") |
|
256 | + foreach ($realmproblems as &$problem) { |
|
257 | + if ($problem['STATUS'] == "REALM_DOWN") |
|
254 | 258 | foreach ($copycat as $otherproblem) |
255 | 259 | if ($problem['REALM'] == $otherproblem['REALM'] && $problem['FROM'] != $otherproblem['FROM'] && $otherproblem['STATUS'] == "REACHABLE") |
256 | 260 | $problem['STATUS'] = "INFRASTRUCTURE"; |
261 | + } |
|
257 | 262 | unset($problem); |
258 | 263 | |
259 | 264 | // finally, extract all certprobs we got from the reachability checks; merge from all |
@@ -264,8 +269,9 @@ discard block |
||
264 | 269 | foreach ($checks as $check) { |
265 | 270 | $instance = $check['instance']; |
266 | 271 | $resultset = $instance->UDP_reachability_result; |
267 | - foreach ($resultset as $result) |
|
268 | - $all_certprobs = array_merge($all_certprobs, $result['cert_oddities']); |
|
272 | + foreach ($resultset as $result) { |
|
273 | + $all_certprobs = array_merge($all_certprobs, $result['cert_oddities']); |
|
274 | + } |
|
269 | 275 | } |
270 | 276 | |
271 | 277 | // now we have something to say... |
@@ -167,10 +167,10 @@ |
||
167 | 167 | $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, $profile->getRealmCheckOuterUsername(), \core\common\EAP::multiConversion($profile->getEapMethodsinOrderOfPreference(1)), $profile->getCollapsedAttributes()['eap:server_name'], $profile->getCollapsedAttributes()['eap:ca_file']), "class" => "CAT", "profile" => $profile]; |
168 | 168 | echo "Debugging CAT Profile $profile_id for $sanitised_realm<br/>"; |
169 | 169 | } else if (!empty($cat->getExternalDBEntityDetails(0, $realm))) { |
170 | - $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, "@".$sanitised_realm), "class" => "EXT_DB"]; |
|
170 | + $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, "@" . $sanitised_realm), "class" => "EXT_DB"]; |
|
171 | 171 | echo "Debugging non-CAT but existing realm $sanitised_realm<br/>"; |
172 | 172 | } else { |
173 | - $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, "@".$sanitised_realm), "class" => "ALIEN"]; |
|
173 | + $checks[] = ["realm" => $sanitised_realm, "instance" => new \core\diag\RADIUSTests($sanitised_realm, "@" . $sanitised_realm), "class" => "ALIEN"]; |
|
174 | 174 | echo "Debugging non-existing realm $sanitised_realm<br/>"; |
175 | 175 | } |
176 | 176 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if (isset($Cache[$entry])) { |
42 | 42 | continue; |
43 | 43 | } |
44 | - \core\common\Entity::rrmdir($downloads . '/' . $entry); |
|
44 | + \core\common\Entity::rrmdir($downloads . '/' . $entry); |
|
45 | 45 | print "$entry\n"; |
46 | 46 | } |
47 | 47 | closedir($handle); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if ($ftime < 3600) { |
57 | 57 | continue; |
58 | 58 | } |
59 | - \core\common\Entity::rrmdir($downloads . '/' . $entry); |
|
59 | + \core\common\Entity::rrmdir($downloads . '/' . $entry); |
|
60 | 60 | print "$entry\n"; |
61 | 61 | } |
62 | 62 | closedir($handle); |
@@ -65,7 +65,7 @@ |
||
65 | 65 | $outString .= "# save user certificate\n"; |
66 | 66 | $outString .= 'echo "'; |
67 | 67 | $outString .= base64_encode($this->clientCert["certdata"]) |
68 | - . '" | base64 -d ' . " > \$HOME/$this->localDir/user.p12\n"; |
|
68 | + . '" | base64 -d ' . " > \$HOME/$this->localDir/user.p12\n"; |
|
69 | 69 | } |
70 | 70 | if ($this->selectedEap == \core\common\EAP::EAPTYPE_TLS || $this->selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) { |
71 | 71 | $outString .= $this->printP12Dialog(); |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | # will be the default value prompted to the user |
185 | 185 | |
186 | 186 | private function printFunctions() { |
187 | - $url = (isset($this->attributes['support:url'][0]) && $this->attributes['support:url'][0] ) ? $this->attributes['support:url'][0] : $this->support_url_substitute; |
|
188 | - $support = (isset($this->attributes['support:email'][0]) && $this->attributes['support:email'][0] ) ? $this->attributes['support:email'][0] : $this->support_email_substitute; |
|
187 | + $url = (isset($this->attributes['support:url'][0]) && $this->attributes['support:url'][0]) ? $this->attributes['support:url'][0] : $this->support_url_substitute; |
|
188 | + $support = (isset($this->attributes['support:email'][0]) && $this->attributes['support:email'][0]) ? $this->attributes['support:email'][0] : $this->support_email_substitute; |
|
189 | 189 | $out = ' |
190 | 190 | my_name=$0 |
191 | 191 | |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | '; |
481 | 481 | } |
482 | 482 | $cert_prompt = $this->selectedEap == \core\common\EAP::EAPTYPE_TLS ? _("enter the password for the certificate file") : _("enter your import password"); |
483 | - $out .= ' cert=$HOME/' . $this->localDir . '/user.p12 |
|
483 | + $out .= ' cert=$HOME/' . $this->localDir . '/user.p12 |
|
484 | 484 | |
485 | 485 | PASSWORD="" |
486 | 486 | prompt="' . $cert_prompt . '" |
@@ -11,15 +11,15 @@ |
||
11 | 11 | namespace devices\redirect_dev; |
12 | 12 | |
13 | 13 | class Device_RedirectDev extends \core\DeviceConfig { |
14 | - /** |
|
15 | - * Constructs a Device object. |
|
16 | - * |
|
17 | - * @final not to be redefined |
|
18 | - */ |
|
14 | + /** |
|
15 | + * Constructs a Device object. |
|
16 | + * |
|
17 | + * @final not to be redefined |
|
18 | + */ |
|
19 | 19 | final public function __construct() { |
20 | 20 | parent::__construct(); |
21 | - $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]); |
|
22 | - $this->loggerInstance->debug(4,"RedirectEx called"); |
|
21 | + $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]); |
|
22 | + $this->loggerInstance->debug(4,"RedirectEx called"); |
|
23 | 23 | } |
24 | 24 | public function writeDeviceInfo() { |
25 | 25 | $out = "<p>"; |
@@ -19,7 +19,7 @@ |
||
19 | 19 | final public function __construct() { |
20 | 20 | parent::__construct(); |
21 | 21 | $this->setSupportedEapMethods([\core\common\EAP::EAPTYPE_NONE]); |
22 | - $this->loggerInstance->debug(4,"RedirectEx called"); |
|
22 | + $this->loggerInstance->debug(4, "RedirectEx called"); |
|
23 | 23 | } |
24 | 24 | public function writeDeviceInfo() { |
25 | 25 | $out = "<p>"; |
@@ -206,8 +206,7 @@ |
||
206 | 206 | $cutoffPosition = strrpos($_SERVER['PHP_SELF'], "accountstatus/"); |
207 | 207 | } elseif (strrpos($_SERVER['PHP_SELF'], "diag/")) { |
208 | 208 | $cutoffPosition = strrpos($_SERVER['PHP_SELF'], "diag/"); |
209 | - } |
|
210 | - else { |
|
209 | + } else { |
|
211 | 210 | $cutoffPosition = strrpos($_SERVER['PHP_SELF'], "/"); |
212 | 211 | } |
213 | 212 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | <select id='lang' name='lang' onchange='this.form.submit()'>"; |
66 | 66 | |
67 | 67 | foreach (CONFIG['LANGUAGES'] as $lang => $value) { |
68 | - $retval .= "<option value='$lang' " . (strtoupper($language) == strtoupper($lang) ? "selected" : "" ) . " >" . $value['display'] . "</option> "; |
|
68 | + $retval .= "<option value='$lang' " . (strtoupper($language) == strtoupper($lang) ? "selected" : "") . " >" . $value['display'] . "</option> "; |
|
69 | 69 | } |
70 | 70 | $retval .= "</select>"; |
71 | 71 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $retval .= "</form> |
78 | 78 | </div><!--langselection-->"; |
79 | 79 | |
80 | - $logoUrl = "//" . $this->validator->hostname($_SERVER['SERVER_NAME']) . substr($_SERVER['PHP_SELF'], 0, (strrpos($_SERVER['PHP_SELF'], "admin/") !== FALSE ? strrpos($_SERVER['PHP_SELF'], "admin/") : strrpos($_SERVER['PHP_SELF'], "/")))."/resources/images/consortium_logo.png"; |
|
80 | + $logoUrl = "//" . $this->validator->hostname($_SERVER['SERVER_NAME']) . substr($_SERVER['PHP_SELF'], 0, (strrpos($_SERVER['PHP_SELF'], "admin/") !== FALSE ? strrpos($_SERVER['PHP_SELF'], "admin/") : strrpos($_SERVER['PHP_SELF'], "/"))) . "/resources/images/consortium_logo.png"; |
|
81 | 81 | $retval .= "<div class='consortium_logo'> |
82 | 82 | <img id='test_locate' src='$logoUrl' alt='Consortium Logo'> |
83 | 83 | </div> <!-- consortium_logo --> |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | switch ($area) { |
120 | 120 | case "ADMIN-IDP": |
121 | 121 | $cap1 = CONFIG['APPEARANCE']['productname_long']; |
122 | - $cap2 = sprintf(_("Administrator Interface - Identity Provider"),$this->ui->nomenclature_inst); |
|
122 | + $cap2 = sprintf(_("Administrator Interface - Identity Provider"), $this->ui->nomenclature_inst); |
|
123 | 123 | $advancedControls = TRUE; |
124 | 124 | break; |
125 | 125 | case "ADMIN-IDP-USERS": |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | break; |
140 | 140 | case "FEDERATION": |
141 | 141 | $cap1 = CONFIG['APPEARANCE']['productname_long']; |
142 | - $cap2 = sprintf(_("Administrator Interface - %s Management"),$this->ui->nomenclature_fed); |
|
142 | + $cap2 = sprintf(_("Administrator Interface - %s Management"), $this->ui->nomenclature_fed); |
|
143 | 143 | $advancedControls = TRUE; |
144 | 144 | break; |
145 | 145 | case "USER": |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | // content from here on will SCROLL instead of being fixed at the top |
169 | 169 | $retval .= "<div class='pagecontent'>"; // closes in footer again |
170 | 170 | $retval .= "<div class='trick'>"; // closes in footer again |
171 | - $retval .= "<div id='secondrow' style='border-bottom:5px solid ".CONFIG['APPEARANCE']['colour1']."; min-height:100px;'> |
|
171 | + $retval .= "<div id='secondrow' style='border-bottom:5px solid " . CONFIG['APPEARANCE']['colour1'] . "; min-height:100px;'> |
|
172 | 172 | <div id='secondarycaptions' style='display:inline-block; float:left'> |
173 | 173 | <h2>$cap2</h2> |
174 | 174 | </div><!--secondarycaptions-->"; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $cutoffPosition = strrpos($_SERVER['PHP_SELF'], "/"); |
214 | 214 | } |
215 | 215 | |
216 | - $cssUrl = "//" . $this->validator->hostname($_SERVER['SERVER_NAME']) . substr($_SERVER['PHP_SELF'], 0, $cutoffPosition )."/resources/css/cat.css.php"; |
|
216 | + $cssUrl = "//" . $this->validator->hostname($_SERVER['SERVER_NAME']) . substr($_SERVER['PHP_SELF'], 0, $cutoffPosition) . "/resources/css/cat.css.php"; |
|
217 | 217 | |
218 | 218 | $retval .= "<link rel='stylesheet' type='text/css' href='$cssUrl' />"; |
219 | 219 | $retval .= "<title>" . htmlspecialchars($pagetitle) . "</title>"; |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $cutoffPosition = strrpos($_SERVER['PHP_SELF'], "/"); |
242 | 242 | } |
243 | 243 | |
244 | - $logoBase = "//" . $this->validator->hostname($_SERVER['SERVER_NAME']) . substr($_SERVER['PHP_SELF'], 0, $cutoffPosition)."/resources/images"; |
|
244 | + $logoBase = "//" . $this->validator->hostname($_SERVER['SERVER_NAME']) . substr($_SERVER['PHP_SELF'], 0, $cutoffPosition) . "/resources/images"; |
|
245 | 245 | |
246 | 246 | return "<span id='logos' style='position:fixed; left:50%;'><img src='$logoBase/dante.png' alt='DANTE' style='height:23px;width:47px'/> |
247 | 247 | <img src='$logoBase/eu.png' alt='EU' style='height:23px;width:27px;border-width:0px;'/></span> |
@@ -246,11 +246,11 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
249 | - * This function parses a X.509 cert and returns all certificatePolicies OIDs |
|
250 | - * |
|
251 | - * @param array $cert (returned from openssl_x509_parse) |
|
252 | - * @return array of OIDs |
|
253 | - */ |
|
249 | + * This function parses a X.509 cert and returns all certificatePolicies OIDs |
|
250 | + * |
|
251 | + * @param array $cert (returned from openssl_x509_parse) |
|
252 | + * @return array of OIDs |
|
253 | + */ |
|
254 | 254 | private function propertyCheckPolicy($cert) { |
255 | 255 | $oids = []; |
256 | 256 | if ($cert['extensions']['certificatePolicies']) { |
@@ -263,11 +263,11 @@ discard block |
||
263 | 263 | return $oids; |
264 | 264 | } |
265 | 265 | /** |
266 | - * This function parses a X.509 cert and returns the value of $field |
|
267 | - * |
|
268 | - * @param array $cert (returned from openssl_x509_parse) |
|
269 | - * @return string value of the issuer field or '' |
|
270 | - */ |
|
266 | + * This function parses a X.509 cert and returns the value of $field |
|
267 | + * |
|
268 | + * @param array $cert (returned from openssl_x509_parse) |
|
269 | + * @return string value of the issuer field or '' |
|
270 | + */ |
|
271 | 271 | private function getCertificateIssuer($cert) { |
272 | 272 | $issuer = ''; |
273 | 273 | foreach ($cert['issuer'] as $key => $val) { |
@@ -478,6 +478,9 @@ discard block |
||
478 | 478 | return $cmdline; |
479 | 479 | } |
480 | 480 | |
481 | + /** |
|
482 | + * @param string $tmpDir |
|
483 | + */ |
|
481 | 484 | private function thoroughChainChecks(&$testresults, &$intermOdditiesCAT, $tmpDir, $servercert, $eapIntermediates, $eapIntermediateCRLs) { |
482 | 485 | |
483 | 486 | // collect CA certificates, both the incoming EAP chain and from CAT config |
@@ -636,6 +639,14 @@ discard block |
||
636 | 639 | } |
637 | 640 | } |
638 | 641 | |
642 | + /** |
|
643 | + * @param string $tmpDir |
|
644 | + * @param integer $probeindex |
|
645 | + * @param string $innerUser |
|
646 | + * @param string $password |
|
647 | + * @param boolean $opnameCheck |
|
648 | + * @param boolean $frag |
|
649 | + */ |
|
639 | 650 | private function executeEapolTest($tmpDir, $probeindex, $eaptype, $innerUser, $password, $opnameCheck, $frag) { |
640 | 651 | $finalInner = $innerUser; |
641 | 652 | $finalOuter = $this->outerUsernameForChecks; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @param AbstractPage $page |
29 | 29 | */ |
30 | - public function __construct($page){ |
|
30 | + public function __construct($page) { |
|
31 | 31 | $this->page = $page; |
32 | 32 | $this->session = SessionStorage::getInstance('sb-messages'); |
33 | 33 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @return AbstractPage |
38 | 38 | */ |
39 | - public function getPage(){ |
|
39 | + public function getPage() { |
|
40 | 40 | return $this->page; |
41 | 41 | } |
42 | 42 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @return \web\lib\admin\storage\SessionStorage |
47 | 47 | */ |
48 | - public function getSession(){ |
|
48 | + public function getSession() { |
|
49 | 49 | return $this->session; |
50 | 50 | } |
51 | 51 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @author Zilvinas Vaira |
11 | 11 | * |
12 | 12 | */ |
13 | -abstract class AbstractAjaxCommand extends AbstractCommand{ |
|
13 | +abstract class AbstractAjaxCommand extends AbstractCommand { |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @param string $commandToken |
24 | 24 | * @param DefaultContext $context |
25 | 25 | */ |
26 | - public function __construct($commandToken, $context){ |
|
26 | + public function __construct($commandToken, $context) { |
|
27 | 27 | parent::__construct($commandToken); |
28 | 28 | $this->page = $context->getPage(); |
29 | 29 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | * |
33 | 33 | * @param HtmlElementInterface $element |
34 | 34 | */ |
35 | - public function publish($element){ |
|
35 | + public function publish($element) { |
|
36 | 36 | $this->page->appendHtmlElement(DefaultAjaxPage::SECTION_RESPONSE, $element); |
37 | 37 | } |
38 | 38 |