@@ -67,10 +67,11 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | function mainpage_url() { |
| 69 | 69 | $main_url = valid_host($_SERVER['HTTP_HOST']); |
| 70 | - if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") |
|
| 71 | - $main_url = "https://" . $main_url; |
|
| 72 | - else |
|
| 73 | - $main_url = "http://" . $main_url; |
|
| 70 | + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") { |
|
| 71 | + $main_url = "https://" . $main_url; |
|
| 72 | + } else { |
|
| 73 | + $main_url = "http://" . $main_url; |
|
| 74 | + } |
|
| 74 | 75 | $main_url .= substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], "/diag/")); |
| 75 | 76 | return $main_url; |
| 76 | 77 | } |
@@ -135,8 +136,9 @@ discard block |
||
| 135 | 136 | array_multisort($name, SORT_ASC, SORT_LOCALE_STRING, $displaylist); |
| 136 | 137 | setlocale(LC_ALL, $current_locale); |
| 137 | 138 | |
| 138 | - foreach ($displaylist as $id => $oneinst) |
|
| 139 | - echo "<option id='" . $id . "' value='" . $oneinst['realmlist'] . "'>" . $oneinst['name'] . "</option>"; |
|
| 139 | + foreach ($displaylist as $id => $oneinst) { |
|
| 140 | + echo "<option id='" . $id . "' value='" . $oneinst['realmlist'] . "'>" . $oneinst['name'] . "</option>"; |
|
| 141 | + } |
|
| 140 | 142 | ?> |
| 141 | 143 | </select> |
| 142 | 144 | <button type='submit' class='submit'><?php echo _("Submit Information"); ?></button> |
@@ -197,10 +199,12 @@ discard block |
||
| 197 | 199 | $checkresult[$number] = $check['instance']->UDP_reachability($number, FALSE, FALSE); |
| 198 | 200 | if ($checkresult[$number] == RETVAL_CONVERSATION_REJECT) { // so now things work?! |
| 199 | 201 | // either a packet size or Operator-Name problem! |
| 200 | - if ($check['instance']->UDP_reachability($number, TRUE, FALSE) != 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) != RETVAL_CONVERSATION_REJECT) |
|
| 203 | - $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "PACKETSIZE", "FROM" => $probe['display_name'], "DETAIL" => ""]; |
|
| 202 | + if ($check['instance']->UDP_reachability($number, TRUE, FALSE) != RETVAL_CONVERSATION_REJECT) { |
|
| 203 | + $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "OPERATOR-NAME", "FROM" => $probe['display_name'], "DETAIL" => ""]; |
|
| 204 | + } |
|
| 205 | + if ($check['instance']->UDP_reachability($number, FALSE, TRUE) != RETVAL_CONVERSATION_REJECT) { |
|
| 206 | + $realmproblems[] = ["REALM" => $check['realm'], "STATUS" => "PACKETSIZE", "FROM" => $probe['display_name'], "DETAIL" => ""]; |
|
| 207 | + } |
|
| 204 | 208 | } else { // still no response or immediate reject |
| 205 | 209 | // if this is a CAT realm with anon ID set, we can't be seeing an NPS ignorance problem |
| 206 | 210 | // and consequently, the realm has actual issues |
@@ -234,12 +238,13 @@ discard block |
||
| 234 | 238 | // re-write check history with that extra knowledge |
| 235 | 239 | $copycat = $realmproblems; |
| 236 | 240 | |
| 237 | - foreach ($realmproblems as &$problem) |
|
| 238 | - if ($problem['STATUS'] == "REALM_POSSIBLY_NPS") |
|
| 241 | + foreach ($realmproblems as &$problem) { |
|
| 242 | + if ($problem['STATUS'] == "REALM_POSSIBLY_NPS") |
|
| 239 | 243 | foreach ($copycat as $otherproblem) |
| 240 | 244 | if ($problem['REALM'] == $otherproblem['REALM'] && $problem['FROM'] != $otherproblem['FROM'] && $otherproblem['STATUS'] != "REALM_POSSIBLY_NPS") |
| 241 | 245 | if ($otherproblem['STATUS'] == "REACHABLE") { // worked elsewhere, but not on this probe: |
| 242 | 246 | $problem['STATUS'] = "REALM_DOWN"; |
| 247 | + } |
|
| 243 | 248 | } else { // inherit other problem; in any case not an NPS problem |
| 244 | 249 | $problem['STATUS'] = $otherproblem['STATUS']; |
| 245 | 250 | } |
@@ -249,11 +254,12 @@ discard block |
||
| 249 | 254 | |
| 250 | 255 | $copycat = $realmproblems; |
| 251 | 256 | |
| 252 | - foreach ($realmproblems as &$problem) |
|
| 253 | - if ($problem['STATUS'] == "REALM_DOWN") |
|
| 257 | + foreach ($realmproblems as &$problem) { |
|
| 258 | + if ($problem['STATUS'] == "REALM_DOWN") |
|
| 254 | 259 | foreach ($copycat as $otherproblem) |
| 255 | 260 | if ($problem['REALM'] == $otherproblem['REALM'] && $problem['FROM'] != $otherproblem['FROM'] && $otherproblem['STATUS'] == "REACHABLE") |
| 256 | 261 | $problem['STATUS'] = "INFRASTRUCTURE"; |
| 262 | + } |
|
| 257 | 263 | unset($problem); |
| 258 | 264 | |
| 259 | 265 | // finally, extract all certprobs we got from the reachability checks; merge from all |
@@ -264,8 +270,9 @@ discard block |
||
| 264 | 270 | foreach ($checks as $check) { |
| 265 | 271 | $instance = $check['instance']; |
| 266 | 272 | $resultset = $instance->UDP_reachability_result; |
| 267 | - foreach ($resultset as $result) |
|
| 268 | - $all_certprobs = array_merge($all_certprobs, $result['cert_oddities']); |
|
| 273 | + foreach ($resultset as $result) { |
|
| 274 | + $all_certprobs = array_merge($all_certprobs, $result['cert_oddities']); |
|
| 275 | + } |
|
| 269 | 276 | } |
| 270 | 277 | echo "<pre>"; |
| 271 | 278 | print_r($realmproblems); |
@@ -44,10 +44,11 @@ discard block |
||
| 44 | 44 | // NAPTR existence check |
| 45 | 45 | $tabletext .= "<td>"; |
| 46 | 46 | $naptr = $testsuite->NAPTR(); |
| 47 | - if ($naptr != RETVAL_NOTCONFIGURED) |
|
| 48 | - switch ($naptr) { |
|
| 47 | + if ($naptr != RETVAL_NOTCONFIGURED) { |
|
| 48 | + switch ($naptr) { |
|
| 49 | 49 | case RETVAL_NONAPTR: |
| 50 | 50 | $tabletext .= _("No NAPTR records"); |
| 51 | + } |
|
| 51 | 52 | break; |
| 52 | 53 | case RETVAL_ONLYUNRELATEDNAPTR: |
| 53 | 54 | $tabletext .= sprintf(_("No associated NAPTR records")); |
@@ -73,8 +74,9 @@ discard block |
||
| 73 | 74 | } |
| 74 | 75 | if ($srv > 0) { |
| 75 | 76 | $hosts = $testsuite->NAPTR_hostnames(); |
| 76 | - if ($hosts == RETVAL_INVALID) |
|
| 77 | - $NAPTR_issues = true; |
|
| 77 | + if ($hosts == RETVAL_INVALID) { |
|
| 78 | + $NAPTR_issues = true; |
|
| 79 | + } |
|
| 78 | 80 | } |
| 79 | 81 | break; |
| 80 | 82 | } |
@@ -91,14 +93,17 @@ discard block |
||
| 91 | 93 | foreach (Config::$RADIUSTESTS['UDP-hosts'] as $hostindex => $host) { |
| 92 | 94 | $testsuite->UDP_reachability($hostindex, true, true); |
| 93 | 95 | $results = $testsuite->UDP_reachability_result[$hostindex]; |
| 94 | - if ($results['packetflow_sane'] != TRUE) |
|
| 95 | - $UDPErrors = true; |
|
| 96 | - if (empty($results['packetflow'][11])) |
|
| 97 | - $UDPErrors = true; |
|
| 96 | + if ($results['packetflow_sane'] != TRUE) { |
|
| 97 | + $UDPErrors = true; |
|
| 98 | + } |
|
| 99 | + if (empty($results['packetflow'][11])) { |
|
| 100 | + $UDPErrors = true; |
|
| 101 | + } |
|
| 98 | 102 | if (count($results['cert_oddities']) > 0) { |
| 99 | - foreach ($results['cert_oddities'] as $oddity) |
|
| 100 | - if ($oddity['level'] > $certBiggestOddity) |
|
| 103 | + foreach ($results['cert_oddities'] as $oddity) { |
|
| 104 | + if ($oddity['level'] > $certBiggestOddity) |
|
| 101 | 105 | $certBiggestOddity = $oddity['level']; |
| 106 | + } |
|
| 102 | 107 | } |
| 103 | 108 | } |
| 104 | 109 | |
@@ -119,8 +124,9 @@ discard block |
||
| 119 | 124 | if ($naptr > 0 && count($testsuite->NAPTR_hostname_records) > 0) { |
| 120 | 125 | foreach ($testsuite->NAPTR_hostname_records as $hostindex => $addr) { |
| 121 | 126 | $retval = $testsuite->TLS_clients_side_check($addr); |
| 122 | - if ($retval != RETVAL_OK && $retval != RETVAL_SKIPPED) |
|
| 123 | - $dynamicErrors = true; |
|
| 127 | + if ($retval != RETVAL_OK && $retval != RETVAL_SKIPPED) { |
|
| 128 | + $dynamicErrors = true; |
|
| 129 | + } |
|
| 124 | 130 | } |
| 125 | 131 | } |
| 126 | 132 | if (!$dynamicErrors) { |
@@ -162,10 +168,11 @@ discard block |
||
| 162 | 168 | $profiles_showtime = []; |
| 163 | 169 | $profiles_readyconf = []; |
| 164 | 170 | |
| 165 | -foreach ($allIDPs as $index => $oneidp) |
|
| 171 | +foreach ($allIDPs as $index => $oneidp) { |
|
| 166 | 172 | foreach ($oneidp['instance']->listProfiles() as $profile) |
| 167 | 173 | if ($profile->isShowtime()) { |
| 168 | 174 | $profiles_showtime[] = ['idp' => $oneidp['instance'], 'profile' => $profile]; |
| 175 | +} |
|
| 169 | 176 | } else if ($profile->readyForShowtime()) { |
| 170 | 177 | $profiles_confready[] = ['idp' => $oneidp['instance'], 'profile' => $profile]; |
| 171 | 178 | } |
@@ -173,16 +180,18 @@ discard block |
||
| 173 | 180 | if (count($profiles_showtime) > 0) { |
| 174 | 181 | echo "<h2>" . _("Profiles marked as visible (V)") . "</h2>" . "<table>"; |
| 175 | 182 | echo rowdescription(); |
| 176 | - foreach ($profiles_showtime as $oneprofile) |
|
| 177 | - echo profilechecks($oneprofile['idp'], $oneprofile['profile']); |
|
| 183 | + foreach ($profiles_showtime as $oneprofile) { |
|
| 184 | + echo profilechecks($oneprofile['idp'], $oneprofile['profile']); |
|
| 185 | + } |
|
| 178 | 186 | echo "</table>"; |
| 179 | 187 | } |
| 180 | 188 | |
| 181 | 189 | if (count($profiles_confready) > 0) { |
| 182 | 190 | echo "<h2>" . _("Profiles with sufficient configuration, not marked as visible (C)") . "</h2>" . "<table>"; |
| 183 | 191 | echo rowdescription(); |
| 184 | - foreach ($profiles_confready as $oneprofile) |
|
| 185 | - echo profilechecks($oneprofile['idp'], $oneprofile['profile']); |
|
| 192 | + foreach ($profiles_confready as $oneprofile) { |
|
| 193 | + echo profilechecks($oneprofile['idp'], $oneprofile['profile']); |
|
| 194 | + } |
|
| 186 | 195 | echo "</table>"; |
| 187 | 196 | } |
| 188 | 197 | ?> |