Passed
Push — master ( ad14f0...c92d2f )
by Maja
04:10
created
core/diag/Sociopath.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -57,34 +57,34 @@
 block discarded – undo
57 57
         $confAssistantText = _("You should use appropriate configuration assistants [MGW: see if the realm exists in CAT, then display link to config] or contact your Identity Provider [MGW: show contact info].");
58 58
         $this->qaArray = [
59 59
             0 => ["AREA" => AbstractTest::INFRA_DEVICE,
60
-                  "TXT" => _("Have you ever used the network succesfully, e.g. at your home institution without roaming?"),
61
-                  "FACTOR" => 0.5,
62
-                  "VERDICTLECTURE" => sprintf(_("If your device has never worked before with this setup, then very likely your device configuation is wrong. %s"), $confAssistantText)],
60
+                    "TXT" => _("Have you ever used the network succesfully, e.g. at your home institution without roaming?"),
61
+                    "FACTOR" => 0.5,
62
+                    "VERDICTLECTURE" => sprintf(_("If your device has never worked before with this setup, then very likely your device configuation is wrong. %s"), $confAssistantText)],
63 63
             1 => ["AREA" => AbstractTest::INFRA_DEVICE, 
64
-                  "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), 
65
-                  "FACTOR" => 0.33,
66
-                  "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)],
64
+                    "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), 
65
+                    "FACTOR" => 0.33,
66
+                    "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)],
67 67
             2 => ["AREA" => AbstractTest::INFRA_DEVICE, 
68
-                  "TXT" => _("Did you recently change the configuration on your device?"), 
69
-                  "FACTOR" => 3,
70
-                  "VERDICTLECTURE" => _("Accounts only need to be configured once, and can then be used anywhere on the planet without any changes. If you recently changed the configuration, that change may very well be at fault. You should never change your network configuration unless explicitly instructed so by your Identity Provider; even in the case of temporary login issues.")],
68
+                    "TXT" => _("Did you recently change the configuration on your device?"), 
69
+                    "FACTOR" => 3,
70
+                    "VERDICTLECTURE" => _("Accounts only need to be configured once, and can then be used anywhere on the planet without any changes. If you recently changed the configuration, that change may very well be at fault. You should never change your network configuration unless explicitly instructed so by your Identity Provider; even in the case of temporary login issues.")],
71 71
             3 => ["AREA" => AbstractTest::INFRA_DEVICE, 
72
-                  "TXT" => _("Do your other devices still work?"),
73
-                  "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"),
74
-                  "FACTOR" => 0.33],
72
+                    "TXT" => _("Do your other devices still work?"),
73
+                    "VERDICTLECTURE" => _("If all devices stopped working simultaneously, there may be a problem with your account as such. Maybe your account expired, or you were forced to change the password? These questions are best answered by your Identity Provider [MGW: display contact info]"),
74
+                    "FACTOR" => 0.33],
75 75
             4 => ["AREA" => AbstractTest::INFRA_SP_80211, 
76
-                  "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), 
77
-                  "FACTOR" => 3,
78
-                  "VERDICTLECTURE" => _("The network is likely overloaded at this location and point in time. You may have to wait until later before you get a better connectivity. If you think the network should be reinforced for more capacity at this place, you should inform the hotspot provider. [MGW: add contact info]")],            
76
+                    "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), 
77
+                    "FACTOR" => 3,
78
+                    "VERDICTLECTURE" => _("The network is likely overloaded at this location and point in time. You may have to wait until later before you get a better connectivity. If you think the network should be reinforced for more capacity at this place, you should inform the hotspot provider. [MGW: add contact info]")],            
79 79
             5 => ["AREA" => AbstractTest::INFRA_SP_80211, 
80
-                  "TXT" => _("Does the connection get better when you move around?"), 
81
-                  "FACTOR" => 3,
82
-                  "VERDICTLECTURE" => _("You should move to a different location to achieve better network coverage and service. If you think the exact spot you are at deserves better coverage, you should inform the hotspot provider. [MGW: add contact info]")],
80
+                    "TXT" => _("Does the connection get better when you move around?"), 
81
+                    "FACTOR" => 3,
82
+                    "VERDICTLECTURE" => _("You should move to a different location to achieve better network coverage and service. If you think the exact spot you are at deserves better coverage, you should inform the hotspot provider. [MGW: add contact info]")],
83 83
             
84 84
             6 => ["AREA" => AbstractTest::INFRA_SP_LAN, 
85
-                  "TXT" => _("Do you see errors stating something similar to 'Unable to get IP address'?"), 
86
-                  "FACTOR" => 3,
87
-                  "VERDICTLECTURE" => _("The evidence at hand suggests that there may be an infrastructure problem at this particular hotspot provider. There is nothing you can do to solve this problem locally. Please be patient and try again at a later time.")],
85
+                    "TXT" => _("Do you see errors stating something similar to 'Unable to get IP address'?"), 
86
+                    "FACTOR" => 3,
87
+                    "VERDICTLECTURE" => _("The evidence at hand suggests that there may be an infrastructure problem at this particular hotspot provider. There is nothing you can do to solve this problem locally. Please be patient and try again at a later time.")],
88 88
         ];
89 89
     }
90 90
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             1 => ["AREA" => AbstractTest::INFRA_DEVICE, 
64 64
                   "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), 
65 65
                   "FACTOR" => 0.33,
66
-                  "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
+                  "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)],
67 67
             2 => ["AREA" => AbstractTest::INFRA_DEVICE, 
68 68
                   "TXT" => _("Did you recently change the configuration on your device?"), 
69 69
                   "FACTOR" => 3,
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
         $questionDetails = $this->qaArray[$questionNumber];
98 98
         if ($answer === TRUE) {
99 99
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR"];
100
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR"]."\n");
100
+            $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR"] . "\n");
101 101
             $factor = $questionDetails["FACTOR"];
102 102
         } elseif ($answer === FALSE) {
103 103
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] / $questionDetails["FACTOR"];
104
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by 1/".$questionDetails["FACTOR"]."\n");
105
-            $factor = 1/$questionDetails["FACTOR"];
104
+            $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by 1/" . $questionDetails["FACTOR"] . "\n");
105
+            $factor = 1 / $questionDetails["FACTOR"];
106 106
         } else {
107 107
             $factor = 1;
108 108
         }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $this->additionalFindings["QUESTIONSASKED"] = $this->previousQuestions;
112 112
         $_SESSION["SUSPECTS"] = $this->possibleFailureReasons;
113 113
         $_SESSION["EVIDENCE"] = $this->additionalFindings;
114
-        $this->loggerInstance->debug(3,$_SESSION['SUSPECTS']);
114
+        $this->loggerInstance->debug(3, $_SESSION['SUSPECTS']);
115 115
     }
116 116
     
117 117
     public function questionOracle() {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         // if both are identical, take any of the questions in the pool of both
126 126
         foreach ($this->qaArray as $questionNumber => $questionDetails) {
127 127
             // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it
128
-            if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory) ) {
128
+            if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) {
129 129
                 return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]);
130 130
             }
131 131
         }
@@ -134,14 +134,14 @@  discard block
 block discarded – undo
134 134
     }
135 135
     
136 136
     public function getCurrentGuessState() {
137
-        return json_encode([ "SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings ]);
137
+        return json_encode(["SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings]);
138 138
     }
139 139
     
140 140
     public function verdictText($area) {
141 141
         $text = $this->genericVerdictTexts[$area];
142 142
         foreach ($this->previousQuestions as $number => $factor) {
143 143
             if ($this->qaArray[$number]["AREA"] == $area && $factor > 1) {
144
-                $text .= "\n\n".$this->qaArray[$number]["VERDICTLECTURE"];
144
+                $text .= "\n\n" . $this->qaArray[$number]["VERDICTLECTURE"];
145 145
             }
146 146
         }
147 147
         return $text;
Please login to merge, or discard this patch.
core/diag/Logopath.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
         $this->possibleFailureReasons = $_SESSION["SUSPECTS"] ?? []; // if we know nothing, don't talk to anyone
43 43
         $this->additionalFindings = $_SESSION["EVIDENCE"] ?? [];
44 44
         
45
-        $this->subjectPrefix = _("[eduroam Diagnostics]")." ";
45
+        $this->subjectPrefix = _("[eduroam Diagnostics]") . " ";
46 46
         $this->finalGreeting = "\n"
47 47
                 . _("(This service is in an early stage. We apologise if this is a false alert. If this is the case, please send an email report to [email protected], forwarding the entire message (including the 'SUSPECTS' and 'EVIDENCE' data at the end), and explain why this is a false positive.)")
48 48
                 . "\n"
49
-                . _("Yours sincerely,"). "\n"
49
+                . _("Yours sincerely,") . "\n"
50 50
                 . "\n"
51 51
                 . _("The eduroam diagnostics algorithms");
52 52
         
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
                 "bcc" => [], 
58 58
                 "reply-to" => [Logopath::EDUROAM_OT],
59 59
                 "subject" => _("[POLICYVIOLATION NATIONAL] IdP with no entry in eduroam database"), 
60
-                "body" => _("Dear NRO administrator,")."\n"
60
+                "body" => _("Dear NRO administrator,") . "\n"
61 61
                         . "\n"
62
-                        . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar")) ."\n"
62
+                        . wordwrap(sprintf(_("an end-user requested diagnostics for realm %s. Real-time connectivity checks determined that the realm exists, but we were unable to find an IdP with that realm in the eduroam database."), "foo.bar")) . "\n"
63 63
                         . "\n"
64
-                        . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.")."\n"
64
+                        . _("By not listing IdPs in the eduroam database, you are violating the eduroam policy.") . "\n"
65 65
                         . "\n"
66
-                        . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database."). "\n"
66
+                        . _("Additionally, this creates operational issues. In particular, we are unable to direct end users to their IdP for further diagnosis/instructions because there are no contact points for that IdP in the database.") . "\n"
67 67
                         . "\n"
68 68
                         . "Please stop the policy violation ASAP by listing the IdP which is associated to this realm.",
69 69
                 ],
Please login to merge, or discard this patch.
web/diag/processSociopath.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     }
28 28
     $sociopath->revaluate($QPHP["NUMBER"], $yes);
29 29
 } else {
30
-    error_log('MGW workingwith '.serialize($workingwith));
30
+    error_log('MGW workingwith ' . serialize($workingwith));
31 31
 }
32 32
 $QJSON = $sociopath->questionOracle();
33 33
 $_SESSION['QJSON'] = $QJSON;
Please login to merge, or discard this patch.
web/diag/magicTelepath.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
web/diag/findRealm.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
web/skins/modern/diag/diag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@
 block discarded – undo
347 347
         return false;
348 348
    });
349 349
    $(document).on('change', '#idp_country, #sp_country' , function() {
350
-        var comment = <?php echo '"' . _("Fetching institutions list").'..."'; ?>;  
350
+        var comment = <?php echo '"' . _("Fetching institutions list") . '..."'; ?>;  
351 351
         var id = $(this).attr('id');
352 352
         var k = id.indexOf('_');
353 353
         var type = id.substr(0,k);
Please login to merge, or discard this patch.
web/skins/modern/diag/diag_admin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@
 block discarded – undo
141 141
                     result = result + '<table>';
142 142
                     result = result + '<tr><td>' + <?php echo '"' . _("SP email") . '"'; ?> + '</td><td>' + data.spcontact + '</td></tr>';
143 143
                     result = result + '<tr><td>' + <?php echo '"' . _("IdP email(s)") . '"'; ?> + '</td><td>' + data.idpcontact + '</td></tr>';
144
-                    result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp"). '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
144
+                    result = result + '<tr><td>' + <?php echo '"' . _("Event's timestamp") . '"'; ?> + '</td><td>' + data.timestamp + '</td></tr>';
145 145
                     result = result + '<tr><td>' + <?php echo '"' . _("Suspected MAC address") . '"'; ?> + '</td><td>' + data.mac + '</td></tr>';
146 146
                     result = result + '<tr><td>' + <?php echo '"' . _("Additional description") . '"'; ?> +'</td><td>' + data.description + '</td></tr>';
147 147
                     result = result + '</div>';
Please login to merge, or discard this patch.