Completed
Push — development ( 477849...8fd89f )
by Nils
07:48
created
sources/SecureHandler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function __construct()
27 27
     {
28
-        if (! extension_loaded('openssl')) {
28
+        if (!extension_loaded('openssl')) {
29 29
             throw new \RuntimeException(sprintf(
30 30
                 "You need the OpenSSL extension to use %s",
31 31
                 __CLASS__
32 32
             ));
33 33
         }
34
-        if (! extension_loaded('mbstring')) {
34
+        if (!extension_loaded('mbstring')) {
35 35
             throw new \RuntimeException(sprintf(
36 36
                 "You need the Multibytes extension to use %s",
37 37
                 __CLASS__
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function open($save_path, $session_name)
50 50
     {
51
-        $this->key = $this->getKey('KEY_' . $session_name);
51
+        $this->key = $this->getKey('KEY_'.$session_name);
52 52
         return parent::open($save_path, $session_name);
53 53
     }
54 54
 
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
         // Authentication
96 96
         $hmac = hash_hmac(
97 97
             'SHA256',
98
-            $iv . $ciphertext,
98
+            $iv.$ciphertext,
99 99
             mb_substr($key, 32, null, '8bit'),
100 100
             true
101 101
         );
102
-        return $hmac . $iv . $ciphertext;
102
+        return $hmac.$iv.$ciphertext;
103 103
     }
104 104
 
105 105
     /**
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
         // Authentication
118 118
         $hmacNew = hash_hmac(
119 119
             'SHA256',
120
-            $iv . $ciphertext,
120
+            $iv.$ciphertext,
121 121
             mb_substr($key, 32, null, '8bit'),
122 122
             true
123 123
         );
124
-        if (! $this->hash_equals($hmac, $hmacNew)) {
124
+        if (!$this->hash_equals($hmac, $hmacNew)) {
125 125
             throw new \RuntimeException('Authentication failed');
126 126
         }
127 127
         // Decrypt
Please login to merge, or discard this patch.
sources/main.queries.php 3 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                     prefix_table("users"),
100 100
                     array(
101 101
                         'fonction_id' => $data_roles['fonction_id']
102
-                       ),
102
+                        ),
103 103
                     "id = %i",
104 104
                     $_SESSION['user_id']
105 105
                 );
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                         'pw' => $newPw,
167 167
                         'last_pw_change' => mktime(0, 0, 0, date('m'), date('d'), date('y')),
168 168
                         'last_pw' => $oldPw
169
-                       ),
169
+                        ),
170 170
                     "id = %i",
171 171
                     $_SESSION['user_id']
172 172
                 );
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 array(
205 205
                     'pw' => $newPw,
206 206
                     'last_pw_change' => mktime(0, 0, 0, date('m'), date('d'), date('y'))
207
-                   ),
207
+                    ),
208 208
                 "id = %i",
209 209
                 $dataReceived['user_id']
210 210
             );
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
                 array(
241 241
                     'pw' => $newPw,
242 242
                     'last_pw_change' => mktime(0, 0, 0, date('m'), date('d'), date('y'))
243
-                   ),
243
+                    ),
244 244
                 "id = %i",
245 245
                 $_SESSION['user_id']
246 246
             );
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
         }
262 262
         break;
263 263
     /**
264
-    * This will generate the QR Google Authenticator
265
-    */
264
+     * This will generate the QR Google Authenticator
265
+     */
266 266
     case "ga_generate_qr":
267 267
         // is this allowed by setting
268 268
         if (!isset($_SESSION['settings']['ga_reset_by_user']) || $_SESSION['settings']['ga_reset_by_user'] !== "1") {
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                     array(
312 312
                         'ga' => $gaSecretKey,
313 313
                         'ga_temporary_code' => $gaTemporaryCode
314
-                       ),
314
+                        ),
315 315
                     "id = %i",
316 316
                     $data['id']
317 317
                 );
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                 prefix_table("users"),
458 458
                 array(
459 459
                     'pw' => $newPw
460
-                   ),
460
+                    ),
461 461
                 "login = %s",
462 462
                 mysqli_escape_string($link, $login)
463 463
             );
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
                     prefix_table("users"),
552 552
                     array(
553 553
                         'encrypted_psk' => $_SESSION['user_settings']['encrypted_psk']
554
-                       ),
554
+                        ),
555 555
                     "id = %i",
556 556
                     $_SESSION['user_id']
557 557
                 );
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
             prefix_table("users"),
636 636
             array(
637 637
                 'encrypted_psk' => $_SESSION['user_settings']['encrypted_psk']
638
-               ),
638
+                ),
639 639
             "id = %i",
640 640
             $_SESSION['user_id']
641 641
         );
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
                 prefix_table("users"),
740 740
                 array(
741 741
                     'user_language' => $language
742
-                   ),
742
+                    ),
743 743
                 "id = %i",
744 744
                 $_SESSION['user_id']
745 745
             );
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
                         prefix_table("emails"),
807 807
                         array(
808 808
                             'status' => $status
809
-                           ),
809
+                            ),
810 810
                         "timestamp = %s",
811 811
                         $record['timestamp']
812 812
                     );
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
                 prefix_table("misc"),
821 821
                 array(
822 822
                     'valeur' => time()
823
-                   ),
823
+                    ),
824 824
                 "intitule = %s AND type = %s",
825 825
                 "sending_emails",
826 826
                 "cron"
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
                 prefix_table("misc"),
1138 1138
                 array(
1139 1139
                     'valeur' => time()
1140
-                   ),
1140
+                    ),
1141 1141
                 "type = %s AND intitule = %s",
1142 1142
                 'admin',
1143 1143
                 'send_stats_time'
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $pwdlib = new PasswordLib\PasswordLib();
84 84
 
85 85
         // Prepare variables
86
-        $newPw = $pwdlib->createPasswordHash(htmlspecialchars_decode($dataReceived['new_pw']));    //bCrypt(htmlspecialchars_decode($dataReceived['new_pw']), COST);
86
+        $newPw = $pwdlib->createPasswordHash(htmlspecialchars_decode($dataReceived['new_pw'])); //bCrypt(htmlspecialchars_decode($dataReceived['new_pw']), COST);
87 87
 
88 88
         // User has decided to change is PW
89 89
         if (isset($_POST['change_pw_origine']) && $_POST['change_pw_origine'] === "user_change" && $_SESSION['user_admin'] !== "1") {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             $data_roles = DB::queryfirstrow("SELECT fonction_id FROM ".prefix_table("users")." WHERE id = %i", $_SESSION['user_id']);
92 92
 
93 93
             // check if badly written
94
-            $data_roles['fonction_id'] = array_filter(explode(',',str_replace(';', ',', $data_roles['fonction_id'])));
94
+            $data_roles['fonction_id'] = array_filter(explode(',', str_replace(';', ',', $data_roles['fonction_id'])));
95 95
             if ($data_roles['fonction_id'][0] === "") {
96 96
                 //$data_roles['fonction_id'] = array_filter($data_roles['fonction_id']);
97 97
                 $data_roles['fonction_id'] = implode(';', $data_roles['fonction_id']);
@@ -222,9 +222,9 @@  discard block
 block discarded – undo
222 222
                 if (!empty($row['email']) && isset($_SESSION['settings']['enable_email_notification_on_user_pw_change']) && $_SESSION['settings']['enable_email_notification_on_user_pw_change'] == 1) {
223 223
                     sendEmail(
224 224
                         $LANG['forgot_pw_email_subject'],
225
-                        $LANG['forgot_pw_email_body'] . " " . htmlspecialchars_decode($dataReceived['new_pw']),
225
+                        $LANG['forgot_pw_email_body']." ".htmlspecialchars_decode($dataReceived['new_pw']),
226 226
                         $row[0],
227
-                        $LANG['forgot_pw_email_altbody_1'] . " " . htmlspecialchars_decode($dataReceived['new_pw'])
227
+                        $LANG['forgot_pw_email_altbody_1']." ".htmlspecialchars_decode($dataReceived['new_pw'])
228 228
                     );
229 229
                 }
230 230
             }
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 
319 319
                 // send mail?
320 320
                 if (isset($_POST['send_email']) && $_POST['send_email'] === "1") {
321
-                    sendEmail (
321
+                    sendEmail(
322 322
                         $LANG['email_ga_subject'],
323 323
                         str_replace(
324 324
                             "#2FACode#",
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
      */
369 369
     case "send_pw_by_email":
370 370
         // generate key
371
-        $key =  GenerateCryptKey(50);
371
+        $key = GenerateCryptKey(50);
372 372
 
373 373
         // Get account and pw associated to email
374 374
         DB::query(
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
                 }
528 528
             }
529 529
         }
530
-        echo json_encode($arrOutput, JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP);
530
+        echo json_encode($arrOutput, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);
531 531
         break;
532 532
     /**
533 533
      * Store the personal saltkey
@@ -863,10 +863,10 @@  discard block
 block discarded – undo
863 863
             $pwgen->setCapitalize(true);
864 864
             $pwgen->setNumerals(true);
865 865
         } else {
866
-            $pwgen->setSecure(($_POST['secure'] == "true")? true : false);
867
-            $pwgen->setNumerals(($_POST['numerals'] == "true")? true : false);
868
-            $pwgen->setCapitalize(($_POST['capitalize'] == "true")? true : false);
869
-            $pwgen->setSymbols(($_POST['symbols'] == "true")? true : false);
866
+            $pwgen->setSecure(($_POST['secure'] == "true") ? true : false);
867
+            $pwgen->setNumerals(($_POST['numerals'] == "true") ? true : false);
868
+            $pwgen->setCapitalize(($_POST['capitalize'] == "true") ? true : false);
869
+            $pwgen->setSymbols(($_POST['symbols'] == "true") ? true : false);
870 870
         }
871 871
 
872 872
         echo prepareExchangedData(
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
                     prefix_table("statistics"),
928 928
                     array(
929 929
                         'scope' => 'item',
930
-                        'view' => $data['view']+1
930
+                        'view' => $data['view'] + 1
931 931
                     ),
932 932
                     "item_id = %i",
933 933
                     $_POST['id']
@@ -985,7 +985,7 @@  discard block
 block discarded – undo
985 985
                 "existing_suggestions" => $nb_suggestions_waiting,
986 986
                 "text" => handleBackslash($return)
987 987
             ),
988
-            JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP
988
+            JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP
989 989
         );
990 990
         break;
991 991
 
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
                 'token' => $token,
1024 1024
                 'reason' => $_POST['reason'],
1025 1025
                 'creation_timestamp' => time(),
1026
-                'end_timestamp' => time()+$_POST['duration']    // in secs
1026
+                'end_timestamp' => time() + $_POST['duration']    // in secs
1027 1027
             )
1028 1028
         );
1029 1029
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -964,7 +964,9 @@
 block discarded – undo
964 964
                     $return .= '<li onclick="displayItemNumber('.$record['id'].', '.$record['id_tree'].')"><i class="fa fa-hand-o-right"></i>&nbsp;'.($record['label']).'</li>';
965 965
                     $x++;
966 966
                     array_push($arrTmp, $record['id']);
967
-                    if ($x >= 10) break;
967
+                    if ($x >= 10) {
968
+                        break;
969
+                    }
968 970
                 }
969 971
             }
970 972
         }
Please login to merge, or discard this patch.
sources/identify.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             prefix_table('users'),
90 90
             array(
91 91
                 'agses-usercardid' =>  filter_var($_POST['cardid'], FILTER_SANITIZE_NUMBER_INT)
92
-               ),
92
+                ),
93 93
             "login = %s",
94 94
             $_POST['login']
95 95
         );
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             $ldapconn = ldap_connect($ldapURIs);
348 348
 
349 349
             if ($_SESSION['settings']['ldap_tls']) {
350
-               ldap_start_tls($ldapconn);
350
+                ldap_start_tls($ldapconn);
351 351
             }
352 352
             if ($debugLdap == 1) {
353 353
                 fputs($dbgLdap, "LDAP connection : " . ($ldapconn ? "Connected" : "Failed") . "\n");
@@ -366,9 +366,9 @@  discard block
 block discarded – undo
366 366
                         $result_group = ldap_search($ldapconn, $_SESSION['settings']['ldap_usergroup'],$filter_group, array('dn'));
367 367
                         if ($debugLdap == 1) {
368 368
                                 fputs(
369
-                                     $dbgLdap,
370
-                                     'Search filter (group): ' . $filter_group . "\n" .
371
-                                     'Results : ' . print_r(ldap_get_entries($ldapconn, $result_group), true) . "\n"
369
+                                        $dbgLdap,
370
+                                        'Search filter (group): ' . $filter_group . "\n" .
371
+                                        'Results : ' . print_r(ldap_get_entries($ldapconn, $result_group), true) . "\n"
372 372
                                 );
373 373
                         }
374 374
                         if (!ldap_count_entries($ldapconn, $result_group)) {
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
         fputs(
44 44
             $dbgDuo,
45 45
             "\n\n-----\n\n".
46
-            "sig request : ".$_POST['login']."\n" .
47
-            'resp : ' . $sig_request . "\n"
46
+            "sig request : ".$_POST['login']."\n".
47
+            'resp : '.$sig_request."\n"
48 48
         );
49 49
     }
50 50
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             $_POST['login']
95 95
         );
96 96
         $row['agses-usercardid'] = filter_var($_POST['cardid'], FILTER_SANITIZE_NUMBER_INT);
97
-    }else {
97
+    } else {
98 98
         // error
99 99
         echo '[{"error" : "something_wrong" , "agses_message" : ""}]';
100 100
         return false;
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         if (empty($ret_agses_apikey['valeur']) || empty($ret_agses_url['valeur']) || empty($ret_agses_id['valeur'])) {
156 156
             echo '[{"error" : "no_agses_info" , "agses_message" : ""}]';
157 157
         } else {
158
-            echo '[{"error" : "something_wrong" , "agses_message" : ""}]';  // user not found but not displayed as this in the error message
158
+            echo '[{"error" : "something_wrong" , "agses_message" : ""}]'; // user not found but not displayed as this in the error message
159 159
         }
160 160
     }
161 161
 } elseif ($_POST['type'] == "identify_duo_user_check") {
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
     $resp = Duo::verifyResponse(IKEY, SKEY, AKEY, $_POST['sig_response']);
171 171
 
172 172
     if ($debugDuo == 1) {
173
-        $dbgDuo = fopen($_SESSION['settings']['path_to_files_folder'] . "/duo.debug.txt", "a");
173
+        $dbgDuo = fopen($_SESSION['settings']['path_to_files_folder']."/duo.debug.txt", "a");
174 174
         fputs(
175 175
             $dbgDuo,
176
-            "\n\n-----\n\n" .
177
-            "sig response : " . $_POST['sig_response'] . "\n" .
178
-            'resp : ' . $resp . "\n"
176
+            "\n\n-----\n\n".
177
+            "sig response : ".$_POST['sig_response']."\n".
178
+            'resp : '.$resp."\n"
179 179
         );
180 180
     }
181 181
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
     // increment counter of login attempts
194 194
     if (empty($_SESSION["pwd_attempts"])) $_SESSION["pwd_attempts"] = 1;
195
-    else $_SESSION["pwd_attempts"] ++;
195
+    else $_SESSION["pwd_attempts"]++;
196 196
 
197 197
     // manage brute force
198 198
     if ($_SESSION["pwd_attempts"] <= 3) {
@@ -236,13 +236,13 @@  discard block
 block discarded – undo
236 236
     require_once $_SESSION['settings']['cpassman_dir'].'/sources/SplClassLoader.php';
237 237
 
238 238
     if ($debugDuo == 1) {
239
-        $dbgDuo = fopen($_SESSION['settings']['path_to_files_folder'] . "/duo.debug.txt", "a");
239
+        $dbgDuo = fopen($_SESSION['settings']['path_to_files_folder']."/duo.debug.txt", "a");
240 240
     }
241 241
 
242 242
     if ($debugDuo == 1) {
243 243
         fputs(
244 244
             $dbgDuo,
245
-            "Content of data sent '" . $sentData . "'\n"
245
+            "Content of data sent '".$sentData."'\n"
246 246
         );
247 247
     }
248 248
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     if ($debugDuo == 1) {
283 283
         fputs(
284 284
             $dbgDuo,
285
-            "Starting authentication of '" . $username . "'\n"
285
+            "Starting authentication of '".$username."'\n"
286 286
         );
287 287
     }
288 288
 
@@ -300,18 +300,18 @@  discard block
 block discarded – undo
300 300
         $dbgLdap = fopen($_SESSION['settings']['path_to_files_folder']."/ldap.debug.txt", "w");
301 301
         fputs(
302 302
             $dbgLdap,
303
-            "Get all LDAP params : \n" .
304
-            'mode : ' . $_SESSION['settings']['ldap_mode'] . "\n" .
305
-            'type : ' . $_SESSION['settings']['ldap_type'] . "\n" .
306
-            'base_dn : '.$_SESSION['settings']['ldap_domain_dn']."\n" .
307
-            'search_base : ' . $_SESSION['settings']['ldap_search_base']."\n" .
308
-            'bind_dn : ' . $_SESSION['settings']['ldap_bind_dn']."\n" .
309
-            'bind_passwd : ' . $_SESSION['settings']['ldap_bind_passwd']."\n" .
310
-            'user_attribute : ' . $_SESSION['settings']['ldap_user_attribute']."\n" .
311
-            'account_suffix : '.$_SESSION['settings']['ldap_suffix']."\n" .
312
-            'domain_controllers : '.$_SESSION['settings']['ldap_domain_controler']."\n" .
313
-            'port : '.$_SESSION['settings']['ldap_port']."\n" .
314
-            'use_ssl : '.$_SESSION['settings']['ldap_ssl']."\n" .
303
+            "Get all LDAP params : \n".
304
+            'mode : '.$_SESSION['settings']['ldap_mode']."\n".
305
+            'type : '.$_SESSION['settings']['ldap_type']."\n".
306
+            'base_dn : '.$_SESSION['settings']['ldap_domain_dn']."\n".
307
+            'search_base : '.$_SESSION['settings']['ldap_search_base']."\n".
308
+            'bind_dn : '.$_SESSION['settings']['ldap_bind_dn']."\n".
309
+            'bind_passwd : '.$_SESSION['settings']['ldap_bind_passwd']."\n".
310
+            'user_attribute : '.$_SESSION['settings']['ldap_user_attribute']."\n".
311
+            'account_suffix : '.$_SESSION['settings']['ldap_suffix']."\n".
312
+            'domain_controllers : '.$_SESSION['settings']['ldap_domain_controler']."\n".
313
+            'port : '.$_SESSION['settings']['ldap_port']."\n".
314
+            'use_ssl : '.$_SESSION['settings']['ldap_ssl']."\n".
315 315
             'use_tls : '.$_SESSION['settings']['ldap_tls']."\n*********\n\n"
316 316
         );
317 317
     }
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
     if ($debugDuo == 1) {
320 320
         fputs(
321 321
             $dbgDuo,
322
-            "LDAP status: " . $_SESSION['settings']['ldap_mode'] . "\n"
322
+            "LDAP status: ".$_SESSION['settings']['ldap_mode']."\n"
323 323
         );
324 324
     }
325 325
 
@@ -328,13 +328,13 @@  discard block
 block discarded – undo
328 328
     ) {
329 329
         //Multiple Domain Names
330 330
         if (strpos(html_entity_decode($username), '\\') == true) {
331
-            $ldap_suffix="@".substr(html_entity_decode($username), 0, strpos(html_entity_decode($username), '\\'));
332
-            $username=substr(html_entity_decode($username), strpos(html_entity_decode($username), '\\') + 1);
331
+            $ldap_suffix = "@".substr(html_entity_decode($username), 0, strpos(html_entity_decode($username), '\\'));
332
+            $username = substr(html_entity_decode($username), strpos(html_entity_decode($username), '\\') + 1);
333 333
         }
334 334
         if ($_SESSION['settings']['ldap_type'] == 'posix-search') {
335 335
             $ldapURIs = "";
336
-            foreach(explode(",", $_SESSION['settings']['ldap_domain_controler']) as $domainControler) {
337
-                if($_SESSION['settings']['ldap_ssl'] == 1) {
336
+            foreach (explode(",", $_SESSION['settings']['ldap_domain_controler']) as $domainControler) {
337
+                if ($_SESSION['settings']['ldap_ssl'] == 1) {
338 338
                     $ldapURIs .= "ldaps://".$domainControler.":".$_SESSION['settings']['ldap_port']." ";
339 339
                 }
340 340
                 else {
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                 }
343 343
             }
344 344
             if ($debugLdap == 1) {
345
-                fputs($dbgLdap, "LDAP URIs : " . $ldapURIs . "\n");
345
+                fputs($dbgLdap, "LDAP URIs : ".$ldapURIs."\n");
346 346
             }
347 347
             $ldapconn = ldap_connect($ldapURIs);
348 348
 
@@ -350,25 +350,25 @@  discard block
 block discarded – undo
350 350
                ldap_start_tls($ldapconn);
351 351
             }
352 352
             if ($debugLdap == 1) {
353
-                fputs($dbgLdap, "LDAP connection : " . ($ldapconn ? "Connected" : "Failed") . "\n");
353
+                fputs($dbgLdap, "LDAP connection : ".($ldapconn ? "Connected" : "Failed")."\n");
354 354
             }
355 355
             ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
356 356
             if ($ldapconn) {
357 357
                 $ldapbind = ldap_bind($ldapconn, $_SESSION['settings']['ldap_bind_dn'], $_SESSION['settings']['ldap_bind_passwd']);
358 358
                 if ($debugLdap == 1) {
359
-                    fputs($dbgLdap, "LDAP bind : " . ($ldapbind ? "Bound" : "Failed") . "\n");
359
+                    fputs($dbgLdap, "LDAP bind : ".($ldapbind ? "Bound" : "Failed")."\n");
360 360
                 }
361 361
                 if ($ldapbind) {
362
-                    $filter="(&(" . $_SESSION['settings']['ldap_user_attribute']. "=$username)(objectClass=" . $_SESSION['settings']['ldap_object_class'] ."))";
363
-                    $result=ldap_search($ldapconn, $_SESSION['settings']['ldap_search_base'], $filter, array('dn','mail','givenname','sn'));
362
+                    $filter = "(&(".$_SESSION['settings']['ldap_user_attribute']."=$username)(objectClass=".$_SESSION['settings']['ldap_object_class']."))";
363
+                    $result = ldap_search($ldapconn, $_SESSION['settings']['ldap_search_base'], $filter, array('dn', 'mail', 'givenname', 'sn'));
364 364
                     if (isset($_SESSION['settings']['ldap_usergroup'])) {
365 365
                         $filter_group = "memberUid=".$username;
366
-                        $result_group = ldap_search($ldapconn, $_SESSION['settings']['ldap_usergroup'],$filter_group, array('dn'));
366
+                        $result_group = ldap_search($ldapconn, $_SESSION['settings']['ldap_usergroup'], $filter_group, array('dn'));
367 367
                         if ($debugLdap == 1) {
368 368
                                 fputs(
369 369
                                      $dbgLdap,
370
-                                     'Search filter (group): ' . $filter_group . "\n" .
371
-                                     'Results : ' . print_r(ldap_get_entries($ldapconn, $result_group), true) . "\n"
370
+                                     'Search filter (group): '.$filter_group."\n".
371
+                                     'Results : '.print_r(ldap_get_entries($ldapconn, $result_group), true)."\n"
372 372
                                 );
373 373
                         }
374 374
                         if (!ldap_count_entries($ldapconn, $result_group)) {
@@ -380,8 +380,8 @@  discard block
 block discarded – undo
380 380
                     if ($debugLdap == 1) {
381 381
                         fputs(
382 382
                             $dbgLdap,
383
-                            'Search filter : ' . $filter . "\n" .
384
-                            'Results : ' . print_r(ldap_get_entries($ldapconn, $result), true) . "\n"
383
+                            'Search filter : '.$filter."\n".
384
+                            'Results : '.print_r(ldap_get_entries($ldapconn, $result), true)."\n"
385 385
                         );
386 386
                     }
387 387
                     if ($ldapConnection && ldap_count_entries($ldapconn, $result)) {
@@ -405,12 +405,12 @@  discard block
 block discarded – undo
405 405
             if ($debugLdap == 1) {
406 406
                 fputs(
407 407
                     $dbgLdap,
408
-                    "Get all ldap params : \n" .
409
-                    'base_dn : '.$_SESSION['settings']['ldap_domain_dn']."\n" .
410
-                    'account_suffix : '.$_SESSION['settings']['ldap_suffix']."\n" .
411
-                    'domain_controllers : '.$_SESSION['settings']['ldap_domain_controler']."\n" .
412
-                    'port : '.$_SESSION['settings']['ldap_port']."\n" .
413
-                    'use_ssl : '.$_SESSION['settings']['ldap_ssl']."\n" .
408
+                    "Get all ldap params : \n".
409
+                    'base_dn : '.$_SESSION['settings']['ldap_domain_dn']."\n".
410
+                    'account_suffix : '.$_SESSION['settings']['ldap_suffix']."\n".
411
+                    'domain_controllers : '.$_SESSION['settings']['ldap_domain_controler']."\n".
412
+                    'port : '.$_SESSION['settings']['ldap_port']."\n".
413
+                    'use_ssl : '.$_SESSION['settings']['ldap_ssl']."\n".
414 414
                     'use_tls : '.$_SESSION['settings']['ldap_tls']."\n*********\n\n"
415 415
                 );
416 416
             }
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
             if ($debugLdap == 1) {
466 466
                 fputs(
467 467
                     $dbgLdap,
468
-                    "After authenticate : ".$adldap->getLastError()."\n\n\n" .
468
+                    "After authenticate : ".$adldap->getLastError()."\n\n\n".
469 469
                     "ldap status : ".$ldapConnection."\n\n\n"
470 470
                 ); //Debug
471 471
             }
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
     if ($debugDuo == 1) {
486 486
         fputs(
487 487
             $dbgDuo,
488
-            "USer exists: " . $counter . "\n"
488
+            "USer exists: ".$counter."\n"
489 489
         );
490 490
     }
491 491
 
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
             && ($_SESSION['settings']['ldap_elusers'] == 0)
521 521
     ) {
522 522
         // If LDAP enabled, create user in CPM if doesn't exist
523
-        $data['pw'] = $pwdlib->createPasswordHash($passwordClear);  // create passwordhash
523
+        $data['pw'] = $pwdlib->createPasswordHash($passwordClear); // create passwordhash
524 524
 
525 525
         // get user info from LDAP
526 526
         if ($_SESSION['settings']['ldap_type'] == 'posix-search') {
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
     if ($debugDuo == 1) {
585 585
         fputs(
586 586
             $dbgDuo,
587
-            "User exists (confirm): " . $counter . "\n"
587
+            "User exists (confirm): ".$counter."\n"
588 588
         );
589 589
     }
590 590
 
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
     if ($debugDuo == 1) {
643 643
         fputs(
644 644
             $dbgDuo,
645
-            "Proceed with Ident: " . $proceedIdentification . "\n"
645
+            "Proceed with Ident: ".$proceedIdentification."\n"
646 646
         );
647 647
     }
648 648
 
@@ -679,17 +679,17 @@  discard block
 block discarded – undo
679 679
                 unset($_SESSION['flickercode']);
680 680
             } else {
681 681
                 if ($result < -10) {
682
-                    $logError =  "ERROR: ".$result;
682
+                    $logError = "ERROR: ".$result;
683 683
                 } else if ($result == -4) {
684
-                    $logError =  "Wrong response code, no more tries left.";
684
+                    $logError = "Wrong response code, no more tries left.";
685 685
                 } else if ($result == -3) {
686
-                    $logError =  "Wrong response code, try to reenter.";
686
+                    $logError = "Wrong response code, try to reenter.";
687 687
                 } else if ($result == -2) {
688
-                    $logError =  "Timeout. The response code is not valid anymore.";
688
+                    $logError = "Timeout. The response code is not valid anymore.";
689 689
                 } else if ($result == -1) {
690
-                    $logError =  "Security Error. Did you try to verify the response from a different computer?";
690
+                    $logError = "Security Error. Did you try to verify the response from a different computer?";
691 691
                 } else if ($result == 1) {
692
-                    $logError =  "Authentication successful, response code correct.
692
+                    $logError = "Authentication successful, response code correct.
693 693
                           <br /><br />Authentification Method for SecureBrowser updated!";
694 694
                     // Add necessary code here for accessing your Business Application
695 695
                 }
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
         if ($debugDuo == 1) {
777 777
             fputs(
778 778
                 $dbgDuo,
779
-                "User's password verified: " . $userPasswordVerified . "\n"
779
+                "User's password verified: ".$userPasswordVerified."\n"
780 780
             );
781 781
         }
782 782
 
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
             if ($debugDuo == 1) {
812 812
                 fputs(
813 813
                     $dbgDuo,
814
-                    "User's token: " . $key . "\n"
814
+                    "User's token: ".$key."\n"
815 815
                 );
816 816
             }
817 817
 
@@ -933,7 +933,7 @@  discard block
 block discarded – undo
933 933
                     'disabled' => 0,
934 934
                     'no_bad_attempts' => 0,
935 935
                     'session_end' => $_SESSION['fin_session'],
936
-                    'psk' => $pwdlib->createPasswordHash(htmlspecialchars_decode($psk)),    //bCrypt(htmlspecialchars_decode($psk), COST)
936
+                    'psk' => $pwdlib->createPasswordHash(htmlspecialchars_decode($psk)), //bCrypt(htmlspecialchars_decode($psk), COST)
937 937
                     'user_ip' =>  get_client_ip_server()
938 938
                 ),
939 939
                 "id=%i",
@@ -1080,8 +1080,8 @@  discard block
 block discarded – undo
1080 1080
     if ($debugDuo == 1) {
1081 1081
         fputs(
1082 1082
             $dbgDuo,
1083
-            "\n\n----\n" .
1084
-            "Identified : " . $return . "\n\n"
1083
+            "\n\n----\n".
1084
+            "Identified : ".$return."\n\n"
1085 1085
         );
1086 1086
     }
1087 1087
 
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             $_POST['login']
95 95
         );
96 96
         $row['agses-usercardid'] = filter_var($_POST['cardid'], FILTER_SANITIZE_NUMBER_INT);
97
-    }else {
97
+    } else {
98 98
         // error
99 99
         echo '[{"error" : "something_wrong" , "agses_message" : ""}]';
100 100
         return false;
@@ -191,8 +191,11 @@  discard block
 block discarded – undo
191 191
 //--------
192 192
 
193 193
     // increment counter of login attempts
194
-    if (empty($_SESSION["pwd_attempts"])) $_SESSION["pwd_attempts"] = 1;
195
-    else $_SESSION["pwd_attempts"] ++;
194
+    if (empty($_SESSION["pwd_attempts"])) {
195
+        $_SESSION["pwd_attempts"] = 1;
196
+    } else {
197
+        $_SESSION["pwd_attempts"] ++;
198
+    }
196 199
 
197 200
     // manage brute force
198 201
     if ($_SESSION["pwd_attempts"] <= 3) {
@@ -336,8 +339,7 @@  discard block
 block discarded – undo
336 339
             foreach(explode(",", $_SESSION['settings']['ldap_domain_controler']) as $domainControler) {
337 340
                 if($_SESSION['settings']['ldap_ssl'] == 1) {
338 341
                     $ldapURIs .= "ldaps://".$domainControler.":".$_SESSION['settings']['ldap_port']." ";
339
-                }
340
-                else {
342
+                } else {
341 343
                     $ldapURIs .= "ldap://".$domainControler.":".$_SESSION['settings']['ldap_port']." ";
342 344
                 }
343 345
             }
@@ -420,8 +422,7 @@  discard block
 block discarded – undo
420 422
             // Posix style LDAP handles user searches a bit differently
421 423
             if ($_SESSION['settings']['ldap_type'] == 'posix') {
422 424
                 $ldap_suffix = ','.$_SESSION['settings']['ldap_suffix'].','.$_SESSION['settings']['ldap_domain_dn'];
423
-            }
424
-            elseif ($_SESSION['settings']['ldap_type'] == 'windows' and $ldap_suffix == '') { //Multiple Domain Names
425
+            } elseif ($_SESSION['settings']['ldap_type'] == 'windows' and $ldap_suffix == '') { //Multiple Domain Names
425 426
                 $ldap_suffix = $_SESSION['settings']['ldap_suffix'];
426 427
             }
427 428
             $adldap = new adLDAP\adLDAP(
@@ -840,7 +841,9 @@  discard block
 block discarded – undo
840 841
             $_SESSION['user_avatar_thumb'] = $data['avatar_thumb'];
841 842
             $_SESSION['user_upgrade_needed'] = $data['upgrade_needed'];
842 843
             // get personal settings
843
-            if (!isset($data['treeloadstrategy']) || empty($data['treeloadstrategy'])) $data['treeloadstrategy'] = "full";
844
+            if (!isset($data['treeloadstrategy']) || empty($data['treeloadstrategy'])) {
845
+                $data['treeloadstrategy'] = "full";
846
+            }
844 847
             $_SESSION['user_settings']['treeloadstrategy'] = $data['treeloadstrategy'];
845 848
             $_SESSION['user_settings']['agses-usercardid'] = $data['agses-usercardid'];
846 849
             $_SESSION['user_settings']['user_language'] = $data['user_language'];
Please login to merge, or discard this patch.
sources/checks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 function curPage()
30 30
 {
31
-    parse_str(substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], "?")+1), $result);
31
+    parse_str(substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], "?") + 1), $result);
32 32
     return $result['page'];
33 33
 }
34 34
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 function IsInArray($pages, $table)
88 88
 {
89
-    foreach($pages as $page) {
89
+    foreach ($pages as $page) {
90 90
         if (in_array($page, $table)) {
91 91
             return true;
92 92
         }
Please login to merge, or discard this patch.
sources/folders.queries.php 3 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             prefix_table("nested_tree"),
85 85
             array(
86 86
                 'renewal_period' => mysqli_escape_string($link, stripslashes(($_POST['renewal_period'])))
87
-           ),
87
+            ),
88 88
             "id=%i",
89 89
             $id[1]
90 90
         );
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         prefix_table("nested_tree"),
104 104
         array(
105 105
             'parent_id' => $_POST['newparent_id']
106
-       ),
106
+        ),
107 107
         "id=%i",
108 108
         $id[1]
109 109
     );
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 'type' => 'complex',
139 139
                 'intitule' => $id[1],
140 140
                 'valeur' => $_POST['changer_complexite']
141
-           )
141
+            )
142 142
         );
143 143
     } else {
144 144
         //update DB
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             prefix_table("misc"),
147 147
             array(
148 148
                 'valeur' => $_POST['changer_complexite']
149
-           ),
149
+            ),
150 150
             "type=%s AND  intitule = %i",
151 151
             "complex",
152 152
             $id[1]
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
                                 'valeur' => $folder->id.', '.$folder->parent_id.', '.
221 221
                                     $folder->title.', '.$folder->nleft.', '.$folder->nright.', '.
222 222
                                     $folder->nlevel.', 0, 0, 0, 0'
223
-                           )
223
+                            )
224 224
                         );
225 225
 
226 226
                         //array for delete folder
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
                             'renewal_period' => $renewalPeriod,
477 477
                             'bloquer_creation' => isset($dataReceived['block_creation']) && $dataReceived['block_creation'] == 1 ? '1' : $parentBloquerCreation,
478 478
                             'bloquer_modification' => isset($dataReceived['block_modif']) && $dataReceived['block_modif'] == 1 ? '1' : $parentBloquerModification
479
-                       )
479
+                        )
480 480
                     );
481 481
                     $newId = DB::insertId();
482 482
 
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
                         'tree_id' => $val[0],
729 729
                         'fonction_id' => $val[1],
730 730
                         'authorized' => 1
731
-                   )
731
+                    )
732 732
                 );
733 733
             } else {
734 734
                 //Update DB
@@ -737,20 +737,20 @@  discard block
 block discarded – undo
737 737
                         prefix_table("rights"),
738 738
                         array(
739 739
                             'authorized' => 0
740
-                       ),
741
-                       "id = %i AND fonction_id=%i",
742
-                       $val[0],
743
-                       $val[1]
740
+                        ),
741
+                        "id = %i AND fonction_id=%i",
742
+                        $val[0],
743
+                        $val[1]
744 744
                     );
745 745
                 } else {
746 746
                     DB::update(
747 747
                         prefix_table("rights"),
748 748
                         array(
749 749
                             'authorized' => 1
750
-                       ),
751
-                       "id = %i AND fonction_id=%i",
752
-                       $val[0],
753
-                       $val[1]
750
+                        ),
751
+                        "id = %i AND fonction_id=%i",
752
+                        $val[0],
753
+                        $val[1]
754 754
                     );
755 755
                 }
756 756
             }
@@ -941,7 +941,7 @@  discard block
 block discarded – undo
941 941
                         'renewal_period' => $nodeInfo->renewal_period,
942 942
                         'bloquer_creation' => $nodeInfo->bloquer_creation,
943 943
                         'bloquer_modification' => $nodeInfo->bloquer_modification
944
-                   )
944
+                    )
945 945
                 );
946 946
                 $newFolderId = DB::insertId();
947 947
 
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
                                     'extension' => $record2['extension'],
1122 1122
                                     'type' => $record2['type'],
1123 1123
                                     'file' => $record2['file']
1124
-                                   )
1124
+                                    )
1125 1125
                             );
1126 1126
                         }
1127 1127
                         // Add this duplicate in logs
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             }
210 210
 
211 211
             foreach ($folders as $folder) {
212
-                if (($folder->parent_id > 0 || $folder->parent_id == 0) && $folder->title != $_SESSION['user_id'] ) {
212
+                if (($folder->parent_id > 0 || $folder->parent_id == 0) && $folder->title != $_SESSION['user_id']) {
213 213
                     //Store the deleted folder (recycled bin)
214 214
                     if ($pf === false) {
215 215
                         DB::insert(
@@ -265,12 +265,12 @@  discard block
 block discarded – undo
265 265
                     );
266 266
 
267 267
                     //Actualize the variable
268
-                    $_SESSION['nb_folders'] --;
268
+                    $_SESSION['nb_folders']--;
269 269
                 }
270 270
             }
271 271
 
272 272
             // delete folder from SESSION
273
-            if(($key = array_search($_POST['id'], $_SESSION['groupes_visibles'])) !== false) {
273
+            if (($key = array_search($_POST['id'], $_SESSION['groupes_visibles'])) !== false) {
274 274
                 unset($folders[$key]);
275 275
             }
276 276
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 
281 281
             // delete folders
282 282
             $folderForDel = array_unique($folderForDel);
283
-            foreach ($folderForDel as $fol){
283
+            foreach ($folderForDel as $fol) {
284 284
                 DB::delete(prefix_table("nested_tree"), "id = %i", $fol);
285 285
             }
286 286
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                                 );
347 347
 
348 348
                                 // delete folder from SESSION
349
-                                if(($key = array_search($item['id'], $_SESSION['groupes_visibles'])) !== false) {
349
+                                if (($key = array_search($item['id'], $_SESSION['groupes_visibles'])) !== false) {
350 350
                                     unset($_SESSION['groupes_visibles'][$item['id']]);
351 351
                                 }
352 352
 
@@ -355,13 +355,13 @@  discard block
 block discarded – undo
355 355
                             }
356 356
 
357 357
                             //Actualize the variable
358
-                            $_SESSION['nb_folders'] --;
358
+                            $_SESSION['nb_folders']--;
359 359
                         }
360 360
                     }
361 361
 
362 362
                     // delete folders
363
-                    $folderForDel=array_unique($folderForDel);
364
-                    foreach ($folderForDel as $fol){
363
+                    $folderForDel = array_unique($folderForDel);
364
+                    foreach ($folderForDel as $fol) {
365 365
                         DB::delete(prefix_table("nested_tree"), "id = %i", $fol);
366 366
                     }
367 367
                 }
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
                         && $_SESSION['settings']['subfolder_rights_as_parent'] == 1
507 507
                         && $_SESSION['is_admin'] !== 0
508 508
                         || ($isPersonal != 1 && $parentId === "0")
509
-                    ){
509
+                    ) {
510 510
                         //Get user's rights
511 511
                         @identifyUserRights(
512 512
                             $_SESSION['groupes_visibles'].';'.$newId,
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
                         }
583 583
                     }
584 584
                 }
585
-                else{
585
+                else {
586 586
                     $error = $LANG['error_not_allowed_to'];
587 587
                 }
588 588
             }
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
             if (isset($_SESSION['settings']['duplicate_folder']) && $_SESSION['settings']['duplicate_folder'] == 0) {
626 626
                 $data = DB::queryfirstrow(
627 627
                     "SELECT id, title FROM ".prefix_table("nested_tree")." WHERE title = %s", $title);
628
-                if (!empty($data['id']) && $dataReceived['id'] != $data['id'] && $title != $data['title'] ) {
628
+                if (!empty($data['id']) && $dataReceived['id'] != $data['id'] && $title != $data['title']) {
629 629
                     echo '[ { "error" : "error_group_exist" } ]';
630 630
                     break;
631 631
                 }
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
                 );
733 733
             } else {
734 734
                 //Update DB
735
-                if ($data['authorized']==1) {
735
+                if ($data['authorized'] == 1) {
736 736
                     DB::update(
737 737
                         prefix_table("rights"),
738 738
                         array(
@@ -832,10 +832,10 @@  discard block
 block discarded – undo
832 832
             // Get through each subfolder
833 833
             $folders = $tree->getDescendants($_POST['id'], false);
834 834
             foreach ($folders as $folder) {
835
-                if($subfolders === "") {
835
+                if ($subfolders === "") {
836 836
                     $subfolders = $folder->id;
837 837
                 } else {
838
-                    $subfolders .= ";" . $folder->id;
838
+                    $subfolders .= ";".$folder->id;
839 839
                 }
840 840
             }
841 841
 
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
                 if (in_array($t->id, $_SESSION['groupes_visibles'])) {
870 870
                     if (!is_numeric($t->title)) {
871 871
                         $ident = "&nbsp;&nbsp;";
872
-                        for ($x=1; $x<$t->nlevel; $x++) {
872
+                        for ($x = 1; $x < $t->nlevel; $x++) {
873 873
                             $ident .= "&nbsp;&nbsp;";
874 874
                         }
875 875
 
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
                     && isset($_SESSION['settings']['subfolder_rights_as_parent'])
971 971
                     && $_SESSION['settings']['subfolder_rights_as_parent'] == 1
972 972
                     && $_SESSION['is_admin'] !== 0
973
-                ){
973
+                ) {
974 974
                     //Get user's rights
975 975
                     @identifyUserRights(
976 976
                         $_SESSION['groupes_visibles'].';'.$newFolderId,
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -581,8 +581,7 @@
 block discarded – undo
581 581
                             $prev_level = $t->nlevel;
582 582
                         }
583 583
                     }
584
-                }
585
-                else{
584
+                } else{
586 585
                     $error = $LANG['error_not_allowed_to'];
587 586
                 }
588 587
             }
Please login to merge, or discard this patch.
sources/datatable/datatable.logs.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     //Paging
47 47
     $sLimit = "";
48 48
     if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {
49
-        $sLimit = "LIMIT ". mysqli_real_escape_string($link, filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT)) ;
49
+        $sLimit = "LIMIT ".mysqli_real_escape_string($link, filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT)).", ".mysqli_real_escape_string($link, filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT));
50 50
     }
51 51
 }
52 52
 
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
     //Ordering
58 58
     if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
59 59
         $sOrder = "ORDER BY  ";
60
-        for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
60
+        for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
61 61
             if (
62
-                $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
62
+                $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
63 63
                 preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
64 64
             ) {
65
-                $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
66
-                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
65
+                $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
66
+                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
67 67
             }
68 68
         }
69 69
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     $sWhere = "WHERE l.type = 'user_connection'";
83 83
     if ($_GET['sSearch'] != "") {
84 84
         $sWhere .= " AND (";
85
-        for ($i=0; $i<count($aColumns); $i++) {
85
+        for ($i = 0; $i < count($aColumns); $i++) {
86 86
             $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR ";
87 87
         }
88 88
         $sWhere = substr_replace($sWhere, "", -3).") ";
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         $sOutput .= '"'.date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date']).'", ';
140 140
 
141 141
         //col2
142
-        $sOutput .= '"'.str_replace(array(CHR(10),CHR(13)),array(' ',' '),htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", ';
142
+        $sOutput .= '"'.str_replace(array(CHR(10), CHR(13)), array(' ', ' '), htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", ';
143 143
 
144 144
         //col3
145 145
         $sOutput .= '"'.htmlspecialchars(stripslashes($record['login']), ENT_QUOTES).'"';
@@ -163,13 +163,13 @@  discard block
 block discarded – undo
163 163
     //Ordering
164 164
     if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
165 165
         $sOrder = "ORDER BY  ";
166
-        for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
166
+        for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
167 167
             if (
168
-                $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
168
+                $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
169 169
                 preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
170 170
             ) {
171
-                $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
172
-                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
171
+                $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
172
+                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
173 173
             }
174 174
         }
175 175
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     $sWhere = " WHERE l.type = 'error'";
184 184
     if ($_GET['sSearch'] != "") {
185 185
         $sWhere .= " AND (";
186
-        for ($i=0; $i<count($aColumns); $i++) {
186
+        for ($i = 0; $i < count($aColumns); $i++) {
187 187
             $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR ";
188 188
         }
189 189
         $sWhere = substr_replace($sWhere, "", -3).") ";
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         $sOutput .= '"'.date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date']).'", ';
239 239
 
240 240
         //col2
241
-        $sOutput .= '"'.str_replace(array(CHR(10),CHR(13)),array(' ',' '),htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", ';
241
+        $sOutput .= '"'.str_replace(array(CHR(10), CHR(13)), array(' ', ' '), htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", ';
242 242
 
243 243
         //col3
244 244
         $sOutput .= '"'.htmlspecialchars(stripslashes($record['login']), ENT_QUOTES).'"';
@@ -262,13 +262,13 @@  discard block
 block discarded – undo
262 262
     //Ordering
263 263
     if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
264 264
         $sOrder = "ORDER BY  ";
265
-        for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
265
+        for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
266 266
             if (
267
-                $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
267
+                $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
268 268
                 preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
269 269
             ) {
270
-                $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
271
-                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
270
+                $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
271
+                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
272 272
             }
273 273
         }
274 274
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
     $sWhere = " WHERE l.action = 'at_shown'";
283 283
     if ($_GET['sSearch'] != "") {
284 284
         $sWhere .= " AND (";
285
-        for ($i=0; $i<count($aColumns); $i++) {
285
+        for ($i = 0; $i < count($aColumns); $i++) {
286 286
             $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR ";
287 287
         }
288 288
         $sWhere = substr_replace($sWhere, "", -3).") ";
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         $sOutput .= '"'.date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date']).'", ';
340 340
 
341 341
         //col2
342
-        $sOutput .= '"'.str_replace(array(CHR(10),CHR(13)),array(' ',' '),htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", ';
342
+        $sOutput .= '"'.str_replace(array(CHR(10), CHR(13)), array(' ', ' '), htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", ';
343 343
 
344 344
         //col3
345 345
         $sOutput .= '"'.htmlspecialchars(stripslashes($record['login']), ENT_QUOTES).'"';
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
     //Ordering
364 364
     if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
365 365
         $sOrder = "ORDER BY  ";
366
-        for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
366
+        for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
367 367
             if (
368
-                $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
368
+                $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
369 369
                 preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
370 370
             ) {
371
-                $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
372
-                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
371
+                $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
372
+                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
373 373
             }
374 374
         }
375 375
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
     $sWhere = " WHERE l.action = 'at_copy'";
384 384
     if ($_GET['sSearch'] != "") {
385 385
         $sWhere .= " AND (";
386
-        for ($i=0; $i<count($aColumns); $i++) {
386
+        for ($i = 0; $i < count($aColumns); $i++) {
387 387
             $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR ";
388 388
         }
389 389
         $sWhere = substr_replace($sWhere, "", -3).") ";
@@ -464,13 +464,13 @@  discard block
 block discarded – undo
464 464
     //Ordering
465 465
     if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
466 466
         $sOrder = "ORDER BY  ";
467
-        for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
467
+        for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
468 468
             if (
469
-                $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
469
+                $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
470 470
                 preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
471 471
             ) {
472
-                $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
473
-                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
472
+                $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
473
+                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
474 474
             }
475 475
         }
476 476
 
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
     $sWhere = "WHERE l.type = 'admin_action'";
487 487
     if ($_GET['sSearch'] != "") {
488 488
         $sWhere .= " AND (";
489
-        for ($i=0; $i<count($aColumns); $i++) {
489
+        for ($i = 0; $i < count($aColumns); $i++) {
490 490
             $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR ";
491 491
         }
492 492
         $sWhere = substr_replace($sWhere, "", -3);
@@ -565,13 +565,13 @@  discard block
 block discarded – undo
565 565
     //Ordering
566 566
     if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
567 567
         $sOrder = "ORDER BY  ";
568
-        for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
568
+        for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
569 569
             if (
570
-                $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
570
+                $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
571 571
                 preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
572 572
             ) {
573
-                $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
574
-                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
573
+                $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
574
+                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
575 575
             }
576 576
         }
577 577
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
     $sWhere = "";
588 588
     if ($_GET['sSearch'] != "") {
589 589
         $sWhere .= " WHERE (";
590
-        for ($i=1; $i<count($aColumns)-1; $i++) {
590
+        for ($i = 1; $i < count($aColumns) - 1; $i++) {
591 591
             $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR ";
592 592
         }
593 593
         $sWhere = substr_replace($sWhere, "", -3);
@@ -658,9 +658,9 @@  discard block
 block discarded – undo
658 658
 
659 659
         //col5
660 660
         if ($record['perso'] == 1) {
661
-            $sOutput_item .= '"'. htmlspecialchars(stripslashes($LANG['yes']), ENT_QUOTES). '"';
661
+            $sOutput_item .= '"'.htmlspecialchars(stripslashes($LANG['yes']), ENT_QUOTES).'"';
662 662
         } else {
663
-            $sOutput_item .= '"'. htmlspecialchars(stripslashes($LANG['no']), ENT_QUOTES). '"';
663
+            $sOutput_item .= '"'.htmlspecialchars(stripslashes($LANG['no']), ENT_QUOTES).'"';
664 664
         }
665 665
 
666 666
         //Finish the line
@@ -684,13 +684,13 @@  discard block
 block discarded – undo
684 684
     //Ordering
685 685
     if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
686 686
         $sOrder = "ORDER BY  ";
687
-        for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
687
+        for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
688 688
             if (
689
-                $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
689
+                $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
690 690
                 preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
691 691
             ) {
692
-                $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
693
-                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
692
+                $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
693
+                .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
694 694
             }
695 695
         }
696 696
 
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
     $sWhere = " WHERE l.type = 'failed_auth'";
705 705
     if ($_GET['sSearch'] != "") {
706 706
         $sWhere .= " AND (";
707
-        for ($i=0; $i<count($aColumns); $i++) {
707
+        for ($i = 0; $i < count($aColumns); $i++) {
708 708
             $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR ";
709 709
         }
710 710
         $sWhere = substr_replace($sWhere, "", -3).") ";
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
         $sOutput .= '"'.date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['auth_date']).'", ';
758 758
 
759 759
         //col2
760
-        $sOutput .= '"'.str_replace(array(CHR(10),CHR(13)),array(' ',' '),htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", ';
760
+        $sOutput .= '"'.str_replace(array(CHR(10), CHR(13)), array(' ', ' '), htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", ';
761 761
 
762 762
         //col3
763 763
         $sOutput .= '"'.htmlspecialchars(stripslashes($record['who']), ENT_QUOTES).'"';
Please login to merge, or discard this patch.
sources/datatable/datatable.kb.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
 //Paging
47 47
 $sLimit = "";
48 48
 if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {
49
-    $sLimit = "LIMIT ". filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT)."";
49
+    $sLimit = "LIMIT ".filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT)."";
50 50
 }
51 51
 
52 52
 //Ordering
53 53
 
54 54
 if (isset($_GET['iSortCol_0']) && in_array($_GET['iSortCol_0'], $aSortTypes)) {
55 55
     $sOrder = "ORDER BY  ";
56
-    for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
56
+    for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
57 57
         if (
58
-            $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
58
+            $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
59 59
             preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
60 60
         ) {
61
-            $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
62
-            .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
61
+            $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
62
+            .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
63 63
         }
64 64
     }
65 65
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 */
78 78
 if ($_GET['sSearch'] != "") {
79 79
     $sWhere = " WHERE ";
80
-    for ($i=0; $i<count($aColumns); $i++) {
80
+    for ($i = 0; $i < count($aColumns); $i++) {
81 81
         $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR ";
82 82
     }
83 83
     $sWhere = substr_replace($sWhere, "", -3);
Please login to merge, or discard this patch.
sources/datatable/datatable.users.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 //Paging
65 65
 $sLimit = "";
66 66
 if (isset($_GET['length']) && $_GET['length'] != '-1') {
67
-    $sLimit = "LIMIT ". filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT)."";
67
+    $sLimit = "LIMIT ".filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT)."";
68 68
 }
69 69
 
70 70
 //Ordering
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
     if (
74 74
         preg_match("#^(asc|desc)\$#i", $_GET['order'][0]['column'])
75 75
     ) {
76
-        $sOrder .= "".$aColumns[ filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT) ]." "
77
-        .mysqli_escape_string($link, $_GET['order'][0]['column']) .", ";
76
+        $sOrder .= "".$aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)]." "
77
+        .mysqli_escape_string($link, $_GET['order'][0]['column']).", ";
78 78
     }
79 79
 
80 80
     $sOrder = substr_replace($sOrder, "", -2);
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
         //col11
286 286
         if ($_SESSION['is_admin'] === "1" || $_SESSION['user_can_manage_all_users'] == 1) {
287 287
             if ($record['can_manage_all_users'] === "1") {
288
-                $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"' . $record['id'] . '-can_manage_all_users-0\"></i>"';
288
+                $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_manage_all_users-0\"></i>"';
289 289
             } else {
290
-                $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"' . $record['id'] . '-can_manage_all_users-1\"></i>"';
290
+                $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_manage_all_users-1\"></i>"';
291 291
             }
292 292
         } else {
293 293
             $sOutput .= '""';
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         //Finish the line
308 308
         $sOutput .= '],';
309 309
 
310
-        $iFilteredTotal ++;
310
+        $iFilteredTotal++;
311 311
     }
312 312
 }
313 313
 
Please login to merge, or discard this patch.
Braces   +46 added lines, -21 removed lines patch added patch discarded remove patch
@@ -90,13 +90,16 @@  discard block
 block discarded – undo
90 90
    * on very large tables, and MySQL's regex functionality is very limited
91 91
 */
92 92
 if (isset($_GET['letter']) && $_GET['letter'] != "" && $_GET['letter'] != "None") {
93
-    if (empty($sWhere)) $sWhere = " WHERE ";
93
+    if (empty($sWhere)) {
94
+        $sWhere = " WHERE ";
95
+    }
94 96
     $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' OR ";
95 97
     $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' OR ";
96 98
     $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' ";
97
-}
98
-elseif (isset($_GET['search']['value']) && $_GET['search']['value'] != "") {
99
-    if (empty($sWhere)) $sWhere = " WHERE ";
99
+} elseif (isset($_GET['search']['value']) && $_GET['search']['value'] != "") {
100
+    if (empty($sWhere)) {
101
+        $sWhere = " WHERE ";
102
+    }
100 103
     $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' OR ";
101 104
     $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' OR ";
102 105
     $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' ";
@@ -104,8 +107,11 @@  discard block
 block discarded – undo
104 107
 
105 108
 // enlarge the query in case of Manager
106 109
 if (!$_SESSION['is_admin'] && !$_SESSION['user_can_manage_all_users']) {
107
-    if (empty($sWhere)) $sWhere = " WHERE ";
108
-    else $sWhere .= " AND ";
110
+    if (empty($sWhere)) {
111
+        $sWhere = " WHERE ";
112
+    } else {
113
+        $sWhere .= " AND ";
114
+    }
109 115
     $sWhere .= "isAdministratedByRole IN (".implode(",", array_filter($_SESSION['user_roles'])).")";
110 116
 }
111 117
 db::debugmode(false);
@@ -213,8 +219,9 @@  discard block
 block discarded – undo
213 219
         } else {
214 220
             $sOutput .= '"';
215 221
         }
216
-        if ($record['id'] != API_USER_ID && $record['id'] != OTV_USER_ID)
217
-            $sOutput .= '<span class=\"fa fa-external-link tip\" style=\"cursor:pointer;\" onclick=\"user_edit(\''.$record['id'].'\')\" title=\"'.$LANG['edit'].' ['.$record['id'].']'.'\"></span>';
222
+        if ($record['id'] != API_USER_ID && $record['id'] != OTV_USER_ID) {
223
+                    $sOutput .= '<span class=\"fa fa-external-link tip\" style=\"cursor:pointer;\" onclick=\"user_edit(\''.$record['id'].'\')\" title=\"'.$LANG['edit'].' ['.$record['id'].']'.'\"></span>';
224
+        }
218 225
 
219 226
         // pwd change
220 227
         $sOutput .= '&nbsp;<span class=\"fa fa-key tip\" style=\"cursor:pointer;\" onclick=\"mdp_user(\''.$record['id'].'\')\" title=\"'.addcslashes($LANG['change_password'], '"\\/').'\"></span>';
@@ -229,8 +236,9 @@  discard block
 block discarded – undo
229 236
             $sOutput .= '&nbsp;<span class=\"fa fa-qrcode mi-green tip\" style=\"cursor:pointer;\" onclick=\"user_action_ga_code(\''.$record['id'].'\')\" title=\"'.addcslashes($LANG['user_ga_code'], '"\\/').'\"></span>';
230 237
         }
231 238
 
232
-        if ($record['admin'] !== "1")
233
-            $sOutput .= '&nbsp;<span class=\"fa fa-sitemap tip\" style=\"cursor:pointer;\" onclick=\"user_folders_rights(\''.$record['id'].'\')\" title=\"'.$LANG['user_folders_rights'].' ['.$record['id'].']'.'\"></span>';
239
+        if ($record['admin'] !== "1") {
240
+                    $sOutput .= '&nbsp;<span class=\"fa fa-sitemap tip\" style=\"cursor:pointer;\" onclick=\"user_folders_rights(\''.$record['id'].'\')\" title=\"'.$LANG['user_folders_rights'].' ['.$record['id'].']'.'\"></span>';
241
+        }
234 242
 
235 243
         $sOutput .= '",';
236 244
 
@@ -265,21 +273,30 @@  discard block
 block discarded – undo
265 273
 
266 274
         //col9
267 275
         if ($_SESSION['user_can_manage_all_users'] === "1" || $_SESSION['is_admin'] === "1") {
268
-            if ($record['admin'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-admin-0\"></i>"';
269
-            else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-admin-1\"></i>"';
276
+            if ($record['admin'] === "1") {
277
+                $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-admin-0\"></i>"';
278
+            } else {
279
+                $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-admin-1\"></i>"';
280
+            }
270 281
         } else {
271 282
             $sOutput .= '""';
272 283
         }
273 284
         $sOutput .= ',';
274 285
 
275 286
         //col10
276
-        if ($record['gestionnaire'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\"  tp=\"'.$record['id'].'-gestionnaire-0\"></i>"';
277
-        else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-gestionnaire-1\"></i>"';
287
+        if ($record['gestionnaire'] === "1") {
288
+            $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\"  tp=\"'.$record['id'].'-gestionnaire-0\"></i>"';
289
+        } else {
290
+            $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-gestionnaire-1\"></i>"';
291
+        }
278 292
         $sOutput .= ',';
279 293
 
280 294
         //col11
281
-        if ($record['read_only'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-read_only-0\"></i>"';
282
-        else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-read_only-1\"></i>"';
295
+        if ($record['read_only'] === "1") {
296
+            $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-read_only-0\"></i>"';
297
+        } else {
298
+            $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-read_only-1\"></i>"';
299
+        }
283 300
         $sOutput .= ',';
284 301
 
285 302
         //col11
@@ -295,13 +312,19 @@  discard block
 block discarded – undo
295 312
         $sOutput .= ',';
296 313
 
297 314
         //col12
298
-        if ($record['can_create_root_folder'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_create_root_folder-0\"></i>"';
299
-        else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_create_root_folder-1\"></i>"';
315
+        if ($record['can_create_root_folder'] === "1") {
316
+            $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_create_root_folder-0\"></i>"';
317
+        } else {
318
+            $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_create_root_folder-1\"></i>"';
319
+        }
300 320
         $sOutput .= ',';
301 321
 
302 322
         //col13
303
-        if ($record['personal_folder'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-personal_folder-0\"></i>"';
304
-        else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-personal_folder-1\"></i>"';
323
+        if ($record['personal_folder'] === "1") {
324
+            $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-personal_folder-0\"></i>"';
325
+        } else {
326
+            $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-personal_folder-1\"></i>"';
327
+        }
305 328
 
306 329
 
307 330
         //Finish the line
@@ -312,7 +335,9 @@  discard block
 block discarded – undo
312 335
 }
313 336
 
314 337
 if (count($rows) > 0) {
315
-    if (strrchr($sOutput, "[") != '[') $sOutput = substr_replace($sOutput, "", -1);
338
+    if (strrchr($sOutput, "[") != '[') {
339
+        $sOutput = substr_replace($sOutput, "", -1);
340
+    }
316 341
     $sOutput .= '] }';
317 342
 } else {
318 343
     $sOutput .= '[] }';
Please login to merge, or discard this patch.
sources/datatable/datatable.users_logged.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -55,15 +55,15 @@
 block discarded – undo
55 55
 
56 56
 if (isset($_GET['iSortCol_0']) && in_array($_GET['iSortCol_0'], $aSortTypes)) {
57 57
     $sOrder = "ORDER BY  ";
58
-	for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
59
-		if (
60
-			$_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
61
-			preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
62
-		) {
63
-			$sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
64
-			.mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
65
-		}
66
-	}
58
+    for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
59
+        if (
60
+            $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
61
+            preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
62
+        ) {
63
+            $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
64
+            .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
65
+        }
66
+    }
67 67
 
68 68
     $sOrder = substr_replace($sOrder, "", -2);
69 69
     if ($sOrder == "ORDER BY") {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,20 +48,20 @@  discard block
 block discarded – undo
48 48
 //Paging
49 49
 $sLimit = "";
50 50
 if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {
51
-    $sLimit = "LIMIT ". filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT)."";
51
+    $sLimit = "LIMIT ".filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT)."";
52 52
 }
53 53
 
54 54
 //Ordering
55 55
 
56 56
 if (isset($_GET['iSortCol_0']) && in_array($_GET['iSortCol_0'], $aSortTypes)) {
57 57
     $sOrder = "ORDER BY  ";
58
-	for ($i=0; $i<intval($_GET['iSortingCols']); $i++) {
58
+	for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
59 59
 		if (
60
-			$_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
60
+			$_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" &&
61 61
 			preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i])
62 62
 		) {
63
-			$sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." "
64
-			.mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", ";
63
+			$sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." "
64
+			.mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", ";
65 65
 		}
66 66
 	}
67 67
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 $sWhere = " WHERE ((timestamp != '' AND session_end >= '".time()."')";
81 81
 if ($_GET['sSearch'] != "") {
82 82
     $sWhere .= " AND (";
83
-    for ($i=0; $i<count($aColumns); $i++) {
83
+    for ($i = 0; $i < count($aColumns); $i++) {
84 84
         $sWhere .= $aColumns[$i]." LIKE %ss_".$aColumns[$i]." OR ";
85 85
     }
86 86
     $sWhere = substr_replace($sWhere, "", -3);
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
     $time_diff = intval(time() - $reccord['timestamp']);
143 143
     $hoursDiff = round($time_diff / 3600, 0, PHP_ROUND_HALF_DOWN);
144 144
     $minutesDiffRemainder = floor($time_diff % 3600 / 60);
145
-    $sOutput_item .= '"'.$hoursDiff . 'h ' . $minutesDiffRemainder . 'm" ';
145
+    $sOutput_item .= '"'.$hoursDiff.'h '.$minutesDiffRemainder.'m" ';
146 146
 
147 147
 
148 148
     //Finish the line
Please login to merge, or discard this patch.