Passed
Push — master ( f95f27...0adbbf )
by Maja
04:05
created
schema/1_1-2_0-script.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
web/diag/radius_tests.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
web/lib/user/TextTemplates.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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");
Please login to merge, or discard this patch.
devices/ms/Device_Vista7.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@
 block discarded – undo
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>
Please login to merge, or discard this patch.
core/AbstractProfile.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -96,6 +96,12 @@
 block discarded – undo
96 96
      */
97 97
     protected $frontendHandle;
98 98
 
99
+    /**
100
+     * @param integer $idpIdentifier
101
+     * @param string $deviceId
102
+     * @param string $area
103
+     * @param string $lang
104
+     */
99 105
     protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType) {
100 106
         if (CONFIG['PATHS']['logdir']) {
101 107
             $file = fopen(CONFIG['PATHS']['logdir'] . "/download_details.log", "a");
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.
core/diag/Sociopath.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -56,34 +56,34 @@
 block discarded – undo
56 56
         // let's start the numbering at 1
57 57
         $this->qaArray = [
58 58
             1 => ["AREA" => AbstractTest::INFRA_DEVICE,
59
-                  "TXT" => _("Have you ever used the network succesfully, e.g. at your home institution without roaming?"),
60
-                  "FACTOR" => 0.5,
61
-                  "VERDICTLECTURE" => sprintf(_("If your device has never worked before with this setup, then very likely your device configuation is wrong. %s"), $confAssistantText)],
59
+                    "TXT" => _("Have you ever used the network succesfully, e.g. at your home institution without roaming?"),
60
+                    "FACTOR" => 0.5,
61
+                    "VERDICTLECTURE" => sprintf(_("If your device has never worked before with this setup, then very likely your device configuation is wrong. %s"), $confAssistantText)],
62 62
             2 => ["AREA" => AbstractTest::INFRA_DEVICE, 
63
-                  "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), 
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)],
63
+                    "TXT" => _("Did the device previously work when roaming, i.e. at other hotspots away from your home institution?"), 
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)],
66 66
             3 => ["AREA" => AbstractTest::INFRA_DEVICE, 
67
-                  "TXT" => _("Did you recently change the configuration on your device?"), 
68
-                  "FACTOR" => 3,
69
-                  "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.")],
67
+                    "TXT" => _("Did you recently change the configuration on your device?"), 
68
+                    "FACTOR" => 3,
69
+                    "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.")],
70 70
             4 => ["AREA" => AbstractTest::INFRA_DEVICE, 
71
-                  "TXT" => _("Do your other devices still work?"),
72
-                  "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]"),
73
-                  "FACTOR" => 0.33],
71
+                    "TXT" => _("Do your other devices still work?"),
72
+                    "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]"),
73
+                    "FACTOR" => 0.33],
74 74
             5 => ["AREA" => AbstractTest::INFRA_SP_80211, 
75
-                  "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), 
76
-                  "FACTOR" => 3,
77
-                  "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]")],            
75
+                    "TXT" => _("Is the place you are currently at heavily crowded, or is a network-intensive workload going on?"), 
76
+                    "FACTOR" => 3,
77
+                    "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]")],            
78 78
             6 => ["AREA" => AbstractTest::INFRA_SP_80211, 
79
-                  "TXT" => _("Does the connection get better when you move around?"), 
80
-                  "FACTOR" => 3,
81
-                  "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]")],
79
+                    "TXT" => _("Does the connection get better when you move around?"), 
80
+                    "FACTOR" => 3,
81
+                    "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]")],
82 82
             
83 83
             7 => ["AREA" => AbstractTest::INFRA_SP_LAN, 
84
-                  "TXT" => _("Do you see errors stating something similar to 'Unable to get IP address'?"), 
85
-                  "FACTOR" => 3,
86
-                  "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.")],
84
+                    "TXT" => _("Do you see errors stating something similar to 'Unable to get IP address'?"), 
85
+                    "FACTOR" => 3,
86
+                    "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.")],
87 87
         ];
88 88
     }
89 89
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
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,
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
         $questionDetails = $this->qaArray[$questionNumber];
101 101
         if ($answer === TRUE) {
102 102
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] * $questionDetails["FACTOR"];
103
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by ".$questionDetails["FACTOR"]."\n");
103
+            $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by " . $questionDetails["FACTOR"] . "\n");
104 104
             $factor = $questionDetails["FACTOR"];
105 105
         } elseif ($answer === FALSE) {
106 106
             $this->possibleFailureReasons[$questionDetails['AREA']] = $this->possibleFailureReasons[$questionDetails['AREA']] / $questionDetails["FACTOR"];
107
-            $this->loggerInstance->debug(3,"Adjusting ".$questionDetails['AREA']." by 1/".$questionDetails["FACTOR"]."\n");
108
-            $factor = 1/$questionDetails["FACTOR"];
107
+            $this->loggerInstance->debug(3, "Adjusting " . $questionDetails['AREA'] . " by 1/" . $questionDetails["FACTOR"] . "\n");
108
+            $factor = 1 / $questionDetails["FACTOR"];
109 109
         } else {
110 110
             $factor = 1;
111 111
         }
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
         $this->additionalFindings["QUESTIONSASKED"] = $this->previousQuestions;
115 115
         $_SESSION["SUSPECTS"] = $this->possibleFailureReasons;
116 116
         $_SESSION["EVIDENCE"] = $this->additionalFindings;
117
-        $this->loggerInstance->debug(3,$_SESSION['SUSPECTS']);
118
-        $this->loggerInstance->debug(3,$_SESSION['EVIDENCE']);
117
+        $this->loggerInstance->debug(3, $_SESSION['SUSPECTS']);
118
+        $this->loggerInstance->debug(3, $_SESSION['EVIDENCE']);
119 119
     }
120 120
     
121 121
     /**
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         // if both are identical, take any of the questions in the pool of both
135 135
         foreach ($this->qaArray as $questionNumber => $questionDetails) {
136 136
             // if we find a question we didn't ask before AND it is related to our currently high-scoring problem area, ask it
137
-            if (!array_key_exists($questionNumber, $this->previousQuestions) && ( $questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory) ) {
137
+            if (!array_key_exists($questionNumber, $this->previousQuestions) && ($questionDetails["AREA"] == $highestCategory || $questionDetails["AREA"] == $nextCategory)) {
138 138
                 return json_encode(["NEXTEXISTS" => TRUE, "NUMBER" => $questionNumber, "TEXT" => $questionDetails["TXT"]]);
139 139
             }
140 140
         }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      * @return string JSON encoded array with all the info we have
148 148
      */
149 149
     public function getCurrentGuessState() {
150
-        return json_encode([ "SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings ]);
150
+        return json_encode(["SUSPECTS" => $this->possibleFailureReasons, "EVIDENCE" => $this->additionalFindings]);
151 151
     }
152 152
     
153 153
     /**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $text = $this->genericVerdictTexts[$area];
160 160
         foreach ($this->previousQuestions as $number => $factor) {
161 161
             if ($this->qaArray[$number]["AREA"] == $area && $factor > 1) {
162
-                $text .= "\n\n".$this->qaArray[$number]["VERDICTLECTURE"];
162
+                $text .= "\n\n" . $this->qaArray[$number]["VERDICTLECTURE"];
163 163
             }
164 164
         }
165 165
         return $text;
Please login to merge, or discard this patch.
web/admin/inc/manageDBLink.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.