Passed
Pull Request — master (#4928)
by
unknown
06:18
created
api/Model/AuthModel.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@
 block discarded – undo
231 231
         $configManager = new ConfigManager();
232 232
         $SETTINGS = $configManager->getAllSettings();
233 233
 
234
-		$payload = [
234
+        $payload = [
235 235
             'username' => $login,
236 236
             'id' => $id,
237 237
             'exp' => (time() + $SETTINGS['api_token_duration'] + 600),
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     public function getUserAuth(string $login, string $password, string $apikey): array
50 50
     {
51 51
         // Sanitize
52
-        include_once API_ROOT_PATH . '/../sources/main.functions.php';
52
+        include_once API_ROOT_PATH.'/../sources/main.functions.php';
53 53
         $inputData = dataSanitizer(
54 54
             [
55 55
                 'login' => isset($login) === true ? $login : '',
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
             // Check if user exists
75 75
             $userInfo = DB::queryfirstrow(
76 76
                 "SELECT u.id, u.pw, u.login, u.admin, u.gestionnaire, u.can_manage_all_users, u.fonction_id, u.can_create_root_folder, u.public_key, u.private_key, u.personal_folder, u.fonction_id, u.groupes_visibles, u.groupes_interdits, a.value AS user_api_key, a.allowed_folders as user_api_allowed_folders, a.enabled, a.allowed_to_create, a.allowed_to_read, a.allowed_to_update, a.allowed_to_delete
77
-                FROM " . prefixTable('users') . " AS u
78
-                INNER JOIN " . prefixTable('api') . " AS a ON (a.user_id=u.id)
77
+                FROM " . prefixTable('users')." AS u
78
+                INNER JOIN " . prefixTable('api')." AS a ON (a.user_id=u.id)
79 79
                 WHERE login = %s",
80 80
                 $inputData['login']
81 81
             );
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
                 // Encrypt the decrypted private key with the session key
120 120
                 // This allows us to store it securely in the database without exposing it
121
-                require_once API_ROOT_PATH . '/inc/encryption_utils.php';
121
+                require_once API_ROOT_PATH.'/inc/encryption_utils.php';
122 122
                 $encryptedPrivateKey = encrypt_with_session_key($privateKeyClear, $sessionKey);
123 123
 
124 124
                 if ($encryptedPrivateKey === false) {
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         if (count($userFunctionId) > 0) {
286 286
             $rows = DB::query(
287 287
                 'SELECT * 
288
-                FROM ' . prefixTable('roles_values') . '
288
+                FROM ' . prefixTable('roles_values').'
289 289
                 WHERE role_id IN %li  AND type IN ("W", "ND", "NE", "NDNE", "R")',
290 290
                 $userFunctionId
291 291
             );
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
         $inc = 0;
312 312
         $rows = DB::query(
313 313
             'SELECT id, id_tree 
314
-            FROM ' . prefixTable('items') . '
314
+            FROM ' . prefixTable('items').'
315 315
             WHERE restricted_to LIKE %s'.
316 316
             (count($userFunctionId) > 0 ? ' AND id_tree NOT IN %li' : ''),
317 317
             $userInfo['id'],
@@ -326,8 +326,8 @@  discard block
 block discarded – undo
326 326
         // Check for the users roles if some specific rights exist on items
327 327
         $rows = DB::query(
328 328
             'SELECT i.id_tree, r.item_id
329
-            FROM ' . prefixTable('items') . ' AS i
330
-            INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (r.item_id=i.id)
329
+            FROM ' . prefixTable('items').' AS i
330
+            INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (r.item_id=i.id)
331 331
             WHERE '.(count($userFunctionId) > 0 ? ' id_tree NOT IN %li AND ' : '').' i.id_tree != ""
332 332
             ORDER BY i.id_tree ASC',
333 333
             count($userFunctionId) > 0 ? $userFunctionId : DB::sqleval('0')
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         // Add all personal folders
344 344
         $rows = DB::queryFirstRow(
345 345
             'SELECT id 
346
-            FROM ' . prefixTable('nested_tree') . '
346
+            FROM ' . prefixTable('nested_tree').'
347 347
             WHERE title = %i AND personal_folder = 1'.
348 348
             (count($userFunctionId) > 0 ? ' AND id NOT IN %li' : ''),
349 349
             $userInfo['id'],
Please login to merge, or discard this patch.
api/inc/bootstrap.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -25,18 +25,18 @@  discard block
 block discarded – undo
25 25
 
26 26
 use TeampassClasses\ConfigManager\ConfigManager;
27 27
 
28
-define("API_ROOT_PATH", __DIR__ . "/..");
28
+define("API_ROOT_PATH", __DIR__."/..");
29 29
 
30 30
 // include main configuration file
31
-require API_ROOT_PATH . '/../sources/main.functions.php';
31
+require API_ROOT_PATH.'/../sources/main.functions.php';
32 32
 
33 33
 // include the base controller file
34
-require API_ROOT_PATH . "/Controller/Api/BaseController.php";
34
+require API_ROOT_PATH."/Controller/Api/BaseController.php";
35 35
 
36 36
 // include the use model file
37
-require API_ROOT_PATH . "/Model/UserModel.php";
38
-require API_ROOT_PATH . "/Model/ItemModel.php";
39
-require API_ROOT_PATH . "/Model/FolderModel.php";
37
+require API_ROOT_PATH."/Model/UserModel.php";
38
+require API_ROOT_PATH."/Model/ItemModel.php";
39
+require API_ROOT_PATH."/Model/FolderModel.php";
40 40
 
41 41
 /**
42 42
  * Launch expected action for ITEM
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
         return;
57 57
     }
58 58
     // Perform the action
59
-    require API_ROOT_PATH . "/Controller/Api/ItemController.php";    
59
+    require API_ROOT_PATH."/Controller/Api/ItemController.php";    
60 60
     $objFeedController = new ItemController();
61
-    $strMethodName = $actions[0] . 'Action';
61
+    $strMethodName = $actions[0].'Action';
62 62
     $objFeedController->{$strMethodName}($userData);
63 63
 }
64 64
 
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
         return;
81 81
     }
82 82
     // Perform the action
83
-    require API_ROOT_PATH . "/Controller/Api/FolderController.php";
83
+    require API_ROOT_PATH."/Controller/Api/FolderController.php";
84 84
     $objFeedController = new FolderController();
85
-    $strMethodName = $actions[0] . 'Action';
85
+    $strMethodName = $actions[0].'Action';
86 86
     $objFeedController->{$strMethodName}($userData);
87 87
 }
88 88
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
  */
140 140
 function verifyAuth(): string
141 141
 {
142
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
142
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
143 143
     $bearer_token = get_bearer_token();
144 144
 
145 145
     if (empty($bearer_token) === false && is_jwt_valid($bearer_token) === true) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
  */
170 170
 function getDataFromToken(): string
171 171
 {
172
-    include_once API_ROOT_PATH . '/inc/jwt_utils.php';
172
+    include_once API_ROOT_PATH.'/inc/jwt_utils.php';
173 173
     $bearer_token = get_bearer_token();
174 174
 
175 175
     if (empty($bearer_token) === false) {
Please login to merge, or discard this patch.
api/inc/encryption_utils.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 function encrypt_with_session_key(string $data, string $key)
48 48
 {
49 49
     if (strlen($key) !== 32) {
50
-        error_log('[API] encrypt_with_session_key: Invalid key length. Expected 32 bytes, got ' . strlen($key));
50
+        error_log('[API] encrypt_with_session_key: Invalid key length. Expected 32 bytes, got '.strlen($key));
51 51
         return false;
52 52
     }
53 53
 
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 
75 75
         // Combine nonce + tag + ciphertext and encode in base64
76 76
         // Format: [12 bytes nonce][16 bytes tag][variable ciphertext]
77
-        return base64_encode($nonce . $tag . $ciphertext);
77
+        return base64_encode($nonce.$tag.$ciphertext);
78 78
 
79 79
     } catch (Exception $e) {
80
-        error_log('[API] encrypt_with_session_key: Exception - ' . $e->getMessage());
80
+        error_log('[API] encrypt_with_session_key: Exception - '.$e->getMessage());
81 81
         return false;
82 82
     }
83 83
 }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 function decrypt_with_session_key(string $encryptedData, string $key)
96 96
 {
97 97
     if (strlen($key) !== 32) {
98
-        error_log('[API] decrypt_with_session_key: Invalid key length. Expected 32 bytes, got ' . strlen($key));
98
+        error_log('[API] decrypt_with_session_key: Invalid key length. Expected 32 bytes, got '.strlen($key));
99 99
         return false;
100 100
     }
101 101
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         return $plaintext;
137 137
 
138 138
     } catch (Exception $e) {
139
-        error_log('[API] decrypt_with_session_key: Exception - ' . $e->getMessage());
139
+        error_log('[API] decrypt_with_session_key: Exception - '.$e->getMessage());
140 140
         return false;
141 141
     }
142 142
 }
Please login to merge, or discard this patch.
sources/admin.queries.php 1 patch
Spacing   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) {
73 73
     // Not allowed page
74 74
     $session->set('system-error_code', ERR_NOT_ALLOWED);
75
-    include $SETTINGS['cpassman_dir'] . '/error.php';
75
+    include $SETTINGS['cpassman_dir'].'/error.php';
76 76
     exit;
77 77
 }
78 78
 
@@ -133,14 +133,14 @@  discard block
 block discarded – undo
133 133
             break;
134 134
         }
135 135
 
136
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
136
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
137 137
         $return = '';
138 138
 
139 139
         //Get all tables
140 140
         $tables = array();
141 141
         $result = DB::query('SHOW TABLES');
142 142
         foreach ($result as $row) {
143
-            $tables[] = $row['Tables_in_' . DB_NAME];
143
+            $tables[] = $row['Tables_in_'.DB_NAME];
144 144
         }
145 145
 
146 146
         //cycle through
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             if (defined('DB_PREFIX') || substr_count($table, DB_PREFIX) > 0) {
149 149
                 $table = (is_string($table) ? $table : strval($table));
150 150
                 // Do query
151
-                $result = DB::query('SELECT * FROM ' . $table);
151
+                $result = DB::query('SELECT * FROM '.$table);
152 152
                 DB::query(
153 153
                     'SELECT *
154 154
                     FROM INFORMATION_SCHEMA.COLUMNS
@@ -160,20 +160,20 @@  discard block
 block discarded – undo
160 160
                 $numFields = DB::count();
161 161
 
162 162
                 // prepare a drop table
163
-                $return .= 'DROP TABLE ' . $table . ';';
164
-                $row2 = DB::queryFirstRow('SHOW CREATE TABLE ' . $table);
165
-                $return .= "\n\n" . strval($row2['Create Table']) . ";\n\n";
163
+                $return .= 'DROP TABLE '.$table.';';
164
+                $row2 = DB::queryFirstRow('SHOW CREATE TABLE '.$table);
165
+                $return .= "\n\n".strval($row2['Create Table']).";\n\n";
166 166
 
167 167
                 //prepare all fields and datas
168 168
                 for ($i = 0; $i < $numFields; ++$i) {
169 169
                     if (is_object($result)) {
170 170
                         while ($row = $result->fetch_row()) {
171
-                            $return .= 'INSERT INTO ' . $table . ' VALUES(';
171
+                            $return .= 'INSERT INTO '.$table.' VALUES(';
172 172
                             for ($j = 0; $j < $numFields; ++$j) {
173 173
                                 $row[$j] = addslashes($row[$j]);
174 174
                                 $row[$j] = preg_replace("/\n/", '\\n', $row[$j]);
175 175
                                 if (isset($row[$j])) {
176
-                                    $return .= '"' . $row[$j] . '"';
176
+                                    $return .= '"'.$row[$j].'"';
177 177
                                 } else {
178 178
                                     $return .= 'NULL';
179 179
                                 }
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
             $token = GenerateCryptKey(20, false, true, true, false, true);
195 195
 
196 196
             //save file
197
-            $filename = time() . '-' . $token . '.sql';
198
-            $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+');
197
+            $filename = time().'-'.$token.'.sql';
198
+            $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+');
199 199
             if ($handle !== false) {
200 200
                 //write file
201 201
                 fwrite($handle, $return);
@@ -207,16 +207,16 @@  discard block
 block discarded – undo
207 207
                 // Encrypt the file
208 208
                 prepareFileWithDefuse(
209 209
                     'encrypt',
210
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename,
211
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
210
+                    $SETTINGS['path_to_files_folder'].'/'.$filename,
211
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
212 212
                     $post_option
213 213
                 );
214 214
 
215 215
                 // Do clean
216
-                unlink($SETTINGS['path_to_files_folder'] . '/' . $filename);
216
+                unlink($SETTINGS['path_to_files_folder'].'/'.$filename);
217 217
                 rename(
218
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
219
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename
218
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
219
+                    $SETTINGS['path_to_files_folder'].'/'.$filename
220 220
                 );
221 221
             }
222 222
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             //update LOG
227 227
             logEvents($SETTINGS, 'admin_action', 'dataBase backup', (string) $session->get('user-id'), $session->get('user-login'));
228 228
 
229
-            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name=' . urlencode($filename) . '&sub=files&file=' . $filename . '&type=sql&key=' . $session->get('key') . '&key_tmp=' . $session->get('user-key_tmp') . '&pathIsFiles=1"}]';
229
+            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name='.urlencode($filename).'&sub=files&file='.$filename.'&type=sql&key='.$session->get('key').'&key_tmp='.$session->get('user-key_tmp').'&pathIsFiles=1"}]';
230 230
         }
231 231
         break;
232 232
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             );
256 256
             break;
257 257
         }
258
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
258
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
259 259
 
260 260
         $dataPost = explode('&', $post_option);
261 261
         $file = htmlspecialchars($dataPost[0]);
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         // Get filename from database
265 265
         $data = DB::queryFirstRow(
266 266
             'SELECT valeur
267
-            FROM ' . prefixTable('misc') . '
267
+            FROM ' . prefixTable('misc').'
268 268
             WHERE increment_id = %i',
269 269
             $file
270 270
         );
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
             // Decrypt the file
284 284
             $ret = prepareFileWithDefuse(
285 285
                 'decrypt',
286
-                $SETTINGS['path_to_files_folder'] . '/' . $file,
287
-                $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file,
286
+                $SETTINGS['path_to_files_folder'].'/'.$file,
287
+                $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file,
288 288
                 $key
289 289
             );
290 290
 
@@ -295,10 +295,10 @@  discard block
 block discarded – undo
295 295
             }
296 296
 
297 297
             // Do clean
298
-            fileDelete($SETTINGS['path_to_files_folder'] . '/' . $file, $SETTINGS);
299
-            $file = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file;
298
+            fileDelete($SETTINGS['path_to_files_folder'].'/'.$file, $SETTINGS);
299
+            $file = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file;
300 300
         } else {
301
-            $file = $SETTINGS['path_to_files_folder'] . '/' . $file;
301
+            $file = $SETTINGS['path_to_files_folder'].'/'.$file;
302 302
         }
303 303
 
304 304
         //read sql file
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         fclose($handle);
316 316
 
317 317
         //delete file
318
-        unlink($SETTINGS['path_to_files_folder'] . '/' . $file);
318
+        unlink($SETTINGS['path_to_files_folder'].'/'.$file);
319 319
 
320 320
         //Show done
321 321
         echo '[{"result":"db_restore" , "message":""}]';
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
                 $tablename = (is_string($tablename) ? $tablename : strval($tablename));
355 355
                 if (substr_count($tablename, DB_PREFIX) > 0) {
356 356
                     // launch optimization quieries
357
-                    DB::query('ANALYZE TABLE `' . $tablename . '`');
358
-                    DB::query('OPTIMIZE TABLE `' . $tablename . '`');
357
+                    DB::query('ANALYZE TABLE `'.$tablename.'`');
358
+                    DB::query('OPTIMIZE TABLE `'.$tablename.'`');
359 359
                 }
360 360
             }
361 361
         }
@@ -363,12 +363,12 @@  discard block
 block discarded – undo
363 363
         //Clean up LOG_ITEMS table
364 364
         $rows = DB::query(
365 365
             'SELECT id
366
-            FROM ' . prefixTable('items') . '
366
+            FROM ' . prefixTable('items').'
367 367
             ORDER BY id ASC'
368 368
         );
369 369
         foreach ($rows as $item) {
370 370
             DB::query(
371
-                'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s',
371
+                'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s',
372 372
                 $item['id'],
373 373
                 'at_creation'
374 374
             );
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             if ($counter === 0) {
377 377
                 //Create new at_creation entry
378 378
                 $rowTmp = DB::queryFirstRow(
379
-                    'SELECT date, id_user FROM ' . prefixTable('log_items') . ' WHERE id_item=%i ORDER BY date ASC',
379
+                    'SELECT date, id_user FROM '.prefixTable('log_items').' WHERE id_item=%i ORDER BY date ASC',
380 380
                     $item['id']
381 381
                 );
382 382
                 DB::insert(
@@ -406,8 +406,8 @@  discard block
 block discarded – undo
406 406
         echo prepareExchangedData(
407 407
             array(
408 408
                 'error' => false,
409
-                'message' => $lang->get('last_execution') . ' ' .
410
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
409
+                'message' => $lang->get('last_execution').' '.
410
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
411 411
                     '<i class="fas fa-check text-success ml-2"></i>',
412 412
             ),
413 413
             'encode'
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
             break;
444 444
         }
445 445
 
446
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
446
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
447 447
         updateCacheTable('reload', NULL);
448 448
 
449 449
         // Log
@@ -459,8 +459,8 @@  discard block
 block discarded – undo
459 459
         echo prepareExchangedData(
460 460
             [
461 461
                 'error' => false,
462
-                'message' => $lang->get('last_execution') . ' ' .
463
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
462
+                'message' => $lang->get('last_execution').' '.
463
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
464 464
                     '<i class="fas fa-check text-success mr-2"></i>',
465 465
             ],
466 466
             'encode'
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
         $session->set('user-reencrypt_old_salt', file_get_contents(SECUREPATH.'/'.SECUREFILE));
503 503
 
504 504
         // generate new saltkey
505
-        $old_sk_filename = SECUREPATH.'/'.SECUREFILE . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time();
505
+        $old_sk_filename = SECUREPATH.'/'.SECUREFILE.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time();
506 506
         copy(
507 507
             SECUREPATH.'/'.SECUREFILE,
508 508
             $old_sk_filename
@@ -531,13 +531,13 @@  discard block
 block discarded – undo
531 531
         logEvents($SETTINGS, 'system', 'change_salt_key', (string) $session->get('user-id'), $session->get('user-login'));
532 532
 
533 533
         // get number of items to change
534
-        DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', 0);
534
+        DB::query('SELECT id FROM '.prefixTable('items').' WHERE perso = %i', 0);
535 535
         $nb_of_items = DB::count();
536 536
 
537 537
         // create backup table
538
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
538
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
539 539
         DB::query(
540
-            'CREATE TABLE `' . prefixTable('sk_reencrypt_backup') . '` (
540
+            'CREATE TABLE `'.prefixTable('sk_reencrypt_backup').'` (
541 541
             `id` int(12) NOT null AUTO_INCREMENT,
542 542
             `current_table` varchar(100) NOT NULL,
543 543
             `current_field` varchar(500) NOT NULL,
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
         );
566 566
 
567 567
         // delete previous backup files
568
-        $files = glob($SETTINGS['path_to_upload_folder'] . '/*'); // get all file names
568
+        $files = glob($SETTINGS['path_to_upload_folder'].'/*'); // get all file names
569 569
         foreach ($files as $file) { // iterate files
570 570
             if (is_file($file)) {
571 571
                 $file_parts = pathinfo($file);
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
                 echo prepareExchangedData(
653 653
                     array(
654 654
                         'error' => true,
655
-                        'message' => 'Input `' . $objects[0] . '` is not allowed',
655
+                        'message' => 'Input `'.$objects[0].'` is not allowed',
656 656
                         'nbOfItems' => '',
657 657
                         'nextAction' => '',
658 658
                     ),
@@ -665,9 +665,9 @@  discard block
 block discarded – undo
665 665
                 //change all encrypted data in Items (passwords)
666 666
                 $rows = DB::query(
667 667
                     'SELECT id, pw, pw_iv
668
-                    FROM ' . prefixTable('items') . '
668
+                    FROM ' . prefixTable('items').'
669 669
                     WHERE perso = %s
670
-                    LIMIT ' . $post_start . ', ' . $post_length,
670
+                    LIMIT ' . $post_start.', '.$post_length,
671 671
                     '0'
672 672
                 );
673 673
                 foreach ($rows as $record) {
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
                             'current_field' => 'pw',
680 680
                             'value_id' => $record['id'],
681 681
                             'value' => $record['pw'],
682
-                            'current_sql' => 'UPDATE ' . prefixTable('items') . " SET pw = '" . $record['pw'] . "' WHERE id = '" . $record['id'] . "';",
682
+                            'current_sql' => 'UPDATE '.prefixTable('items')." SET pw = '".$record['pw']."' WHERE id = '".$record['id']."';",
683 683
                             'value2' => 'none',
684 684
                             'result' => 'none',
685 685
                         )
@@ -728,9 +728,9 @@  discard block
 block discarded – undo
728 728
                 //change all encrypted data in Logs (passwords)
729 729
                 $rows = DB::query(
730 730
                     'SELECT raison, increment_id
731
-                    FROM ' . prefixTable('log_items') . "
731
+                    FROM ' . prefixTable('log_items')."
732 732
                     WHERE action = %s AND raison LIKE 'at_pw :%'
733
-                    LIMIT " . $post_start . ', ' . $post_length,
733
+                    LIMIT " . $post_start.', '.$post_length,
734 734
                     'at_modification'
735 735
                 );
736 736
                 foreach ($rows as $record) {
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
                             'current_field' => 'raison',
743 743
                             'value_id' => $record['increment_id'],
744 744
                             'value' => $record['raison'],
745
-                            'current_sql' => 'UPDATE ' . prefixTable('log_items') . " SET raison = '" . $record['raison'] . "' WHERE increment_id = '" . $record['increment_id'] . "';",
745
+                            'current_sql' => 'UPDATE '.prefixTable('log_items')." SET raison = '".$record['raison']."' WHERE increment_id = '".$record['increment_id']."';",
746 746
                             'value2' => 'none',
747 747
                             'result' => 'none',
748 748
                         )
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
                         DB::update(
771 771
                             prefixTable('log_items'),
772 772
                             array(
773
-                                'raison' => 'at_pw :' . $encrypt['string'],
773
+                                'raison' => 'at_pw :'.$encrypt['string'],
774 774
                                 'encryption_type' => 'defuse',
775 775
                             ),
776 776
                             'increment_id = %i',
@@ -795,8 +795,8 @@  discard block
 block discarded – undo
795 795
                 //change all encrypted data in CATEGORIES (passwords)
796 796
                 $rows = DB::query(
797 797
                     'SELECT id, data
798
-                    FROM ' . prefixTable('categories_items') . '
799
-                    LIMIT ' . $post_start . ', ' . $post_length
798
+                    FROM ' . prefixTable('categories_items').'
799
+                    LIMIT ' . $post_start.', '.$post_length
800 800
                 );
801 801
                 foreach ($rows as $record) {
802 802
                     // backup data
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
                             'current_field' => 'data',
808 808
                             'value_id' => $record['id'],
809 809
                             'value' => $record['data'],
810
-                            'current_sql' => 'UPDATE ' . prefixTable('categories_items') . " SET data = '" . $record['data'] . "' WHERE id = '" . $record['id'] . "';",
810
+                            'current_sql' => 'UPDATE '.prefixTable('categories_items')." SET data = '".$record['data']."' WHERE id = '".$record['id']."';",
811 811
                             'value2' => 'none',
812 812
                             'result' => 'none',
813 813
                         )
@@ -855,9 +855,9 @@  discard block
 block discarded – undo
855 855
                 // Change all encrypted data in FILES (passwords)
856 856
                 $rows = DB::query(
857 857
                     'SELECT id, file, status
858
-                    FROM ' . prefixTable('files') . "
858
+                    FROM ' . prefixTable('files')."
859 859
                     WHERE status = 'encrypted'
860
-                    LIMIT " . $post_start . ', ' . $post_length
860
+                    LIMIT " . $post_start.', '.$post_length
861 861
                 );
862 862
                 foreach ($rows as $record) {
863 863
                     // backup data
@@ -875,20 +875,20 @@  discard block
 block discarded – undo
875 875
                     );
876 876
                     $newID = DB::insertId();
877 877
 
878
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
878
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
879 879
                         // make a copy of file
880 880
                         if (!copy(
881
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
882
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '.copy'
881
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
882
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'.copy'
883 883
                         )) {
884 884
                             $error = 'Copy not possible';
885 885
                             exit;
886 886
                         } else {
887 887
                             // prepare a bck of file (that will not be deleted)
888
-                            $backup_filename = $record['file'] . '.bck-change-sk.' . time();
888
+                            $backup_filename = $record['file'].'.bck-change-sk.'.time();
889 889
                             copy(
890
-                                $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
891
-                                $SETTINGS['path_to_upload_folder'] . '/' . $backup_filename
890
+                                $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
891
+                                $SETTINGS['path_to_upload_folder'].'/'.$backup_filename
892 892
                             );
893 893
                         }
894 894
 
@@ -896,22 +896,22 @@  discard block
 block discarded – undo
896 896
                         // STEP1 - Do decryption
897 897
                         prepareFileWithDefuse(
898 898
                             'decrypt',
899
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
900
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted'
899
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
900
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted'
901 901
                         );
902 902
 
903 903
                         // Do cleanup of files
904
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file']);
904
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file']);
905 905
 
906 906
                         // STEP2 - Do encryption
907 907
                         prepareFileWithDefuse(
908 908
                             'encryp',
909
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted',
910
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file']
909
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted',
910
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file']
911 911
                         );
912 912
 
913 913
                         // Do cleanup of files
914
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted');
914
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted');
915 915
 
916 916
                         // Update backup table
917 917
                         DB::update(
@@ -937,13 +937,13 @@  discard block
 block discarded – undo
937 937
                 // do some things for new object
938 938
                 if (isset($objects[0])) {
939 939
                     if ($objects[0] === 'logs') {
940
-                        DB::query('SELECT increment_id FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
940
+                        DB::query('SELECT increment_id FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
941 941
                     } elseif ($objects[0] === 'files') {
942
-                        DB::query('SELECT id FROM ' . prefixTable('files'));
942
+                        DB::query('SELECT id FROM '.prefixTable('files'));
943 943
                     } elseif ($objects[0] === 'categories') {
944
-                        DB::query('SELECT id FROM ' . prefixTable('categories_items'));
944
+                        DB::query('SELECT id FROM '.prefixTable('categories_items'));
945 945
                     } elseif ($objects[0] === 'custfields') {
946
-                        DB::query('SELECT raison FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
946
+                        DB::query('SELECT raison FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
947 947
                     }
948 948
                     $nb_of_items = DB::count();
949 949
                 } else {
@@ -1063,12 +1063,12 @@  discard block
 block discarded – undo
1063 1063
                 );
1064 1064
             } elseif ($record['current_table'] === 'files') {
1065 1065
                 // restore backup file
1066
-                if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value'])) {
1067
-                    unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value']);
1068
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1066
+                if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value'])) {
1067
+                    unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value']);
1068
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1069 1069
                         rename(
1070
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value2'],
1071
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value']
1070
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value2'],
1071
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value']
1072 1072
                         );
1073 1073
                     }
1074 1074
                 }
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
         }
1088 1088
 
1089 1089
         // drop table
1090
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1090
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1091 1091
 
1092 1092
         // Send back
1093 1093
         echo prepareExchangedData(
@@ -1130,17 +1130,17 @@  discard block
 block discarded – undo
1130 1130
         // delete files
1131 1131
         $rows = DB::query(
1132 1132
             'SELECT value, value2
1133
-            FROM ' . prefixTable('sk_reencrypt_backup') . "
1133
+            FROM ' . prefixTable('sk_reencrypt_backup')."
1134 1134
             WHERE current_table = 'files'"
1135 1135
         );
1136 1136
         foreach ($rows as $record) {
1137
-            if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1138
-                unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value2']);
1137
+            if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1138
+                unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value2']);
1139 1139
             }
1140 1140
         }
1141 1141
 
1142 1142
         // drop table
1143
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1143
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1144 1144
 
1145 1145
         echo '[{"status":"done"}]';
1146 1146
         break;
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
                 'encode'
1172 1172
             );
1173 1173
         } else {
1174
-            require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1174
+            require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1175 1175
 
1176 1176
             //send email
1177 1177
             $emailSettings = new EmailSettings($SETTINGS);
@@ -1209,13 +1209,13 @@  discard block
 block discarded – undo
1209 1209
             break;
1210 1210
         }
1211 1211
 
1212
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1212
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1213 1213
         $emailSettings = new EmailSettings($SETTINGS);
1214 1214
         $emailService = new EmailService();
1215 1215
 
1216 1216
         $rows = DB::query(
1217 1217
             'SELECT *
1218
-            FROM ' . prefixTable('emails') . '
1218
+            FROM ' . prefixTable('emails').'
1219 1219
             WHERE status = %s OR status = %s',
1220 1220
             'not_sent',
1221 1221
             ''
@@ -1301,13 +1301,13 @@  discard block
 block discarded – undo
1301 1301
             break;
1302 1302
         }
1303 1303
 
1304
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1304
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1305 1305
 
1306 1306
         // Instatiate email settings and service
1307 1307
         $emailSettings = new EmailSettings($SETTINGS);
1308 1308
         $emailService = new EmailService();
1309 1309
 
1310
-        $rows = DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', '');
1310
+        $rows = DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', '');
1311 1311
         foreach ($rows as $record) {
1312 1312
             //send email
1313 1313
             $email = $emailService->sendMail(
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
             break;
1377 1377
         }
1378 1378
 
1379
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1379
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1380 1380
 
1381 1381
         // init
1382 1382
         $filesList = array();
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
                 FROM ' . prefixTable('files')
1390 1390
             );
1391 1391
             foreach ($rows as $record) {
1392
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
1392
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
1393 1393
                     $addFile = false;
1394 1394
                     if (($post_option === 'attachments-decrypt' && $record['status'] === 'encrypted')
1395 1395
                         || ($post_option === 'attachments-encrypt' && $record['status'] === 'clear')
@@ -1454,8 +1454,8 @@  discard block
 block discarded – undo
1454 1454
         $post_list = filter_var_array($post_list, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
1455 1455
         $post_counter = filter_var($post_counter, FILTER_SANITIZE_NUMBER_INT);
1456 1456
 
1457
-        include $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1458
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1457
+        include $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1458
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1459 1459
 
1460 1460
         $cpt = 0;
1461 1461
         $continu = true;
@@ -1468,33 +1468,33 @@  discard block
 block discarded – undo
1468 1468
                 // Get file name
1469 1469
                 $file_info = DB::queryFirstRow(
1470 1470
                     'SELECT file
1471
-                    FROM ' . prefixTable('files') . '
1471
+                    FROM ' . prefixTable('files').'
1472 1472
                     WHERE id = %i',
1473 1473
                     $file
1474 1474
                 );
1475 1475
 
1476 1476
                 // skip file is Coherancey not respected
1477
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'])) {
1477
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'])) {
1478 1478
                     // Case where we want to decrypt
1479 1479
                     if ($post_option === 'decrypt') {
1480 1480
                         prepareFileWithDefuse(
1481 1481
                             'decrypt',
1482
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
1483
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1482
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
1483
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1484 1484
                         );
1485 1485
                         // Case where we want to encrypt
1486 1486
                     } elseif ($post_option === 'encrypt') {
1487 1487
                         prepareFileWithDefuse(
1488 1488
                             'encrypt',
1489
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
1490
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1489
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
1490
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1491 1491
                         );
1492 1492
                     }
1493 1493
                     // Do file cleanup
1494
-                    fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], $SETTINGS);
1494
+                    fileDelete($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], $SETTINGS);
1495 1495
                     rename(
1496
-                        $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1497
-                        $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file']
1496
+                        $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1497
+                        $SETTINGS['path_to_upload_folder'].'/'.$file_info['file']
1498 1498
                     );
1499 1499
 
1500 1500
                     // store in DB
@@ -1529,8 +1529,8 @@  discard block
 block discarded – undo
1529 1529
                 $post_option === 'attachments-decrypt' ? 'clear' : 'encrypted'
1530 1530
             );
1531 1531
 
1532
-            $message = $lang->get('last_execution') . ' ' .
1533
-                date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
1532
+            $message = $lang->get('last_execution').' '.
1533
+                date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
1534 1534
                 '<i class="fas fa-check text-success ml-2 mr-3"></i>';
1535 1535
         }
1536 1536
 
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_NUMBER_INT);
1621 1621
 
1622 1622
             DB::query(
1623
-                'DELETE FROM ' . prefixTable('api') . ' WHERE increment_id = %i',
1623
+                'DELETE FROM '.prefixTable('api').' WHERE increment_id = %i',
1624 1624
                 $post_id
1625 1625
             );
1626 1626
         }
@@ -1715,7 +1715,7 @@  discard block
 block discarded – undo
1715 1715
             // Delete existing key
1716 1716
         } elseif (null !== $post_action && $post_action === 'delete') {
1717 1717
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
1718
-            DB::query('DELETE FROM ' . prefixTable('api') . ' WHERE increment_id=%i', $post_id);
1718
+            DB::query('DELETE FROM '.prefixTable('api').' WHERE increment_id=%i', $post_id);
1719 1719
         }
1720 1720
 
1721 1721
         echo prepareExchangedData(
@@ -1730,7 +1730,7 @@  discard block
 block discarded – undo
1730 1730
 
1731 1731
     case 'save_api_status':
1732 1732
         // Do query
1733
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'api');
1733
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'api');
1734 1734
         $counter = DB::count();
1735 1735
         if ($counter === 0) {
1736 1736
             DB::insert(
@@ -1759,7 +1759,7 @@  discard block
 block discarded – undo
1759 1759
 
1760 1760
     case 'run_duo_config_check':
1761 1761
         //Libraries call
1762
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1762
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1763 1763
         // Check KEY
1764 1764
         if ($post_key !== $session->get('key')) {
1765 1765
             echo prepareExchangedData(
@@ -1865,7 +1865,7 @@  discard block
 block discarded – undo
1865 1865
         } else {
1866 1866
             $tmp = 1;
1867 1867
         }
1868
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
1868
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
1869 1869
         $counter = DB::count();
1870 1870
         if ($counter === 0) {
1871 1871
             DB::insert(
@@ -1893,7 +1893,7 @@  discard block
 block discarded – undo
1893 1893
 
1894 1894
         // ga_website_name
1895 1895
         if (is_null($dataReceived['ga_website_name']) === false) {
1896
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
1896
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
1897 1897
             $counter = DB::count();
1898 1898
             if ($counter === 0) {
1899 1899
                 DB::insert(
@@ -1923,7 +1923,7 @@  discard block
 block discarded – undo
1923 1923
         }
1924 1924
 
1925 1925
         // send data
1926
-        echo '[{"result" : "' . addslashes($lang['done']) . '" , "error" : ""}]';
1926
+        echo '[{"result" : "'.addslashes($lang['done']).'" , "error" : ""}]';
1927 1927
         break;
1928 1928
 
1929 1929
     case 'save_agses_options':
@@ -1946,7 +1946,7 @@  discard block
 block discarded – undo
1946 1946
 
1947 1947
         // agses_hosted_url
1948 1948
         if (!is_null($dataReceived['agses_hosted_url'])) {
1949
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
1949
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
1950 1950
             $counter = DB::count();
1951 1951
             if ($counter === 0) {
1952 1952
                 DB::insert(
@@ -1977,7 +1977,7 @@  discard block
 block discarded – undo
1977 1977
 
1978 1978
         // agses_hosted_id
1979 1979
         if (!is_null($dataReceived['agses_hosted_id'])) {
1980
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
1980
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
1981 1981
             $counter = DB::count();
1982 1982
             if ($counter === 0) {
1983 1983
                 DB::insert(
@@ -2008,7 +2008,7 @@  discard block
 block discarded – undo
2008 2008
 
2009 2009
         // agses_hosted_apikey
2010 2010
         if (!is_null($dataReceived['agses_hosted_apikey'])) {
2011
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2011
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2012 2012
             $counter = DB::count();
2013 2013
             if ($counter === 0) {
2014 2014
                 DB::insert(
@@ -2038,7 +2038,7 @@  discard block
 block discarded – undo
2038 2038
         }
2039 2039
 
2040 2040
         // send data
2041
-        echo '[{"result" : "' . addslashes($lang['done']) . '" , "error" : ""}]';
2041
+        echo '[{"result" : "'.addslashes($lang['done']).'" , "error" : ""}]';
2042 2042
         break;
2043 2043
 
2044 2044
     case 'save_option_change':
@@ -2079,7 +2079,7 @@  discard block
 block discarded – undo
2079 2079
 
2080 2080
         // Check if setting is already in DB. If NO then insert, if YES then update.
2081 2081
         $data = DB::query(
2082
-            'SELECT * FROM ' . prefixTable('misc') . '
2082
+            'SELECT * FROM '.prefixTable('misc').'
2083 2083
             WHERE type = %s AND intitule = %s',
2084 2084
             'admin',
2085 2085
             $post_field
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
                     array(
2103 2103
                         'valeur' => time(),
2104 2104
                         'type' => 'admin',
2105
-                        'intitule' => $post_field . '_time',
2105
+                        'intitule' => $post_field.'_time',
2106 2106
                         'updated_at' => time(),
2107 2107
                     )
2108 2108
                 );
@@ -2124,10 +2124,10 @@  discard block
 block discarded – undo
2124 2124
             if ($post_field === 'send_stats') {
2125 2125
                 // Check if previous time exists, if not them insert this value in DB
2126 2126
                 DB::query(
2127
-                    'SELECT * FROM ' . prefixTable('misc') . '
2127
+                    'SELECT * FROM '.prefixTable('misc').'
2128 2128
                     WHERE type = %s AND intitule = %s',
2129 2129
                     'admin',
2130
-                    $post_field . '_time'
2130
+                    $post_field.'_time'
2131 2131
                 );
2132 2132
                 $counter = DB::count();
2133 2133
                 if ($counter === 0) {
@@ -2136,7 +2136,7 @@  discard block
 block discarded – undo
2136 2136
                         array(
2137 2137
                             'valeur' => 0,
2138 2138
                             'type' => 'admin',
2139
-                            'intitule' => $post_field . '_time',
2139
+                            'intitule' => $post_field.'_time',
2140 2140
                             'created_at' => time(),
2141 2141
                         )
2142 2142
                     );
@@ -2158,13 +2158,13 @@  discard block
 block discarded – undo
2158 2158
         // special Cases
2159 2159
         if ($post_field === 'cpassman_url') {
2160 2160
             // update also jsUrl for CSFP protection
2161
-            $jsUrl = $post_value . '/includes/libraries/csrfp/js/csrfprotector.js';
2161
+            $jsUrl = $post_value.'/includes/libraries/csrfp/js/csrfprotector.js';
2162 2162
             $csrfp_file = '../includes/libraries/csrfp/libs/csrfp.config.php';
2163 2163
             $data = file_get_contents($csrfp_file);
2164 2164
             $posJsUrl = strpos($data, '"jsUrl" => "');
2165 2165
             $posEndLine = strpos($data, '",', $posJsUrl);
2166 2166
             $line = substr($data, $posJsUrl, ($posEndLine - $posJsUrl + 2));
2167
-            $newdata = str_replace($line, '"jsUrl" => "' . filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . '",', $data);
2167
+            $newdata = str_replace($line, '"jsUrl" => "'.filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS).'",', $data);
2168 2168
             file_put_contents($csrfp_file, $newdata);
2169 2169
         } elseif ($post_field === 'restricted_to_input' && (int) $post_value === 0) {
2170 2170
             DB::update(
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
         echo prepareExchangedData(
2184 2184
             array(
2185 2185
                 'error' => false,
2186
-                'misc' => $counter . ' ; ' . $SETTINGS[$post_field],
2186
+                'misc' => $counter.' ; '.$SETTINGS[$post_field],
2187 2187
                 'message' => empty($post_translate) === false ? $lang->get($post_translate) : '',
2188 2188
             ),
2189 2189
             'encode'
@@ -2226,7 +2226,7 @@  discard block
 block discarded – undo
2226 2226
 
2227 2227
         // send statistics
2228 2228
         if (null !== $post_status) {
2229
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2229
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2230 2230
             $counter = DB::count();
2231 2231
             if ($counter === 0) {
2232 2232
                 DB::insert(
@@ -2257,7 +2257,7 @@  discard block
 block discarded – undo
2257 2257
 
2258 2258
         // send statistics items
2259 2259
         if (null !== $post_list) {
2260
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2260
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2261 2261
             $counter = DB::count();
2262 2262
             if ($counter === 0) {
2263 2263
                 DB::insert(
@@ -2303,7 +2303,7 @@  discard block
 block discarded – undo
2303 2303
             break;
2304 2304
         }
2305 2305
 
2306
-        if (DB::query("SHOW TABLES LIKE '" . prefixTable('sk_reencrypt_backup') . "'")) {
2306
+        if (DB::query("SHOW TABLES LIKE '".prefixTable('sk_reencrypt_backup')."'")) {
2307 2307
             if (DB::count() === 1) {
2308 2308
                 echo 1;
2309 2309
             } else {
@@ -2364,7 +2364,7 @@  discard block
 block discarded – undo
2364 2364
 
2365 2365
         $rows = DB::query(
2366 2366
             'SELECT id, title
2367
-                FROM ' . prefixTable('roles_title') . '
2367
+                FROM ' . prefixTable('roles_title').'
2368 2368
                 ORDER BY title ASC'
2369 2369
         );
2370 2370
         foreach ($rows as $record) {
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
 
2497 2497
         $ignoredFiles = DB::queryFirstField(
2498 2498
             'SELECT valeur 
2499
-            FROM ' . prefixTable('misc') . ' 
2499
+            FROM ' . prefixTable('misc').' 
2500 2500
             WHERE type = %s AND intitule = %s',
2501 2501
             'admin',
2502 2502
             'ignored_unknown_files'
@@ -2539,7 +2539,7 @@  discard block
 block discarded – undo
2539 2539
         // Get ignored unknown files
2540 2540
         $existingData = DB::queryFirstRow(
2541 2541
             'SELECT valeur 
2542
-            FROM ' . prefixTable('misc') . ' 
2542
+            FROM ' . prefixTable('misc').' 
2543 2543
             WHERE type = %s AND intitule = %s',
2544 2544
             'admin',
2545 2545
             'ignored_unknown_files'
@@ -2596,7 +2596,7 @@  discard block
 block discarded – undo
2596 2596
         // Get the list of files to delete
2597 2597
         $filesToDelete = DB::queryFirstField(
2598 2598
             'SELECT valeur 
2599
-            FROM ' . prefixTable('misc') . ' 
2599
+            FROM ' . prefixTable('misc').' 
2600 2600
             WHERE type = %s AND intitule = %s',
2601 2601
             'admin',
2602 2602
             'unknown_files'
@@ -2642,7 +2642,7 @@  discard block
 block discarded – undo
2642 2642
         // Get some TP USER info
2643 2643
         $userInfo = DB::queryFirstRow(
2644 2644
             'SELECT id, public_key, private_key, pw
2645
-            FROM ' . prefixTable('users') . ' 
2645
+            FROM ' . prefixTable('users').' 
2646 2646
             WHERE id = %i',
2647 2647
             TP_USER_ID,
2648 2648
         );
@@ -2688,8 +2688,8 @@  discard block
 block discarded – undo
2688 2688
 
2689 2689
         $users = DB::query(
2690 2690
             'SELECT u.id, u.public_key, a.increment_id
2691
-            FROM ' . prefixTable('users') . ' AS u
2692
-            LEFT JOIN ' . prefixTable('api') . ' AS a 
2691
+            FROM ' . prefixTable('users').' AS u
2692
+            LEFT JOIN ' . prefixTable('api').' AS a 
2693 2693
                 ON a.user_id = u.id AND a.type = %s
2694 2694
             WHERE u.disabled = %i AND u.deleted_at IS NULL AND u.public_key IS NOT NULL AND u.admin = %i
2695 2695
             ORDER BY u.login ASC',
@@ -2746,7 +2746,7 @@  discard block
 block discarded – undo
2746 2746
     $lang = new Language($session->get('user-language') ?? 'english');
2747 2747
 
2748 2748
     $results = [];
2749
-    $fullPath = __DIR__ . '/../';
2749
+    $fullPath = __DIR__.'/../';
2750 2750
     
2751 2751
     foreach ($files as $file) {
2752 2752
         // Normalize path separators for cross-platform compatibility
@@ -2795,7 +2795,7 @@  discard block
 block discarded – undo
2795 2795
         }
2796 2796
         
2797 2797
         // Try to delete the file
2798
-        $deleteResult = '';//@unlink($normalizedPath);
2798
+        $deleteResult = ''; //@unlink($normalizedPath);
2799 2799
         
2800 2800
         if ($deleteResult) {
2801 2801
             $results[$normalizedPath] = [
@@ -2825,7 +2825,7 @@  discard block
 block discarded – undo
2825 2825
  */
2826 2826
 function filesIntegrityCheck($baseDir): array
2827 2827
 {
2828
-    $referenceFile = __DIR__ . '/../files_reference.txt';
2828
+    $referenceFile = __DIR__.'/../files_reference.txt';
2829 2829
 
2830 2830
     $unknownFiles = findUnknownFiles($baseDir, $referenceFile);
2831 2831
 
@@ -2863,7 +2863,7 @@  discard block
 block discarded – undo
2863 2863
                 $dir,
2864 2864
                 FilesystemIterator::SKIP_DOTS
2865 2865
             ),
2866
-            function ($current, $key, $iterator) {
2866
+            function($current, $key, $iterator) {
2867 2867
                 // Ignore hidden files and folders
2868 2868
                 if ($current->getFilename()[0] === '.') {
2869 2869
                     return false;
@@ -2877,7 +2877,7 @@  discard block
 block discarded – undo
2877 2877
     foreach ($iterator as $file) {
2878 2878
         try {
2879 2879
             if ($file->isFile()) {
2880
-                $relativePath = str_replace($dir . DIRECTORY_SEPARATOR, '', $file->getPathname());
2880
+                $relativePath = str_replace($dir.DIRECTORY_SEPARATOR, '', $file->getPathname());
2881 2881
                 $relativePath = str_replace('\\', '/', $relativePath); // Normalisation Windows/Linux
2882 2882
 
2883 2883
                 // Split relatif path into parts
@@ -2943,7 +2943,7 @@  discard block
 block discarded – undo
2943 2943
     // Get ignored files
2944 2944
     $ignoredFiles = DB::queryFirstField(
2945 2945
         'SELECT valeur 
2946
-        FROM ' . prefixTable('misc') . ' 
2946
+        FROM ' . prefixTable('misc').' 
2947 2947
         WHERE type = %s AND intitule = %s',
2948 2948
         'admin',
2949 2949
         'ignored_unknown_files'
@@ -2962,7 +2962,7 @@  discard block
 block discarded – undo
2962 2962
 function tablesIntegrityCheck(): array
2963 2963
 {
2964 2964
     // Get integrity tables file
2965
-    $integrityTablesFile = TEAMPASS_ROOT_PATH . '/includes/tables_integrity.json';
2965
+    $integrityTablesFile = TEAMPASS_ROOT_PATH.'/includes/tables_integrity.json';
2966 2966
     if (file_exists($integrityTablesFile) === false) {
2967 2967
         return [
2968 2968
             'error' => true,
@@ -2980,7 +2980,7 @@  discard block
 block discarded – undo
2980 2980
     // Get all tables
2981 2981
     $tables = [];
2982 2982
     foreach (DB::queryFirstColumn("SHOW TABLES") as $table) {
2983
-        $tables[] = str_replace(DB_PREFIX, "", $table);;
2983
+        $tables[] = str_replace(DB_PREFIX, "", $table); ;
2984 2984
     }
2985 2985
     // Prepare the integrity check
2986 2986
     $tablesInError = [];
@@ -3046,7 +3046,7 @@  discard block
 block discarded – undo
3046 3046
 
3047 3047
         // Compare hashes
3048 3048
         $expectedHash = $referenceData[$file];
3049
-        $actualHash = md5_file($baseDir . '/' . $file);
3049
+        $actualHash = md5_file($baseDir.'/'.$file);
3050 3050
 
3051 3051
         if ($expectedHash !== $actualHash) {
3052 3052
             $issues[] = "$file (expected: <i>$expectedHash</i>, actual: <i>$actualHash</i>)";
@@ -3099,7 +3099,7 @@  discard block
 block discarded – undo
3099 3099
     foreach ($iterator as $file) {
3100 3100
         if ($file->isFile()) {
3101 3101
             // Build relative path
3102
-            $relativePath = str_replace($dir . DIRECTORY_SEPARATOR, '', $file->getPathname());
3102
+            $relativePath = str_replace($dir.DIRECTORY_SEPARATOR, '', $file->getPathname());
3103 3103
             $relativePath = str_replace('\\', '/', $relativePath); // Normalize for Windows
3104 3104
             // Calculate hash
3105 3105
             $files[$relativePath] = md5_file($file->getPathname());
@@ -3129,8 +3129,8 @@  discard block
 block discarded – undo
3129 3129
     // Loop on items
3130 3130
     $item = DB::queryFirstRow(
3131 3131
         'SELECT i.id, i.pw, s.share_key, s.increment_id
3132
-        FROM ' . prefixTable('items') . ' i
3133
-        INNER JOIN ' . prefixTable('sharekeys_items') . ' s ON i.id = s.object_id
3132
+        FROM ' . prefixTable('items').' i
3133
+        INNER JOIN ' . prefixTable('sharekeys_items').' s ON i.id = s.object_id
3134 3134
         WHERE i.perso = %i
3135 3135
             AND s.user_id = %i
3136 3136
         ORDER BY RAND()
@@ -3159,7 +3159,7 @@  discard block
 block discarded – undo
3159 3159
         // Get all items in database
3160 3160
         $rows = DB::queryFirstRow(
3161 3161
             'SELECT count(*) as counter
3162
-            FROM ' . prefixTable('sharekeys_items') . ' s
3162
+            FROM ' . prefixTable('sharekeys_items').' s
3163 3163
             WHERE s.user_id = %i',
3164 3164
             TP_USER_ID
3165 3165
         );
Please login to merge, or discard this patch.
pages/api.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('api') === false) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                                     <?php
161 161
                                     $rowsKeys = DB::query(
162 162
                                         'SELECT *
163
-                                        FROM ' . prefixTable('api') . '
163
+                                        FROM ' . prefixTable('api').'
164 164
                                         WHERE type = %s
165 165
                                         ORDER BY timestamp ASC',
166 166
                                         'key'
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
                                             <?php
184 184
                                             foreach ($rowsKeys as $key) {
185 185
                                                 echo '
186
-                                                    <tr data-id="' . $key['increment_id'] . '">
187
-                                                    <td width="50px"><i class="fas fa-trash infotip pointer delete-api-key" title="' . $lang->get('del_button') . '"></i></td>
188
-                                                    <td><span class="edit-api-key pointer">' . $key['label'] . '</span></td>
189
-                                                    <td>' . $key['value']. '</td>   
190
-                                                    <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="' . $key['increment_id'] . '"></i></td>
191
-                                                    <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="' . $key['increment_id'] . '"></i></td>
192
-                                                    <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="' . $key['increment_id'] . '"></i></td>
193
-                                                    <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="' . $key['increment_id'] . '"></i></td>
194
-                                                    <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="' . $key['increment_id'] . '"></i></td>                   
186
+                                                    <tr data-id="' . $key['increment_id'].'">
187
+                                                    <td width="50px"><i class="fas fa-trash infotip pointer delete-api-key" title="' . $lang->get('del_button').'"></i></td>
188
+                                                    <td><span class="edit-api-key pointer">' . $key['label'].'</span></td>
189
+                                                    <td>' . $key['value'].'</td>   
190
+                                                    <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="'.$key['increment_id'].'"></i></td>
191
+                                                    <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="'.$key['increment_id'].'"></i></td>
192
+                                                    <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="'.$key['increment_id'].'"></i></td>
193
+                                                    <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="'.$key['increment_id'].'"></i></td>
194
+                                                    <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="'.$key['increment_id'].'"></i></td>                   
195 195
                                                 </tr>';
196 196
                                             } ?>
197 197
                                         </tbody>
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                                 <div class="col-12 mt-4" id="table-api-ip">
227 227
                                     <?php
228 228
                                     $rowsIps = DB::query(
229
-                                                'SELECT increment_id, label, timestamp value FROM ' . prefixTable('api') . '
229
+                                                'SELECT increment_id, label, timestamp value FROM '.prefixTable('api').'
230 230
                                                 WHERE type = %s
231 231
                                                 ORDER BY timestamp ASC',
232 232
                                                 'ip'
@@ -244,10 +244,10 @@  discard block
 block discarded – undo
244 244
                                             <?php
245 245
                                             foreach ($rowsIps as $ip) {
246 246
                                                 echo '
247
-                                                <tr data-id="' . $ip['increment_id'] . '">
248
-                                                    <td width="50px"><i class="fas fa-trash infotip pointer delete-api-ip" title="' . $lang->get('del_button') . '"></i></td>
249
-                                                    <td><span class="edit-api-ip pointer" data-field="label">' . $ip['label'] . '</span></td>
250
-                                                    <td><span class="edit-api-ip pointer" data-field="value">' . $ip['value'] . '</span></td>
247
+                                                <tr data-id="' . $ip['increment_id'].'">
248
+                                                    <td width="50px"><i class="fas fa-trash infotip pointer delete-api-ip" title="' . $lang->get('del_button').'"></i></td>
249
+                                                    <td><span class="edit-api-ip pointer" data-field="label">' . $ip['label'].'</span></td>
250
+                                                    <td><span class="edit-api-ip pointer" data-field="value">' . $ip['value'].'</span></td>
251 251
                                                 </tr>';
252 252
                                             } ?>
253 253
                                         </tbody>
@@ -291,8 +291,8 @@  discard block
 block discarded – undo
291 291
                                     <?php
292 292
                                     $rowsKeys = DB::query(
293 293
                                         'SELECT a.*, u.name, u.lastname, u.login
294
-                                        FROM ' . prefixTable('api') . ' AS a
295
-                                        INNER JOIN ' . prefixTable('users') . ' AS u ON a.user_id = u.id
294
+                                        FROM ' . prefixTable('api').' AS a
295
+                                        INNER JOIN ' . prefixTable('users').' AS u ON a.user_id = u.id
296 296
                                         WHERE a.type = %s AND u.disabled = %i AND u.deleted_at IS NULL AND u.id NOT IN %li AND u.admin = %i
297 297
                                         ORDER BY u.login ASC',
298 298
                                         'user',
@@ -316,13 +316,13 @@  discard block
 block discarded – undo
316 316
                                             <?php
317 317
                                             foreach ($rowsKeys as $key) {
318 318
                                                 echo '
319
-                                                    <tr data-id="' . $key['increment_id'] . '">
320
-                                                    <td>' . $key['name'] . ' ' . $key['lastname'] . ' (<i>'.$key['login'].'</i>)</td>
321
-                                                    <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="' . $key['increment_id'] . '"></i></td>
322
-                                                    <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="' . $key['increment_id'] . '"></i></td>
323
-                                                    <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="' . $key['increment_id'] . '"></i></td>
324
-                                                    <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="' . $key['increment_id'] . '"></i></td>
325
-                                                    <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="' . $key['increment_id'] . '"></i></td>
319
+                                                    <tr data-id="' . $key['increment_id'].'">
320
+                                                    <td>' . $key['name'].' '.$key['lastname'].' (<i>'.$key['login'].'</i>)</td>
321
+                                                    <td><i class="fas '.((int) $key['enabled'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="enabled" data-increment-id="'.$key['increment_id'].'"></i></td>
322
+                                                    <td><i class="fas '.((int) $key['allowed_to_create'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_create" data-increment-id="'.$key['increment_id'].'"></i></td>
323
+                                                    <td><i class="fas '.((int) $key['allowed_to_read'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_read" data-increment-id="'.$key['increment_id'].'"></i></td>
324
+                                                    <td><i class="fas '.((int) $key['allowed_to_update'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_update" data-increment-id="'.$key['increment_id'].'"></i></td>
325
+                                                    <td><i class="fas '.((int) $key['allowed_to_delete'] === 1 ? 'fa-toggle-on text-info' : 'fa-toggle-off').' mr-1 text-center pointer api-clickme-action" data-field="allowed_to_delete" data-increment-id="'.$key['increment_id'].'"></i></td>
326 326
                                                 </tr>';
327 327
                                             } ?>
328 328
                                         </tbody>
Please login to merge, or discard this patch.
pages/options.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('options') === false) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
                                     // get list of all timezones
253 253
                                     foreach ($zones as $key => $zone) {
254 254
                                         echo '
255
-                                <option value="' . $key . '"', isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : '', '>' . $zone . '</option>';
255
+                                <option value="' . $key.'"', isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : '', '>'.$zone.'</option>';
256 256
                                     }
257 257
                                     ?>
258 258
                                 </select>
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
                                     $languagesList = $languagesList ?? [];
305 305
                                     foreach ($languagesList as $teampassLang) {
306 306
                                         echo '
307
-                                <option value="' . $teampassLang . '"', isset($SETTINGS['default_language']) === true && $SETTINGS['default_language'] === $teampassLang ? ' selected' : '', '>' . $teampassLang . '</option>';
307
+                                <option value="' . $teampassLang.'"', isset($SETTINGS['default_language']) === true && $SETTINGS['default_language'] === $teampassLang ? ' selected' : '', '>'.$teampassLang.'</option>';
308 308
                                     }
309 309
                                     ?>
310 310
                                 </select>
@@ -929,7 +929,7 @@  discard block
 block discarded – undo
929 929
                                         $roles = getRolesTitles();
930 930
                                         foreach ($roles as $role) {
931 931
                                             echo '
932
-                                    <option value="' . htmlspecialchars($role['id']) . '"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>' . htmlspecialchars(addslashes($role['title'])) . '</option>';
932
+                                    <option value="' . htmlspecialchars($role['id']).'"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>'.htmlspecialchars(addslashes($role['title'])).'</option>';
933 933
                                         }
934 934
                                     }
935 935
                                     ?>
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
                                     <?php
968 968
                                     foreach (TP_PW_COMPLEXITY as $complex) {
969 969
                                         echo '
970
-                                <option value="' . $complex[0] . '"', isset($SETTINGS['offline_key_level']) === true && (int) $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>';
970
+                                <option value="' . $complex[0].'"', isset($SETTINGS['offline_key_level']) === true && (int) $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>';
971 971
                                     }
972 972
                                     ?>
973 973
                                 </select>
Please login to merge, or discard this patch.
sources/find.queries.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 ) {
74 74
     // Not allowed page
75 75
     $session->set('system-error_code', ERR_NOT_ALLOWED);
76
-    include $SETTINGS['cpassman_dir'] . '/error.php';
76
+    include $SETTINGS['cpassman_dir'].'/error.php';
77 77
     exit;
78 78
 }
79 79
 
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
 if (null === $session->get('user-accessible_folders')
93 93
     || empty($session->get('user-accessible_folders')) === true
94 94
 ) {
95
-    echo '{"sEcho": ' . $request->query->filter('sEcho', FILTER_SANITIZE_NUMBER_INT) . ' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }';
95
+    echo '{"sEcho": '.$request->query->filter('sEcho', FILTER_SANITIZE_NUMBER_INT).' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }';
96 96
     exit;
97 97
 }
98 98
 
99 99
 //Columns name
100
-$aColumns = ['c.id', 'c.label', 'c.login', 'c.description', 'c.tags', 'c.id_tree', 'c.folder', 'c.login', 'c.url', 'ci.data'];//
100
+$aColumns = ['c.id', 'c.label', 'c.login', 'c.description', 'c.tags', 'c.id_tree', 'c.folder', 'c.login', 'c.url', 'ci.data']; //
101 101
 $aSortTypes = ['ASC', 'DESC'];
102 102
 //init SQL variables
103 103
 $sOrder = $sLimit = $sWhere = '';
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 
118 118
 //Get current user "personal folder" ID
119 119
 $row = DB::query(
120
-    'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %i',
120
+    'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %i',
121 121
     intval($session->get('user-id'))
122 122
 );
123 123
 //get list of personal folders
@@ -126,20 +126,20 @@  discard block
 block discarded – undo
126 126
 $listPf = '';
127 127
 if (empty($row['id']) === false) {
128 128
     $rows = DB::query(
129
-        'SELECT id FROM ' . prefixTable('nested_tree') . '
129
+        'SELECT id FROM '.prefixTable('nested_tree').'
130 130
         WHERE personal_folder = 1 AND NOT parent_id = %i AND NOT title = %i',
131 131
         filter_var($row['id'], FILTER_SANITIZE_NUMBER_INT),
132 132
         filter_var($session->get('user-id'), FILTER_SANITIZE_NUMBER_INT)
133 133
     );
134 134
     foreach ($rows as $record) {
135
-        if (! in_array($record['id'], $arrayPf)) {
135
+        if (!in_array($record['id'], $arrayPf)) {
136 136
             //build an array of personal folders ids
137 137
             array_push($arrayPf, $record['id']);
138 138
             //build also a string with those ids
139 139
             if (empty($listPf)) {
140 140
                 $listPf = $record['id'];
141 141
             } else {
142
-                $listPf .= ', ' . $record['id'];
142
+                $listPf .= ', '.$record['id'];
143 143
             }
144 144
         }
145 145
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 //Paging
150 150
 $sLimit = '';
151 151
 if (null !== $request->query->get('start') && $request->query->get('length') !== '-1') {
152
-    $sLimit = 'LIMIT ' . $request->query->filter('start', null, FILTER_SANITIZE_NUMBER_INT) . ', ' . $request->query->filter('length', null, FILTER_SANITIZE_NUMBER_INT) . '';
152
+    $sLimit = 'LIMIT '.$request->query->filter('start', null, FILTER_SANITIZE_NUMBER_INT).', '.$request->query->filter('length', null, FILTER_SANITIZE_NUMBER_INT).'';
153 153
 }
154 154
 
155 155
 //Ordering
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
     }
164 164
     $sOrder = 'ORDER BY  ';
165 165
     if ($orderParam[0]['column'] >= 0) {
166
-        $sOrder .= '' . $aColumns[filter_var($orderParam[0]['column'], FILTER_SANITIZE_NUMBER_INT)] . ' '
167
-                . filter_var($orderParam[0]['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS) . ', ';
166
+        $sOrder .= ''.$aColumns[filter_var($orderParam[0]['column'], FILTER_SANITIZE_NUMBER_INT)].' '
167
+                . filter_var($orderParam[0]['dir'], FILTER_SANITIZE_FULL_SPECIAL_CHARS).', ';
168 168
     }
169 169
 
170 170
     $sOrder = substr_replace($sOrder, '', -2);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         $sOrder = '';
173 173
     }
174 174
 } else {
175
-    $sOrder = 'ORDER BY ' . $aColumns[1] . ' ASC';
175
+    $sOrder = 'ORDER BY '.$aColumns[1].' ASC';
176 176
 }
177 177
 
178 178
 // Define criteria
@@ -196,9 +196,9 @@  discard block
 block discarded – undo
196 196
 if (empty($search_criteria) === false) {
197 197
     $sWhere .= ' AND (';
198 198
     for ($i = 0; $i < count($aColumns); ++$i) {
199
-        $sWhere .= $aColumns[$i] . ' LIKE %ss_' . $i . ' OR ';
199
+        $sWhere .= $aColumns[$i].' LIKE %ss_'.$i.' OR ';
200 200
     }
201
-    $sWhere = substr_replace((string) $sWhere, '', -3) . ') ';
201
+    $sWhere = substr_replace((string) $sWhere, '', -3).') ';
202 202
     $crit = [
203 203
         'idtree' => array_unique($folders),
204 204
         '0' => $search_criteria,
@@ -235,16 +235,16 @@  discard block
 block discarded – undo
235 235
 
236 236
 // Do NOT show the items in PERSONAL FOLDERS
237 237
 if (empty($listPf) === false) {
238
-    $sWhere = 'WHERE ' . $sWhere . ' AND c.id_tree NOT IN %ls_pf ';
238
+    $sWhere = 'WHERE '.$sWhere.' AND c.id_tree NOT IN %ls_pf ';
239 239
 } else {
240
-    $sWhere = 'WHERE ' . $sWhere;
240
+    $sWhere = 'WHERE '.$sWhere;
241 241
 }
242 242
 
243 243
 // Do queries
244 244
 DB::query(
245 245
     "SELECT c.id
246
-    FROM " . prefixTable('cache') . " AS c
247
-    LEFT JOIN " . prefixTable('categories_items') . " AS ci ON (ci.item_id = c.id)
246
+    FROM " . prefixTable('cache')." AS c
247
+    LEFT JOIN " . prefixTable('categories_items')." AS ci ON (ci.item_id = c.id)
248 248
     {$sWhere}
249 249
     {$sOrder}",
250 250
     $crit
@@ -252,9 +252,9 @@  discard block
 block discarded – undo
252 252
 $iTotal = DB::count();
253 253
 $rows = DB::query(
254 254
     "SELECT c.*, ci.data, i.item_key
255
-    FROM " . prefixTable('cache') . " AS c
256
-    LEFT JOIN " . prefixTable('categories_items') . " AS ci ON (ci.item_id = c.id)
257
-    INNER JOIN " . prefixTable('items') . " AS i ON (i.id = c.id)
255
+    FROM " . prefixTable('cache')." AS c
256
+    LEFT JOIN " . prefixTable('categories_items')." AS ci ON (ci.item_id = c.id)
257
+    INNER JOIN " . prefixTable('items')." AS i ON (i.id = c.id)
258 258
     {$sWhere}
259 259
     {$sOrder}
260 260
     {$sLimit}",
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 if (null === $request->query->get('type')) {
280 280
     $sOutput = '{';
281 281
     if (null !== $request->query->get('draw')) {
282
-        $sOutput .= '"draw": ' . $request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT) . ', ';
282
+        $sOutput .= '"draw": '.$request->query->filter('draw', FILTER_SANITIZE_NUMBER_INT).', ';
283 283
     }
284 284
     $sOutput .= '"data": [';
285 285
     $sOutputConst = '';
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             foreach (explode(';', $session->get('user-roles')) as $role) {
297 297
                 //db::debugmode(true);
298 298
                 $access = DB::queryFirstRow(
299
-                    'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
299
+                    'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
300 300
                     $role,
301 301
                     $record['id_tree']
302 302
                 );
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             }
317 317
             $accessLevel = count($arrTmp) > 0 ? min($arrTmp) : $accessLevel;
318 318
             if ($accessLevel === 0) {
319
-                $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"' . $record['id'] . '\">';
319
+                $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"'.$record['id'].'\">';
320 320
             }
321 321
 
322 322
             if ((int) $accessLevel === 0) {
@@ -356,22 +356,22 @@  discard block
 block discarded – undo
356 356
             if (empty($restrictedTo)) {
357 357
                 $restrictedTo = $session->get('user-id');
358 358
             } else {
359
-                $restrictedTo .= ',' . $session->get('user-id');
359
+                $restrictedTo .= ','.$session->get('user-id');
360 360
             }
361 361
         }
362 362
         
363 363
         //col1
364
-        $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"' . $lang->get('open_url_link') . '\" onClick=\"window.location.href=&#039;index.php?page=items&amp;group=' . $record['id_tree'] . '&amp;id=' . $record['id'] . '&#039;\" style=\"cursor:pointer;\"></i>' .
365
-        '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"' . stripslashes($lang->get('see_item_title')) . '\" data-id=\"' . $record['id'] . '\" data-perso=\"' . $record['perso'] . '\" data-tree-id=\"' . $record['id_tree'] . '\" data-expired=\"' . $expired . '\" data-restricted-to=\"' . $restrictedTo . '\" data-rights=\"' . $right . '\" style=\"cursor:pointer;\"></i>' . $checkbox . '",' ;
364
+        $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"'.$lang->get('open_url_link').'\" onClick=\"window.location.href=&#039;index.php?page=items&amp;group='.$record['id_tree'].'&amp;id='.$record['id'].'&#039;\" style=\"cursor:pointer;\"></i>'.
365
+        '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"'.stripslashes($lang->get('see_item_title')).'\" data-id=\"'.$record['id'].'\" data-perso=\"'.$record['perso'].'\" data-tree-id=\"'.$record['id_tree'].'\" data-expired=\"'.$expired.'\" data-restricted-to=\"'.$restrictedTo.'\" data-rights=\"'.$right.'\" style=\"cursor:pointer;\"></i>'.$checkbox.'",';
366 366
         //col2
367
-        $sOutputItem .= '"'.base64_encode('<span id=\"item_label-' . $record['id'] . '\">' . (str_replace("\\", "&#92;", (string) $record['label'])) . '</span>').'", ';   // replace backslash #3015
367
+        $sOutputItem .= '"'.base64_encode('<span id=\"item_label-'.$record['id'].'\">'.(str_replace("\\", "&#92;", (string) $record['label'])).'</span>').'", '; // replace backslash #3015
368 368
         //col3
369
-        $sOutputItem .= '"' . base64_encode(str_replace('&amp;', '&', htmlspecialchars(stripslashes((string) $record['login']), ENT_QUOTES))) . '", ';
369
+        $sOutputItem .= '"'.base64_encode(str_replace('&amp;', '&', htmlspecialchars(stripslashes((string) $record['login']), ENT_QUOTES))).'", ';
370 370
         //col4
371 371
         //get restriction from ROles
372 372
         $restrictedToRole = false;
373 373
         $rTmp = DB::queryFirstColumn(
374
-            'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i',
374
+            'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i',
375 375
             $record['id']
376 376
         );
377 377
         // We considere here that if user has at least one group similar to the object ones
@@ -389,14 +389,14 @@  discard block
 block discarded – undo
389 389
         } else {
390 390
             $txt = str_replace(['\n', '<br />', '\\'], [' ', ' ', '', ' '], strip_tags($record['description']));
391 391
             if (strlen($txt) > 50) {
392
-                $sOutputItem .= '"' . base64_encode(substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50)) . '", ';
392
+                $sOutputItem .= '"'.base64_encode(substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50)).'", ';
393 393
             } else {
394
-                $sOutputItem .= '"' . base64_encode(stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt))) . '", ';
394
+                $sOutputItem .= '"'.base64_encode(stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt))).'", ';
395 395
             }
396 396
         }
397 397
 
398 398
         //col5 - TAGS
399
-        $sOutputItem .= '"' . base64_encode(htmlspecialchars(stripslashes((string) $record['tags']), ENT_QUOTES)) . '", ';
399
+        $sOutputItem .= '"'.base64_encode(htmlspecialchars(stripslashes((string) $record['tags']), ENT_QUOTES)).'", ';
400 400
         // col6 - URL
401 401
         if ($record['url'] !== '0') {
402 402
             $sOutputItem .= '"'.htmlspecialchars(filter_var($record['url'], FILTER_SANITIZE_URL)).'", ';
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
         }
406 406
 
407 407
         //col7 - Prepare the Treegrid
408
-        $sOutputItem .= '"' . base64_encode(stripslashes((string) $record['folder'])) . '"';
408
+        $sOutputItem .= '"'.base64_encode(stripslashes((string) $record['folder'])).'"';
409 409
         //Finish the line
410 410
         //$sOutputItem .= '], ';
411 411
         if ($getItemInList === true) {
@@ -414,17 +414,17 @@  discard block
 block discarded – undo
414 414
             --$iTotal;
415 415
         }
416 416
     }
417
-    if (! empty($sOutputConst)) {
417
+    if (!empty($sOutputConst)) {
418 418
         $sOutput .= substr_replace($sOutputConst, '', -2);
419 419
     }
420 420
     $sOutput .= '], ';
421
-    $sOutput .= '"recordsTotal": ' . $iTotal . ', ';
422
-    $sOutput .= '"recordsFiltered": ' . $iTotal . ' }';
421
+    $sOutput .= '"recordsTotal": '.$iTotal.', ';
422
+    $sOutput .= '"recordsFiltered": '.$iTotal.' }';
423 423
     // file deepcode ignore XSS: data is secured
424 424
     echo ($sOutput);
425 425
 } elseif (null !== $request->query->get('type') && ($request->query->get('type') === 'search_for_items' || $request->query->get('type') === 'search_for_items_with_tags')) {
426 426
     include_once 'main.functions.php';
427
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session->get('user-language') . '.php';
427
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session->get('user-language').'.php';
428 428
 
429 429
     $totalItems = $request->query->filter('totalItems', null, FILTER_SANITIZE_NUMBER_INT);
430 430
 
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $arr_data[$record['id']]['tree_id'] = (int) $record['id_tree'];
436 436
         $arr_data[$record['id']]['label'] = (string) $record['label'];
437 437
         $arr_data[$record['id']]['desc'] = (string) strip_tags(explode('<br>', $record['description'])[0]);
438
-        $arr_data[$record['id']]['folder'] = (string)$record['folder'];
438
+        $arr_data[$record['id']]['folder'] = (string) $record['folder'];
439 439
         $arr_data[$record['id']]['login'] = (string) strtr($record['login'], '"', '&quot;');
440 440
         $arr_data[$record['id']]['item_key'] = (string) $record['item_key'];
441 441
         $arr_data[$record['id']]['link'] = (string) $record['url'] !== '0' && empty($record['url']) === false ? filter_var($record['url'], FILTER_SANITIZE_URL) : '';
@@ -455,8 +455,8 @@  discard block
 block discarded – undo
455 455
 
456 456
         $dataItem = DB::query(
457 457
             'SELECT i.anyone_can_modify, i.perso, r.role_id 
458
-            FROM ' . prefixTable('items') . ' i
459
-            LEFT JOIN ' . prefixTable('restriction_to_roles') . ' r ON i.id = r.item_id
458
+            FROM ' . prefixTable('items').' i
459
+            LEFT JOIN ' . prefixTable('restriction_to_roles').' r ON i.id = r.item_id
460 460
             WHERE i.id = %i',
461 461
             $record['id']
462 462
         );
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
             if (empty($restrictedTo)) {
513 513
                 $restrictedTo = $session->get('user-id');
514 514
             } else {
515
-                $restrictedTo .= ',' . $session->get('user-id');
515
+                $restrictedTo .= ','.$session->get('user-id');
516 516
             }
517 517
         }
518 518
         $arr_data[$record['id']]['restricted'] = $restrictedTo;
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
             $arrTmp = [];
626 626
             foreach (explode(';', $session->get('user-roles')) as $role) {
627 627
                 $access = DB::queryFirstRow(
628
-                    'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
628
+                    'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
629 629
                     $role,
630 630
                     $record['id_tree']
631 631
                 );
@@ -676,8 +676,8 @@  discard block
 block discarded – undo
676 676
         ) {
677 677
             $data_item = DB::queryFirstRow(
678 678
                 'SELECT i.pw AS pw, s.share_key AS share_key
679
-                FROM ' . prefixTable('items') . ' AS i
680
-                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
679
+                FROM ' . prefixTable('items').' AS i
680
+                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
681 681
                 WHERE i.id = %i AND s.user_id = %i',
682 682
                 $record['id'],
683 683
                 $session->get('user-id')
Please login to merge, or discard this patch.
pages/fields.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('fields') === false) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
                                         $folders = $tree->getDescendants();
182 182
 foreach ($folders as $folder) {
183 183
     DB::query(
184
-        'SELECT * FROM ' . prefixTable('nested_tree') . '
184
+        'SELECT * FROM '.prefixTable('nested_tree').'
185 185
                                         WHERE personal_folder = %i AND id = %i',
186 186
         '0',
187 187
         $folder->id
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             $ident .= '-';
194 194
         }
195 195
         echo '
196
-                                        <option value="' . $folder->id . '">' . $ident . '&nbsp;' . str_replace('&', '&amp;', $folder->title) . '</option>';
196
+                                        <option value="' . $folder->id.'">'.$ident.'&nbsp;'.str_replace('&', '&amp;', $folder->title).'</option>';
197 197
     }
198 198
 }
199 199
                                         ?>
@@ -224,9 +224,9 @@  discard block
 block discarded – undo
224 224
                                     <select class="form-control form-item-control select2" style="width:100%;" id="form-field-type">
225 225
                                         <?php
226 226
                                         // Build list of Types
227
-                                        echo '<option value="">-- ' . $lang->get('select') . ' --</option>
228
-                                            <option value="text">' . $lang->get('text') . '</option>
229
-                                            <option value="textarea">' . $lang->get('textarea') . '</option>';
227
+                                        echo '<option value="">-- '.$lang->get('select').' --</option>
228
+                                            <option value="text">' . $lang->get('text').'</option>
229
+                                            <option value="textarea">' . $lang->get('textarea').'</option>';
230 230
                                         ?>
231 231
                                     </select>
232 232
                                 </div>
@@ -259,14 +259,14 @@  discard block
 block discarded – undo
259 259
                                     <select class="form-control form-item-control select2 no-save" multiple="multiple" style="width:100%;" id="form-field-roles">
260 260
                                         <?php
261 261
                                         // Build list of Roles
262
-                                        echo '<option value="all">' . $lang->get('every_roles') . '</option>';
262
+                                        echo '<option value="all">'.$lang->get('every_roles').'</option>';
263 263
 $rows = DB::query(
264 264
     'SELECT id, title
265
-                                    FROM ' . prefixTable('roles_title') . '
265
+                                    FROM ' . prefixTable('roles_title').'
266 266
                                     ORDER BY title ASC'
267 267
 );
268 268
 foreach ($rows as $record) {
269
-    echo '<option value="' . $record['id'] . '">' . addslashes($record['title']) . '</option>';
269
+    echo '<option value="'.$record['id'].'">'.addslashes($record['title']).'</option>';
270 270
 }
271 271
                                         ?>
272 272
                                     </select>
Please login to merge, or discard this patch.
includes/language/english.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
  * @see       https://www.teampass.net
29 29
  */
30 30
 
31
- // TO REMOVE
32
- // - selected_items_to_be_imported
31
+    // TO REMOVE
32
+    // - selected_items_to_be_imported
33 33
 
34 34
 return array(
35 35
     'some_items_not_copied_empty_password' => 'Some items could not be copied because they have empty passwords.',
Please login to merge, or discard this patch.