Passed
Branch master (a194fe)
by Brook
04:47
created
web/404.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 <body>
27 27
     <div id="heading">
28 28
         <?php
29
-        print '<img src="'. dirname($_SERVER['SCRIPT_NAME']) .'/resources/images/consortium_logo.png" alt="Consortium Logo" style="float:right; padding-right:20px; padding-top:20px"/>';
30
-        print '<div id="motd">' . ( isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : '&nbsp' ) . '</div>';
29
+        print '<img src="' . dirname($_SERVER['SCRIPT_NAME']) . '/resources/images/consortium_logo.png" alt="Consortium Logo" style="float:right; padding-right:20px; padding-top:20px"/>';
30
+        print '<div id="motd">' . (isset(CONFIG['APPEARANCE']['MOTD']) ? CONFIG['APPEARANCE']['MOTD'] : '&nbsp') . '</div>';
31 31
         print '<h1 style="padding-bottom:0px; height:1em;">' . sprintf(_("Welcome to %s"), CONFIG['APPEARANCE']['productname']) . '</h1>
32 32
 <h2 style="padding-bottom:0px; height:0px; vertical-align:bottom;">' . CONFIG['APPEARANCE']['productname_long'] . '</h2>';
33 33
         echo '<table id="lang_select"><tr><td>';
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
         ?>
42 42
     </div> <!-- id="heading" -->
43 43
     <div id="main_body" style='padding:20px;'>
44
-        <h1><?php echo _("This is not the CAT you are looking for.");?></h1>
45
-        <p><?php echo _("Whatever you expected to see at this URL - it's not here. The only thing here is the number");?></p>
44
+        <h1><?php echo _("This is not the CAT you are looking for."); ?></h1>
45
+        <p><?php echo _("Whatever you expected to see at this URL - it's not here. The only thing here is the number"); ?></p>
46 46
         <h2>404</h2>
47
-        <p><?php echo sprintf(_("staring at you. Your mistake? Our error? Who knows! Maybe you should go back to the <a href='%s'>Start Page</a>."), dirname($_SERVER['SCRIPT_NAME']) . '?lang=' . $langObject->getLang());?></p>
47
+        <p><?php echo sprintf(_("staring at you. Your mistake? Our error? Who knows! Maybe you should go back to the <a href='%s'>Start Page</a>."), dirname($_SERVER['SCRIPT_NAME']) . '?lang=' . $langObject->getLang()); ?></p>
48 48
     </div> <!-- id="main_body" -->
49 49
 
50 50
         <?php footer();
Please login to merge, or discard this patch.
core/ProfileRADIUS.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
         $this->realm = $profileQuery->realm;
79 79
 
80
-        $localValueIfAny = (preg_match('/@/', $this->realm) ? substr($this->realm, 0, strpos($this->realm, '@')) : "anonymous" );
80
+        $localValueIfAny = (preg_match('/@/', $this->realm) ? substr($this->realm, 0, strpos($this->realm, '@')) : "anonymous");
81 81
 
82 82
         $internalAttributes = [
83 83
             "internal:profile_count" => $this->idpNumberOfProfiles,
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 
179 179
                 $temparray[] = [
180 180
                     "name" => $attributeQuery->option_name,
181
-                    "value" => ( $decodedAttribute['lang'] == "" ? $decodedAttribute['content'] : serialize($decodedAttribute)),
181
+                    "value" => ($decodedAttribute['lang'] == "" ? $decodedAttribute['content'] : serialize($decodedAttribute)),
182 182
                     "level" => "Method",
183 183
                     "row" => $attributeQuery->row,
184 184
                     "flag" => $optinfo['flag'],
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         $escapedDevice = $this->databaseHandle->escapeValue($device);
200 200
         $escapedPath = $this->databaseHandle->escapeValue($path);
201 201
         $this->databaseHandle->exec("INSERT INTO downloads (profile_id,device_id,download_path,mime,lang,installer_time) 
202
-                                        VALUES ($this->identifier, '$escapedDevice', '$escapedPath', '$mime', '".$this->languageInstance->getLang()."', CURRENT_TIMESTAMP ) 
202
+                                        VALUES ($this->identifier, '$escapedDevice', '$escapedPath', '$mime', '" . $this->languageInstance->getLang() . "', CURRENT_TIMESTAMP ) 
203 203
                                         ON DUPLICATE KEY UPDATE download_path = '$escapedPath', mime = '$mime', installer_time = CURRENT_TIMESTAMP");
204 204
     }
205 205
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
      */
262 262
     public function setRealmCheckUser($shallwe, $localpart = NULL) {
263 263
         $this->databaseHandle->exec("UPDATE profile SET checkuser_outer = " . ($shallwe === true ? "1" : "0") .
264
-                ( $localpart !== NULL ? ", checkuser_value = '$localpart' " : "") .
264
+                ($localpart !== NULL ? ", checkuser_value = '$localpart' " : "") .
265 265
                 " WHERE profile_id = $this->identifier");
266 266
     }
267 267
 
Please login to merge, or discard this patch.
core/CAT.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,12 +112,12 @@
 block discarded – undo
112 112
     }
113 113
 
114 114
         /**
115
-     * Lists all identity providers in the database
116
-     * adding information required by DiscoJuice.
117
-     * @param int $activeOnly if and set to non-zero will
118
-     * cause listing of only those institutions which have some valid profiles defined.
119
-     *
120
-     */
115
+         * Lists all identity providers in the database
116
+         * adding information required by DiscoJuice.
117
+         * @param int $activeOnly if and set to non-zero will
118
+         * cause listing of only those institutions which have some valid profiles defined.
119
+         *
120
+         */
121 121
     public function listAllIdentityProviders($activeOnly = 0, $country = 0) {
122 122
         $handle = DBConnection::handle("INST");
123 123
         $handle->exec("SET SESSION group_concat_max_len=10000");
Please login to merge, or discard this patch.
core/Federation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             
65 65
             $numberQuery = $handle->exec($query);
66 66
             while ($queryResult = mysqli_fetch_object($numberQuery)) {
67
-                $dataArray[$deviceArray['display']] = ["ADMIN" => ( $queryResult->admin === NULL ? "0" : $queryResult->admin), "USER" => ($queryResult->user === NULL ? "0" : $queryResult->user)];
67
+                $dataArray[$deviceArray['display']] = ["ADMIN" => ($queryResult->admin === NULL ? "0" : $queryResult->admin), "USER" => ($queryResult->user === NULL ? "0" : $queryResult->user)];
68 68
                 $grossAdmin = $grossAdmin + $queryResult->admin;
69 69
                 $grossUser = $grossUser + $queryResult->user;
70 70
             }
Please login to merge, or discard this patch.
devices/test_module/TestModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,11 +132,11 @@
 block discarded – undo
132 132
      * return string
133 133
      */
134 134
     private function zipInstaller($attr) {
135
-        if (count($attr)==0) {
135
+        if (count($attr) == 0) {
136 136
             // never mind. The array contains all properties of the profile in
137 137
             // question and you CAN use the information here
138 138
             // just adding some code below to remove "unused code" warnings
139
-            $this->loggerInstance->debug(2,"This profile has no attributes at all.\n");
139
+            $this->loggerInstance->debug(2, "This profile has no attributes at all.\n");
140 140
         }
141 141
         $filename = $this->installerBasename . '.zip';
142 142
         $return = system('zip -q ' . $filename . ' *');
Please login to merge, or discard this patch.
core/EAP.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@
 block discarded – undo
176 176
      * @return array|int
177 177
      */
178 178
     public static function eAPMethodArrayIdConversion($input) {
179
-        if (is_numeric($input) && isset(EAP::EAPTYPES_CONVERSION[(int)$input])) {
179
+        if (is_numeric($input) && isset(EAP::EAPTYPES_CONVERSION[(int) $input])) {
180 180
             return EAP::EAPTYPES_CONVERSION[$input];
181 181
         }
182 182
         if (is_array($input)) {
Please login to merge, or discard this patch.
web/admin/edit_profile_result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
191 191
 
192 192
     foreach (EAP::listKnownEAPTypes() as $a) {
193 193
         if (isset($_POST[display_name($a)]) && isset($_POST[display_name($a) . "-priority"]) && is_numeric($_POST[display_name($a) . "-priority"])) {
194
-            $priority = (int)$_POST[display_name($a) . "-priority"];
194
+            $priority = (int) $_POST[display_name($a) . "-priority"];
195 195
             // add EAP type to profile as requested, but ...
196 196
             $profile->addSupportedEapMethod($a, $priority);
197 197
             $loggerInstance->writeAudit($_SESSION['user'], "MOD", "Profile " . $profile->identifier . " - supported EAP types changed");
Please login to merge, or discard this patch.
core/Language.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -88,13 +88,13 @@
 block discarded – undo
88 88
         if ($hardSetLang !== 0) {
89 89
             $langConverted[] = $hardSetLang;
90 90
         } 
91
-        if (! empty($_REQUEST['lang'])) {
91
+        if (!empty($_REQUEST['lang'])) {
92 92
             $langConverted[] = $_REQUEST['lang'];
93 93
         }
94
-        if (! empty($_SESSION['language'])) {
94
+        if (!empty($_SESSION['language'])) {
95 95
             $langConverted[] = $_SESSION['language'];
96 96
         }
97
-        if (! empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
97
+        if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
98 98
             $langs = explode(",", $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
99 99
             foreach ($langs as $lang) {
100 100
                 $result = [];
Please login to merge, or discard this patch.
core/UserAPI.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             if (isset($deviceProperties['options']['hidden']) && $deviceProperties['options']['hidden'] && $showHidden == 0) {
179 179
                 continue;
180 180
             }
181
-            $count ++;
181
+            $count++;
182 182
             
183 183
             $deviceProperties['device'] = $device;
184 184
             
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     public function JSON_listLanguages() {
281 281
         $returnArray = [];
282 282
         foreach (CONFIG['LANGUAGES'] as $id => $val) {
283
-            $returnArray[] = [( $this->version == 1 ? 'id' : 'lang') => $id, 'display' => $val['display'], 'locale' => $val['locale']];
283
+            $returnArray[] = [($this->version == 1 ? 'id' : 'lang') => $id, 'display' => $val['display'], 'locale' => $val['locale']];
284 284
         }
285 285
         echo $this->return_json($returnArray);
286 286
     }
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
         $federations = $this->printCountryList(1);
295 295
         $returnArray = [];
296 296
         foreach ($federations as $id => $val) {
297
-            $returnArray[] = [( $this->version == 1 ? 'id' : 'federation' ) => $id, 'display' => $val];
297
+            $returnArray[] = [($this->version == 1 ? 'id' : 'federation') => $id, 'display' => $val];
298 298
         }
299 299
         echo $this->return_json($returnArray);
300 300
     }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         $idps = $this->listAllIdentityProviders(1, $country);
310 310
         $returnArray = [];
311 311
         foreach ($idps as $idp) {
312
-            $returnArray[] = [( $this->version == 1 ? 'id' : 'idp' ) => $idp['entityID'], 'display' => $idp['title']];
312
+            $returnArray[] = [($this->version == 1 ? 'id' : 'idp') => $idp['entityID'], 'display' => $idp['title']];
313 313
         }
314 314
         echo $this->return_json($returnArray);
315 315
     }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         $idps = $this->listAllIdentityProviders(1);
325 325
         $returnArray = [];
326 326
         foreach ($idps as $idp) {
327
-            $idp[( $this->version == 1 ? 'id' : 'idp' )] = $idp['entityID'];
327
+            $idp[($this->version == 1 ? 'id' : 'idp')] = $idp['entityID'];
328 328
             $returnArray[] = $idp;
329 329
         }
330 330
         echo json_encode($returnArray);
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         $idps = $this->orderIdentityProviders($country, $location);
340 340
         $returnArray = [];
341 341
         foreach ($idps as $idp) {
342
-            $returnArray[] = [( $this->version == 1 ? 'id' : 'idp' ) => $idp['id'], 'display' => $idp['title']];
342
+            $returnArray[] = [($this->version == 1 ? 'id' : 'idp') => $idp['id'], 'display' => $idp['title']];
343 343
         }
344 344
         echo $this->return_json($returnArray);
345 345
     }
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             usort($profiles, "profile_sort");
370 370
         }
371 371
         foreach ($profiles as $profile) {
372
-            $returnArray[] = [( $this->version == 1 ? 'id' : 'profile' ) => $profile->identifier, 'display' => $profile->name, 'idp_name' => $profile->instName, 'logo' => $hasLogo];
372
+            $returnArray[] = [($this->version == 1 ? 'id' : 'profile') => $profile->identifier, 'display' => $profile->name, 'idp_name' => $profile->instName, 'logo' => $hasLogo];
373 373
         }
374 374
         echo $this->return_json($returnArray);
375 375
     }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
         asort($resultSet);
649 649
         $outarray = [];
650 650
         foreach (array_keys($resultSet) as $r) {
651
-            $outarray[] = [( $this->version == 1 ? 'id' : 'idp' ) => $r, 'title' => $idpTitle[$r]];
651
+            $outarray[] = [($this->version == 1 ? 'id' : 'idp') => $r, 'title' => $idpTitle[$r]];
652 652
         }
653 653
         return($outarray);
654 654
     }
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         if (isset($_REQUEST['device']) && isset($Dev[$_REQUEST['device']]) && (!isset($device['options']['hidden']) || $device['options']['hidden'] == 0)) {
666 666
             $dev_id = $_REQUEST['device'];
667 667
             $device = $Dev[$dev_id];
668
-            return([( $this->version == 1 ? 'id' : 'device') => $dev_id, 'display' => $device['display'], 'group' => $device['group']]);
668
+            return([($this->version == 1 ? 'id' : 'device') => $dev_id, 'display' => $device['display'], 'group' => $device['group']]);
669 669
         }
670 670
         $browser = $_SERVER['HTTP_USER_AGENT'];
671 671
         $this->loggerInstance->debug(4, "HTTP_USER_AGENT=$browser\n");
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
             if (preg_match('/' . $device['match'] . '/', $browser)) {
677 677
                 if (!isset($device['options']['hidden']) || $device['options']['hidden'] == 0) {
678 678
                     $this->loggerInstance->debug(4, "Browser_id: $dev_id\n");
679
-                    return([( $this->version == 1 ? 'id' : 'device' ) => $dev_id, 'display' => $device['display'], 'group' => $device['group']]);
679
+                    return([($this->version == 1 ? 'id' : 'device') => $dev_id, 'display' => $device['display'], 'group' => $device['group']]);
680 680
                 } else {
681 681
                     $this->loggerInstance->debug(2, "Unrecognised system: " . $_SERVER['HTTP_USER_AGENT'] . "\n");
682 682
                     return(false);
Please login to merge, or discard this patch.