Passed
Push — teampass_3.0 ( 7063cf...c56083 )
by Nils
06:28
created
pages/utilities.logs.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 }
37 37
 
38 38
 /* do checks */
39
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
39
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
40 40
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'utilities.logs', $SETTINGS) === false) {
41 41
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
42
-    include $SETTINGS['cpassman_dir'] . '/error.php';
42
+    include $SETTINGS['cpassman_dir'].'/error.php';
43 43
     exit();
44 44
 }
45 45
 
46 46
 // Load template
47
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
47
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
48 48
 
49 49
 ?>
50 50
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
                                             echo (isset($_SESSION['user_admin']) && (int) $_SESSION['user_admin'] === 1) ? '' : ' hidden';
170 170
                                             ?>">
171 171
                         <div class="form-group">
172
-                            <h5><i class="fas fa-broom mr-2"></i><?php echo langHdl('purge') . ' ' . langHdl('date_range'); ?></h5>
172
+                            <h5><i class="fas fa-broom mr-2"></i><?php echo langHdl('purge').' '.langHdl('date_range'); ?></h5>
173 173
                             <div class="input-group">
174 174
                                 <div class="input-group-prepend">
175 175
                                     <span class="input-group-text">
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                                     <select class="form-control" id="purge-filter-user">
193 193
                                         <option value="-1"><?php echo langHdl('all'); ?></option>
194 194
                                     <?php
195
-                                    $rows = DB::query('SELECT id, name, lastname FROM ' . prefixTable('users') . ' WHERE admin = 0');
195
+                                    $rows = DB::query('SELECT id, name, lastname FROM '.prefixTable('users').' WHERE admin = 0');
196 196
                                     foreach ($rows as $record) {
197 197
                                         echo '
198 198
                                         <option value="'.$record['id'].'">'.$record['name'].' '.$record['lastname'].'</option>';
Please login to merge, or discard this patch.
pages/roles.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 }
37 37
 
38 38
 /* do checks */
39
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
39
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
40 40
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'roles', $SETTINGS) === false) {
41 41
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
42
-    include $SETTINGS['cpassman_dir'] . '/error.php';
42
+    include $SETTINGS['cpassman_dir'].'/error.php';
43 43
     exit();
44 44
 }
45 45
 
46 46
 // Load template
47
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
47
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
48 48
 
49 49
 ?>
50 50
 
@@ -87,18 +87,18 @@  discard block
 block discarded – undo
87 87
                                 $arrUserRoles = array_filter($_SESSION['user_roles']);
88 88
                                 $where = '';
89 89
                                 if (count($arrUserRoles) > 0 && (int) $_SESSION['is_admin'] !== 1) {
90
-                                    $where = ' WHERE id IN (' . implode(',', $arrUserRoles) . ')';
90
+                                    $where = ' WHERE id IN ('.implode(',', $arrUserRoles).')';
91 91
                                 }
92
-                                $rows = DB::query('SELECT * FROM ' . prefixTable('roles_title') . $where);
92
+                                $rows = DB::query('SELECT * FROM '.prefixTable('roles_title').$where);
93 93
 
94 94
                                 foreach ($rows as $reccord) {
95 95
                                     echo '
96
-                                <option value="' . $reccord['id'] . '" ' .
97
-                                        'data-complexity-text="' . addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]) . '" ' .
98
-                                        'data-complexity-icon="' . TP_PW_COMPLEXITY[$reccord['complexity']][2] . '" ' .
99
-                                        'data-complexity="' . TP_PW_COMPLEXITY[$reccord['complexity']][0] . '" ' .
100
-                                        'data-allow-edit-all="' . $reccord['allow_pw_change'] . '">' .
101
-                                        $reccord['title'] . '</option>';
96
+                                <option value="' . $reccord['id'].'" '.
97
+                                        'data-complexity-text="'.addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]).'" '.
98
+                                        'data-complexity-icon="'.TP_PW_COMPLEXITY[$reccord['complexity']][2].'" '.
99
+                                        'data-complexity="'.TP_PW_COMPLEXITY[$reccord['complexity']][0].'" '.
100
+                                        'data-allow-edit-all="'.$reccord['allow_pw_change'].'">'.
101
+                                        $reccord['title'].'</option>';
102 102
                                 }
103 103
                                 ?>
104 104
                             </select>
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                                         <?php
120 120
                                         foreach (TP_PW_COMPLEXITY as $entry) {
121 121
                                             echo '
122
-                                        <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>';
122
+                                        <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>';
123 123
                                         }
124 124
                                         ?>
125 125
                                     </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
@@ -34,17 +34,17 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // Do checks
37
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
38
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
37
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
38
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
39 39
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) {
40 40
     // Not allowed page
41 41
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
42
-    include $SETTINGS['cpassman_dir'] . '/error.php';
42
+    include $SETTINGS['cpassman_dir'].'/error.php';
43 43
     exit();
44 44
 }
45 45
 
46
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
47
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
46
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
47
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
48 48
 header('Content-type: text/html; charset=utf-8');
49 49
 header('Cache-Control: no-cache, must-revalidate');
50 50
 require_once 'main.functions.php';
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 if (isset($_SESSION['groupes_visibles']) === false
54 54
     || empty($_SESSION['groupes_visibles']) === true
55 55
 ) {
56
-    echo '{"sEcho": ' . intval($_GET['sEcho']) . ' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }';
56
+    echo '{"sEcho": '.intval($_GET['sEcho']).' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }';
57 57
     exit;
58 58
 }
59 59
 
60 60
 //Connect to DB
61
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
61
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
62 62
 if (defined('DB_PASSWD_CLEAR') === false) {
63 63
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
64 64
 }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     $folders = $_SESSION['groupes_visibles'];
84 84
 } else {
85 85
     // Build tree
86
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
86
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
87 87
     $tree->register();
88 88
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
89 89
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
 //Get current user "personal folder" ID
95 95
 $row = DB::query(
96
-    'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %i',
96
+    'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %i',
97 97
     intval($_SESSION['user_id'])
98 98
 );
99 99
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 $listPf = '';
104 104
 if (empty($row['id']) === false) {
105 105
     $rows = DB::query(
106
-        'SELECT id FROM ' . prefixTable('nested_tree') . '
106
+        'SELECT id FROM '.prefixTable('nested_tree').'
107 107
         WHERE personal_folder = 1 AND NOT parent_id = %i AND NOT title = %i',
108 108
         '1',
109 109
         filter_var($row['id'], FILTER_SANITIZE_NUMBER_INT),
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             if (empty($listPf)) {
118 118
                 $listPf = $record['id'];
119 119
             } else {
120
-                $listPf .= ', ' . $record['id'];
120
+                $listPf .= ', '.$record['id'];
121 121
             }
122 122
         }
123 123
     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 //Paging
128 128
 $sLimit = '';
129 129
 if (isset($_GET['start']) === true && $_GET['length'] != '-1') {
130
-    $sLimit = 'LIMIT ' . filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT) . ', ' . filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT) . '';
130
+    $sLimit = 'LIMIT '.filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT).', '.filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT).'';
131 131
 }
132 132
 
133 133
 //Ordering
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
     } else {
141 141
         $sOrder = 'ORDER BY  ';
142 142
         if ($_GET['order'][0]['column'] >= 0) {
143
-            $sOrder .= '' . $aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)] . ' '
144
-                . filter_var($_GET['order'][0]['dir'], FILTER_SANITIZE_STRING) . ', ';
143
+            $sOrder .= ''.$aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)].' '
144
+                . filter_var($_GET['order'][0]['dir'], FILTER_SANITIZE_STRING).', ';
145 145
         }
146 146
 
147 147
         $sOrder = substr_replace($sOrder, '', -2);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         }
151 151
     }
152 152
 } else {
153
-    $sOrder = 'ORDER BY ' . $aColumns[1] . ' ASC';
153
+    $sOrder = 'ORDER BY '.$aColumns[1].' ASC';
154 154
 }
155 155
 
156 156
 // Define criteria
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
 if (empty($search_criteria) === false) {
173 173
     $sWhere .= ' AND (';
174 174
     for ($i = 0; $i < count($aColumns); ++$i) {
175
-        $sWhere .= $aColumns[$i] . ' LIKE %ss_' . $i . ' OR ';
175
+        $sWhere .= $aColumns[$i].' LIKE %ss_'.$i.' OR ';
176 176
     }
177
-    $sWhere = substr_replace((string) $sWhere, '', -3) . ') ';
177
+    $sWhere = substr_replace((string) $sWhere, '', -3).') ';
178 178
 
179 179
     $crit = array(
180 180
         'idtree' => array_unique($folders),
@@ -213,13 +213,13 @@  discard block
 block discarded – undo
213 213
     if (empty($sWhere) === false) {
214 214
         $sWhere .= ' AND ';
215 215
     }
216
-    $sWhere = 'WHERE ' . $sWhere . 'id_tree NOT IN %ls_pf ';
216
+    $sWhere = 'WHERE '.$sWhere.'id_tree NOT IN %ls_pf ';
217 217
 } else {
218
-    $sWhere = 'WHERE ' . $sWhere;
218
+    $sWhere = 'WHERE '.$sWhere;
219 219
 }
220 220
 
221 221
 DB::query(
222
-    'SELECT id FROM ' . prefixTable('cache') . "
222
+    'SELECT id FROM '.prefixTable('cache')."
223 223
     $sWhere
224 224
     $sOrder",
225 225
     $crit
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
 $rows = DB::query(
230 230
     'SELECT id, label, description, tags, id_tree, perso, restricted_to, login, folder, author, renewal_period, url, timestamp
231
-    FROM ' . prefixTable('cache') . "
231
+    FROM ' . prefixTable('cache')."
232 232
     $sWhere
233 233
     $sOrder
234 234
     $sLimit",
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 if (isset($_GET['type']) === false) {
244 244
     $sOutput = '{';
245 245
     if (isset($_GET['draw']) === true) {
246
-        $sOutput .= '"draw": ' . intval($_GET['draw']) . ', ';
246
+        $sOutput .= '"draw": '.intval($_GET['draw']).', ';
247 247
     }
248 248
     $sOutput .= '"data": [';
249 249
     $sOutputConst = '';
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 
263 263
             foreach (explode(';', $_SESSION['fonction_id']) as $role) {
264 264
                 $access = DB::queryFirstRow(
265
-                    'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
265
+                    'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
266 266
                     $role,
267 267
                     $record['id_tree']
268 268
                 );
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
             }
281 281
             $accessLevel = count($arrTmp) > 0 ? min($arrTmp) : $accessLevel;
282 282
             if ($accessLevel === 0) {
283
-                $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"' . $record['id'] . '\">';
283
+                $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"'.$record['id'].'\">';
284 284
             }
285 285
 
286 286
             if ((int) $accessLevel === 0) {
@@ -320,25 +320,25 @@  discard block
 block discarded – undo
320 320
             if (empty($restrictedTo)) {
321 321
                 $restrictedTo = $_SESSION['user_id'];
322 322
             } else {
323
-                $restrictedTo .= ',' . $_SESSION['user_id'];
323
+                $restrictedTo .= ','.$_SESSION['user_id'];
324 324
             }
325 325
         }
326 326
 
327 327
         //col1
328
-        $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"' . langHdl('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>' .
329
-            '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"' . langHdl('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 . '", ';
328
+        $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"'.langHdl('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>'.
329
+            '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"'.langHdl('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.'", ';
330 330
 
331 331
         //col2
332
-        $sOutputItem .= '"<span id=\"item_label-' . $record['id'] . '\">' . stripslashes($record['label']) . '</span>", ';
332
+        $sOutputItem .= '"<span id=\"item_label-'.$record['id'].'\">'.stripslashes($record['label']).'</span>", ';
333 333
 
334 334
         //col3
335
-        $sOutputItem .= '"' . str_replace('&amp;', '&', htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)) . '", ';
335
+        $sOutputItem .= '"'.str_replace('&amp;', '&', htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)).'", ';
336 336
 
337 337
         //col4
338 338
         //get restriction from ROles
339 339
         $restrictedToRole = false;
340 340
         $rTmp = DB::queryFirstColumn(
341
-            'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i',
341
+            'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i',
342 342
             $record['id']
343 343
         );
344 344
         // We considere here that if user has at least one group similar to the object ones
@@ -356,14 +356,14 @@  discard block
 block discarded – undo
356 356
         } else {
357 357
             $txt = str_replace(array('\n', '<br />', '\\'), array(' ', ' ', '', ' '), strip_tags($record['description']));
358 358
             if (strlen($txt) > 50) {
359
-                $sOutputItem .= '"' . substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50) . '", ';
359
+                $sOutputItem .= '"'.substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50).'", ';
360 360
             } else {
361
-                $sOutputItem .= '"' . stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)) . '", ';
361
+                $sOutputItem .= '"'.stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)).'", ';
362 362
             }
363 363
         }
364 364
 
365 365
         //col5 - TAGS
366
-        $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES) . '", ';
366
+        $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES).'", ';
367 367
 
368 368
         // col6 - URL
369 369
         if ($record['url'] != '0') {
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
         }
374 374
 
375 375
         //col7 - Prepare the Treegrid
376
-        $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES) . '"';
376
+        $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES).'"';
377 377
 
378 378
         //Finish the line
379 379
         $sOutputItem .= '], ';
@@ -390,13 +390,13 @@  discard block
 block discarded – undo
390 390
     }
391 391
     $sOutput .= '], ';
392 392
 
393
-    $sOutput .= '"recordsTotal": ' . $iTotal . ', ';
394
-    $sOutput .= '"recordsFiltered": ' . $iTotal . ' }';
393
+    $sOutput .= '"recordsTotal": '.$iTotal.', ';
394
+    $sOutput .= '"recordsFiltered": '.$iTotal.' }';
395 395
 
396 396
     echo $sOutput;
397 397
 } elseif (isset($_GET['type']) && ($_GET['type'] == 'search_for_items' || $_GET['type'] == 'search_for_items_with_tags')) {
398 398
     include_once 'main.functions.php';
399
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
399
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
400 400
     $sOutput = '';
401 401
     $init_personal_folder = false;
402 402
     $arr_data = [];
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 
421 421
         // Anyone can modify?
422 422
         $tmp = DB::queryfirstrow(
423
-            'SELECT anyone_can_modify FROM ' . prefixTable('items') . ' WHERE id = %i',
423
+            'SELECT anyone_can_modify FROM '.prefixTable('items').' WHERE id = %i',
424 424
             $record['id']
425 425
         );
426 426
         if (count($tmp) > 0) {
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
         // => récupérer un tableau contenant les roles associés à cet ID (a partir table restriction_to_roles)
454 454
         $user_is_included_in_role = 0;
455 455
         $roles = DB::query(
456
-            'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id=%i',
456
+            'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id=%i',
457 457
             $record['id']
458 458
         );
459 459
         if (count($roles) > 0) {
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
             if (empty($restrictedTo)) {
477 477
                 $restrictedTo = $_SESSION['user_id'];
478 478
             } else {
479
-                $restrictedTo .= ',' . $_SESSION['user_id'];
479
+                $restrictedTo .= ','.$_SESSION['user_id'];
480 480
             }
481 481
         }
482 482
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         // Get log for this item
486 486
         $logs = DB::query(
487 487
             'SELECT *
488
-            FROM ' . prefixTable('log_items') . '
488
+            FROM ' . prefixTable('log_items').'
489 489
             WHERE id_item = %i AND action = %s AND id_user = %i',
490 490
             $record['id'],
491 491
             'at_creation',
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 
596 596
             foreach (explode(';', $_SESSION['fonction_id']) as $role) {
597 597
                 $access = DB::queryFirstRow(
598
-                    'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
598
+                    'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
599 599
                     $role,
600 600
                     $record['id_tree']
601 601
                 );
@@ -645,8 +645,8 @@  discard block
 block discarded – undo
645 645
         ) {
646 646
             $data_item = DB::queryFirstRow(
647 647
                 'SELECT i.pw AS pw, s.share_key AS share_key
648
-                FROM ' . prefixTable('items') . ' AS i
649
-                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
648
+                FROM ' . prefixTable('items').' AS i
649
+                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
650 650
                 WHERE i.id = %i AND s.user_id = %i',
651 651
                 $record['id'],
652 652
                 $_SESSION['user_id']
Please login to merge, or discard this patch.
sources/main.functions.php 1 patch
Spacing   +210 added lines, -210 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     $var_dk = ''; // Derived key
108 108
 
109 109
     for ($block = 1; $block <= $var_kb; ++$block) { // Create key
110
-        $var_ib = $var_h = hash_hmac($var_a, $var_s . pack('N', $block), $var_p, true); // Initial hash for this block
110
+        $var_ib = $var_h = hash_hmac($var_a, $var_s.pack('N', $block), $var_p, true); // Initial hash for this block
111 111
         for ($var_i = 1; $var_i < $var_c; ++$var_i) { // Perform block iterations
112 112
             $var_ib ^= ($var_h = hash_hmac($var_a, $var_h, $var_p, true)); // XOR each iterate
113 113
         }
@@ -341,25 +341,25 @@  discard block
 block discarded – undo
341 341
  */
342 342
 function cryption($message, $ascii_key, $type, $SETTINGS)
343 343
 {
344
-    $ascii_key = (empty($ascii_key) === true) ? file_get_contents(SECUREPATH . '/teampass-seckey.txt') : $ascii_key;
344
+    $ascii_key = (empty($ascii_key) === true) ? file_get_contents(SECUREPATH.'/teampass-seckey.txt') : $ascii_key;
345 345
     $err = false;
346 346
 
347 347
     // load PhpEncryption library
348 348
     if (isset($SETTINGS['cpassman_dir']) === false || empty($SETTINGS['cpassman_dir']) === true) {
349 349
         $path = '../includes/libraries/Encryption/Encryption/';
350 350
     } else {
351
-        $path = $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/';
351
+        $path = $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/';
352 352
     }
353 353
 
354
-    include_once $path . 'Crypto.php';
355
-    include_once $path . 'Encoding.php';
356
-    include_once $path . 'DerivedKeys.php';
357
-    include_once $path . 'Key.php';
358
-    include_once $path . 'KeyOrPassword.php';
359
-    include_once $path . 'File.php';
360
-    include_once $path . 'RuntimeTests.php';
361
-    include_once $path . 'KeyProtectedByPassword.php';
362
-    include_once $path . 'Core.php';
354
+    include_once $path.'Crypto.php';
355
+    include_once $path.'Encoding.php';
356
+    include_once $path.'DerivedKeys.php';
357
+    include_once $path.'Key.php';
358
+    include_once $path.'KeyOrPassword.php';
359
+    include_once $path.'File.php';
360
+    include_once $path.'RuntimeTests.php';
361
+    include_once $path.'KeyProtectedByPassword.php';
362
+    include_once $path.'Core.php';
363 363
 
364 364
     // convert KEY
365 365
     $key = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
@@ -405,15 +405,15 @@  discard block
 block discarded – undo
405 405
         $path = '../includes/libraries/Encryption/Encryption/';
406 406
     }
407 407
 
408
-    include_once $path . 'Crypto.php';
409
-    include_once $path . 'Encoding.php';
410
-    include_once $path . 'DerivedKeys.php';
411
-    include_once $path . 'Key.php';
412
-    include_once $path . 'KeyOrPassword.php';
413
-    include_once $path . 'File.php';
414
-    include_once $path . 'RuntimeTests.php';
415
-    include_once $path . 'KeyProtectedByPassword.php';
416
-    include_once $path . 'Core.php';
408
+    include_once $path.'Crypto.php';
409
+    include_once $path.'Encoding.php';
410
+    include_once $path.'DerivedKeys.php';
411
+    include_once $path.'Key.php';
412
+    include_once $path.'KeyOrPassword.php';
413
+    include_once $path.'File.php';
414
+    include_once $path.'RuntimeTests.php';
415
+    include_once $path.'KeyProtectedByPassword.php';
416
+    include_once $path.'Core.php';
417 417
 
418 418
     $key = \Defuse\Crypto\Key::createNewRandomKey();
419 419
     $key = $key->saveToAsciiSafeString();
@@ -439,15 +439,15 @@  discard block
 block discarded – undo
439 439
         $path = '../includes/libraries/Encryption/Encryption/';
440 440
     }
441 441
 
442
-    include_once $path . 'Crypto.php';
443
-    include_once $path . 'Encoding.php';
444
-    include_once $path . 'DerivedKeys.php';
445
-    include_once $path . 'Key.php';
446
-    include_once $path . 'KeyOrPassword.php';
447
-    include_once $path . 'File.php';
448
-    include_once $path . 'RuntimeTests.php';
449
-    include_once $path . 'KeyProtectedByPassword.php';
450
-    include_once $path . 'Core.php';
442
+    include_once $path.'Crypto.php';
443
+    include_once $path.'Encoding.php';
444
+    include_once $path.'DerivedKeys.php';
445
+    include_once $path.'Key.php';
446
+    include_once $path.'KeyOrPassword.php';
447
+    include_once $path.'File.php';
448
+    include_once $path.'RuntimeTests.php';
449
+    include_once $path.'KeyProtectedByPassword.php';
450
+    include_once $path.'Core.php';
451 451
 
452 452
     $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk);
453 453
     $protected_key_encoded = $protected_key->saveToAsciiSafeString();
@@ -474,15 +474,15 @@  discard block
 block discarded – undo
474 474
         $path = '../includes/libraries/Encryption/Encryption/';
475 475
     }
476 476
 
477
-    include_once $path . 'Crypto.php';
478
-    include_once $path . 'Encoding.php';
479
-    include_once $path . 'DerivedKeys.php';
480
-    include_once $path . 'Key.php';
481
-    include_once $path . 'KeyOrPassword.php';
482
-    include_once $path . 'File.php';
483
-    include_once $path . 'RuntimeTests.php';
484
-    include_once $path . 'KeyProtectedByPassword.php';
485
-    include_once $path . 'Core.php';
477
+    include_once $path.'Crypto.php';
478
+    include_once $path.'Encoding.php';
479
+    include_once $path.'DerivedKeys.php';
480
+    include_once $path.'Key.php';
481
+    include_once $path.'KeyOrPassword.php';
482
+    include_once $path.'File.php';
483
+    include_once $path.'RuntimeTests.php';
484
+    include_once $path.'KeyProtectedByPassword.php';
485
+    include_once $path.'Core.php';
486 486
 
487 487
     try {
488 488
         $protected_key = \Defuse\Crypto\KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded);
@@ -569,8 +569,8 @@  discard block
 block discarded – undo
569 569
  */
570 570
 function db_error_handler($params)
571 571
 {
572
-    echo 'Error: ' . $params['error'] . "<br>\n";
573
-    echo 'Query: ' . $params['query'] . "<br>\n";
572
+    echo 'Error: '.$params['error']."<br>\n";
573
+    echo 'Query: '.$params['query']."<br>\n";
574 574
     throw new Exception('Error - Query', 1);
575 575
 }
576 576
 
@@ -592,14 +592,14 @@  discard block
 block discarded – undo
592 592
     $SETTINGS
593 593
 ) {
594 594
     //load ClassLoader
595
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
595
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
596 596
 
597 597
     // Load superglobal
598
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
598
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
599 599
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
600 600
 
601 601
     //Connect to DB
602
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
602
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
603 603
     if (defined('DB_PASSWD_CLEAR') === false) {
604 604
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
605 605
     }
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
     DB::$encoding = DB_ENCODING;
612 612
 
613 613
     //Build tree
614
-    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
614
+    $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
615 615
     $tree->register();
616 616
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
617 617
 
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 function identAdmin($idFonctions, $SETTINGS, $tree)
654 654
 {
655 655
     // Load superglobal
656
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
656
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
657 657
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
658 658
 
659 659
     // Init
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
     $globalsPersonalVisibleFolders = $superGlobal->get('personal_visible_groups', 'SESSION');
676 676
 
677 677
     // Get list of Folders
678
-    $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0);
678
+    $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0);
679 679
     foreach ($rows as $record) {
680 680
         array_push($groupesVisibles, $record['id']);
681 681
     }
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
     }
695 695
     // Get ID of personal folder
696 696
     $persfld = DB::queryfirstrow(
697
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s',
697
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s',
698 698
         $globalsUserId
699 699
     );
700 700
     if (empty($persfld['id']) === false) {
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
     // get complete list of ROLES
716 716
     $tmp = explode(';', $idFonctions);
717 717
     $rows = DB::query(
718
-        'SELECT * FROM ' . prefixTable('roles_title') . '
718
+        'SELECT * FROM '.prefixTable('roles_title').'
719 719
         ORDER BY title ASC'
720 720
     );
721 721
     foreach ($rows as $record) {
@@ -727,9 +727,9 @@  discard block
 block discarded – undo
727 727
     $superGlobal->put('is_admin', 1, 'SESSION');
728 728
 
729 729
     // Check if admin has created Folders and Roles
730
-    DB::query('SELECT * FROM ' . prefixTable('nested_tree') . '');
730
+    DB::query('SELECT * FROM '.prefixTable('nested_tree').'');
731 731
     $superGlobal->put('nb_folders', DB::count(), 'SESSION');
732
-    DB::query('SELECT * FROM ' . prefixTable('roles_title'));
732
+    DB::query('SELECT * FROM '.prefixTable('roles_title'));
733 733
     $superGlobal->put('nb_roles', DB::count(), 'SESSION');
734 734
 }
735 735
 
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
     $tree
774 774
 ) {
775 775
     // Load superglobal
776
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
776
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
777 777
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
778 778
 
779 779
     // Init
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
     // Get list of folders depending on Roles
807 807
     $rows = DB::query(
808 808
         'SELECT *
809
-        FROM ' . prefixTable('roles_values') . '
809
+        FROM ' . prefixTable('roles_values').'
810 810
         WHERE role_id IN %li AND type IN %ls',
811 811
         $userRoles,
812 812
         array('W', 'ND', 'NE', 'NDNE', 'R')
@@ -831,9 +831,9 @@  discard block
 block discarded – undo
831 831
     // Does this user is allowed to see other items
832 832
     $inc = 0;
833 833
     $rows = DB::query(
834
-        'SELECT id, id_tree FROM ' . prefixTable('items') . '
834
+        'SELECT id, id_tree FROM '.prefixTable('items').'
835 835
         WHERE restricted_to LIKE %ss AND inactif = %s',
836
-        $globalsUserId . ';',
836
+        $globalsUserId.';',
837 837
         '0'
838 838
     );
839 839
     foreach ($rows as $record) {
@@ -847,8 +847,8 @@  discard block
 block discarded – undo
847 847
     // Check for the users roles if some specific rights exist on items
848 848
     $rows = DB::query(
849 849
         'SELECT i.id_tree, r.item_id
850
-        FROM ' . prefixTable('items') . ' as i
851
-        INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id)
850
+        FROM ' . prefixTable('items').' as i
851
+        INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id)
852 852
         WHERE r.role_id IN %li
853 853
         ORDER BY i.id_tree ASC',
854 854
         $userRoles
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
     ) {
870 870
         $persoFld = DB::queryfirstrow(
871 871
             'SELECT id
872
-            FROM ' . prefixTable('nested_tree') . '
872
+            FROM ' . prefixTable('nested_tree').'
873 873
             WHERE title = %s AND personal_folder = %i',
874 874
             $globalsUserId,
875 875
             1
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
     }
904 904
     $persoFlds = DB::query(
905 905
         'SELECT id
906
-        FROM ' . prefixTable('nested_tree') . '
906
+        FROM ' . prefixTable('nested_tree').'
907 907
         WHERE %l',
908 908
         $where
909 909
     );
@@ -946,17 +946,17 @@  discard block
 block discarded – undo
946 946
     );
947 947
 
948 948
     // Folders and Roles numbers
949
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . '');
949
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').'');
950 950
     $superGlobal->put('nb_folders', DB::count(), 'SESSION');
951
-    DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title'));
951
+    DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title'));
952 952
     $superGlobal->put('nb_roles', DB::count(), 'SESSION');
953 953
 
954 954
     // check if change proposals on User's items
955 955
     if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) {
956 956
         DB::query(
957 957
             'SELECT *
958
-            FROM ' . prefixTable('items_change') . ' AS c
959
-            LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item)
958
+            FROM ' . prefixTable('items_change').' AS c
959
+            LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item)
960 960
             WHERE i.action = %s AND i.id_user = %i',
961 961
             'at_creation',
962 962
             $globalsUserId
@@ -1000,10 +1000,10 @@  discard block
 block discarded – undo
1000 1000
  */
1001 1001
 function cacheTableRefresh($SETTINGS)
1002 1002
 {
1003
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1003
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1004 1004
 
1005 1005
     //Connect to DB
1006
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1006
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1007 1007
     if (defined('DB_PASSWD_CLEAR') === false) {
1008 1008
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1009 1009
     }
@@ -1020,13 +1020,13 @@  discard block
 block discarded – undo
1020 1020
     $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1021 1021
 
1022 1022
     // truncate table
1023
-    DB::query('TRUNCATE TABLE ' . prefixTable('cache'));
1023
+    DB::query('TRUNCATE TABLE '.prefixTable('cache'));
1024 1024
 
1025 1025
     // reload date
1026 1026
     $rows = DB::query(
1027 1027
         'SELECT *
1028
-        FROM ' . prefixTable('items') . ' as i
1029
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
1028
+        FROM ' . prefixTable('items').' as i
1029
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
1030 1030
         AND l.action = %s
1031 1031
         AND i.inactif = %i',
1032 1032
         'at_creation',
@@ -1038,18 +1038,18 @@  discard block
 block discarded – undo
1038 1038
             $tags = '';
1039 1039
             $itemTags = DB::query(
1040 1040
                 'SELECT tag
1041
-                FROM ' . prefixTable('tags') . '
1041
+                FROM ' . prefixTable('tags').'
1042 1042
                 WHERE item_id = %i AND tag != ""',
1043 1043
                 $record['id']
1044 1044
             );
1045 1045
             foreach ($itemTags as $itemTag) {
1046
-                $tags .= $itemTag['tag'] . ' ';
1046
+                $tags .= $itemTag['tag'].' ';
1047 1047
             }
1048 1048
 
1049 1049
             // Get renewal period
1050 1050
             $resNT = DB::queryfirstrow(
1051 1051
                 'SELECT renewal_period
1052
-                FROM ' . prefixTable('nested_tree') . '
1052
+                FROM ' . prefixTable('nested_tree').'
1053 1053
                 WHERE id = %i',
1054 1054
                 $record['id_tree']
1055 1055
             );
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
                     // Is this a User id?
1064 1064
                     $user = DB::queryfirstrow(
1065 1065
                         'SELECT id, login
1066
-                        FROM ' . prefixTable('users') . '
1066
+                        FROM ' . prefixTable('users').'
1067 1067
                         WHERE id = %i',
1068 1068
                         $elem->title
1069 1069
                     );
@@ -1105,14 +1105,14 @@  discard block
 block discarded – undo
1105 1105
  */
1106 1106
 function cacheTableUpdate($SETTINGS, $ident = null)
1107 1107
 {
1108
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1108
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1109 1109
 
1110 1110
     // Load superglobal
1111
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1111
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1112 1112
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1113 1113
 
1114 1114
     //Connect to DB
1115
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1115
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1116 1116
     if (defined('DB_PASSWD_CLEAR') === false) {
1117 1117
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1118 1118
     }
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
     // get new value from db
1132 1132
     $data = DB::queryfirstrow(
1133 1133
         'SELECT label, description, id_tree, perso, restricted_to, login, url
1134
-        FROM ' . prefixTable('items') . '
1134
+        FROM ' . prefixTable('items').'
1135 1135
         WHERE id=%i',
1136 1136
         $ident
1137 1137
     );
@@ -1139,12 +1139,12 @@  discard block
 block discarded – undo
1139 1139
     $tags = '';
1140 1140
     $itemTags = DB::query(
1141 1141
         'SELECT tag
1142
-        FROM ' . prefixTable('tags') . '
1142
+        FROM ' . prefixTable('tags').'
1143 1143
         WHERE item_id = %i AND tag != ""',
1144 1144
         $ident
1145 1145
     );
1146 1146
     foreach ($itemTags as $itemTag) {
1147
-        $tags .= $itemTag['tag'] . ' ';
1147
+        $tags .= $itemTag['tag'].' ';
1148 1148
     }
1149 1149
     // form id_tree to full foldername
1150 1150
     $folder = array();
@@ -1155,7 +1155,7 @@  discard block
 block discarded – undo
1155 1155
             // Is this a User id?
1156 1156
             $user = DB::queryfirstrow(
1157 1157
                 'SELECT id, login
1158
-                FROM ' . prefixTable('users') . '
1158
+                FROM ' . prefixTable('users').'
1159 1159
                 WHERE id = %i',
1160 1160
                 $elem->title
1161 1161
             );
@@ -1194,17 +1194,17 @@  discard block
 block discarded – undo
1194 1194
  */
1195 1195
 function cacheTableAdd($SETTINGS, $ident = null)
1196 1196
 {
1197
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1197
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1198 1198
 
1199 1199
     // Load superglobal
1200
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1200
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1201 1201
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1202 1202
 
1203 1203
     // Get superglobals
1204 1204
     $globalsUserId = $superGlobal->get('user_id', 'SESSION');
1205 1205
 
1206 1206
     //Connect to DB
1207
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1207
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1208 1208
     if (defined('DB_PASSWD_CLEAR') === false) {
1209 1209
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1210 1210
     }
@@ -1223,8 +1223,8 @@  discard block
 block discarded – undo
1223 1223
     // get new value from db
1224 1224
     $data = DB::queryFirstRow(
1225 1225
         'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date
1226
-        FROM ' . prefixTable('items') . ' as i
1227
-        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
1226
+        FROM ' . prefixTable('items').' as i
1227
+        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
1228 1228
         WHERE i.id = %i
1229 1229
         AND l.action = %s',
1230 1230
         $ident,
@@ -1234,12 +1234,12 @@  discard block
 block discarded – undo
1234 1234
     $tags = '';
1235 1235
     $itemTags = DB::query(
1236 1236
         'SELECT tag
1237
-        FROM ' . prefixTable('tags') . '
1237
+        FROM ' . prefixTable('tags').'
1238 1238
         WHERE item_id = %i AND tag != ""',
1239 1239
         $ident
1240 1240
     );
1241 1241
     foreach ($itemTags as $itemTag) {
1242
-        $tags .= $itemTag['tag'] . ' ';
1242
+        $tags .= $itemTag['tag'].' ';
1243 1243
     }
1244 1244
     // form id_tree to full foldername
1245 1245
     $folder = array();
@@ -1250,7 +1250,7 @@  discard block
 block discarded – undo
1250 1250
             // Is this a User id?
1251 1251
             $user = DB::queryfirstrow(
1252 1252
                 'SELECT id, login
1253
-                FROM ' . prefixTable('users') . '
1253
+                FROM ' . prefixTable('users').'
1254 1254
                 WHERE id = %i',
1255 1255
                 $elem->title
1256 1256
             );
@@ -1291,48 +1291,48 @@  discard block
 block discarded – undo
1291 1291
 function getStatisticsData($SETTINGS)
1292 1292
 {
1293 1293
     DB::query(
1294
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1294
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1295 1295
         0
1296 1296
     );
1297 1297
     $counter_folders = DB::count();
1298 1298
 
1299 1299
     DB::query(
1300
-        'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
1300
+        'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
1301 1301
         1
1302 1302
     );
1303 1303
     $counter_folders_perso = DB::count();
1304 1304
 
1305 1305
     DB::query(
1306
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1306
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1307 1307
         0
1308 1308
     );
1309 1309
     $counter_items = DB::count();
1310 1310
 
1311 1311
     DB::query(
1312
-        'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i',
1312
+        'SELECT id FROM '.prefixTable('items').' WHERE perso = %i',
1313 1313
         1
1314 1314
     );
1315 1315
     $counter_items_perso = DB::count();
1316 1316
 
1317 1317
     DB::query(
1318
-        'SELECT id FROM ' . prefixTable('users') . ''
1318
+        'SELECT id FROM '.prefixTable('users').''
1319 1319
     );
1320 1320
     $counter_users = DB::count();
1321 1321
 
1322 1322
     DB::query(
1323
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i',
1323
+        'SELECT id FROM '.prefixTable('users').' WHERE admin = %i',
1324 1324
         1
1325 1325
     );
1326 1326
     $admins = DB::count();
1327 1327
 
1328 1328
     DB::query(
1329
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i',
1329
+        'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i',
1330 1330
         1
1331 1331
     );
1332 1332
     $managers = DB::count();
1333 1333
 
1334 1334
     DB::query(
1335
-        'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i',
1335
+        'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i',
1336 1336
         1
1337 1337
     );
1338 1338
     $readOnly = DB::count();
@@ -1340,11 +1340,11 @@  discard block
 block discarded – undo
1340 1340
     // list the languages
1341 1341
     $usedLang = [];
1342 1342
     $tp_languages = DB::query(
1343
-        'SELECT name FROM ' . prefixTable('languages')
1343
+        'SELECT name FROM '.prefixTable('languages')
1344 1344
     );
1345 1345
     foreach ($tp_languages as $tp_language) {
1346 1346
         DB::query(
1347
-            'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s',
1347
+            'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s',
1348 1348
             $tp_language['name']
1349 1349
         );
1350 1350
         $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0);
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
     // get list of ips
1354 1354
     $usedIp = [];
1355 1355
     $tp_ips = DB::query(
1356
-        'SELECT user_ip FROM ' . prefixTable('users')
1356
+        'SELECT user_ip FROM '.prefixTable('users')
1357 1357
     );
1358 1358
     foreach ($tp_ips as $ip) {
1359 1359
         if (array_key_exists($ip['user_ip'], $usedIp)) {
@@ -1415,21 +1415,21 @@  discard block
 block discarded – undo
1415 1415
 ) {
1416 1416
     // CAse where email not defined
1417 1417
     if ($email === 'none' || empty($email) === true) {
1418
-        return '"error":"" , "message":"' . langHdl('forgot_my_pw_email_sent') . '"';
1418
+        return '"error":"" , "message":"'.langHdl('forgot_my_pw_email_sent').'"';
1419 1419
     }
1420 1420
 
1421 1421
     // Load settings
1422
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1422
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1423 1423
 
1424 1424
     // Load superglobal
1425
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1425
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1426 1426
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1427 1427
 
1428 1428
     // Get user language
1429
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $superGlobal->get('user_language', 'SESSION') . '.php';
1429
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$superGlobal->get('user_language', 'SESSION').'.php';
1430 1430
 
1431 1431
     // Load library
1432
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1432
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1433 1433
 
1434 1434
     // load PHPMailer
1435 1435
     $mail = new SplClassLoader('PHPMailer\PHPMailer', '../includes/libraries');
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
     $mail = new PHPMailer\PHPMailer\PHPMailer(true);
1438 1438
     try {
1439 1439
         // send to user
1440
-        $mail->setLanguage('en', $SETTINGS['cpassman_dir'] . '/includes/libraries/PHPMailer/PHPMailer/language/');
1440
+        $mail->setLanguage('en', $SETTINGS['cpassman_dir'].'/includes/libraries/PHPMailer/PHPMailer/language/');
1441 1441
         $mail->SMTPDebug = 0; //value 1 can be used to debug - 4 for debuging connections
1442 1442
         $mail->Port = $SETTINGS['email_port']; //COULD BE USED
1443 1443
         $mail->CharSet = 'utf-8';
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
         <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" bgcolor="#ffffff" style="border-spacing: 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 0 3px #ddd; color: #434343; font-family: Helvetica, Verdana, sans-serif;">
1524 1524
         <tr><td class="container-padding" bgcolor="#ffffff" style="border-collapse: collapse; border-left: 1px solid #e0e0e0; background-color: #ffffff; padding-left: 30px; padding-right: 30px;">
1525 1525
         <br><div style="float:right;">' .
1526
-        $textMail .
1526
+        $textMail.
1527 1527
         '<br><br></td></tr></table>
1528 1528
     </td></tr></table>
1529 1529
     <br></body></html>';
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
  */
1537 1537
 function generateKey()
1538 1538
 {
1539
-    return substr(md5(rand() . rand()), 0, 15);
1539
+    return substr(md5(rand().rand()), 0, 15);
1540 1540
 }
1541 1541
 
1542 1542
 /**
@@ -1606,7 +1606,7 @@  discard block
 block discarded – undo
1606 1606
 {
1607 1607
     array_walk_recursive(
1608 1608
         $array,
1609
-        function (&$item) {
1609
+        function(&$item) {
1610 1610
             if (mb_detect_encoding($item, 'utf-8', true) === false) {
1611 1611
                 $item = utf8_encode($item);
1612 1612
             }
@@ -1642,7 +1642,7 @@  discard block
 block discarded – undo
1642 1642
     }
1643 1643
 
1644 1644
     // Load superglobal
1645
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1645
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1646 1646
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1647 1647
 
1648 1648
     // Get superglobals
@@ -1654,9 +1654,9 @@  discard block
 block discarded – undo
1654 1654
     }
1655 1655
 
1656 1656
     //load ClassLoader
1657
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1657
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1658 1658
     //Load AES
1659
-    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1659
+    $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'].'/includes/libraries');
1660 1660
     $aes->register();
1661 1661
 
1662 1662
     if ($type === 'encode' && is_array($data) === true) {
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
 function makeThumbnail($src, $dest, $desired_width)
1712 1712
 {
1713 1713
     /* read the source image */
1714
-    if(is_file($src) === true && mime_content_type($src) === 'image/png'){
1714
+    if (is_file($src) === true && mime_content_type($src) === 'image/png') {
1715 1715
         $source_image = imagecreatefrompng($src);
1716 1716
         if ($source_image === false) {
1717 1717
             return "Error: Not a valid PNG file! It's type is ".mime_content_type($src);
@@ -1748,7 +1748,7 @@  discard block
 block discarded – undo
1748 1748
  */
1749 1749
 function prefixTable($table)
1750 1750
 {
1751
-    $safeTable = htmlspecialchars(DB_PREFIX . $table);
1751
+    $safeTable = htmlspecialchars(DB_PREFIX.$table);
1752 1752
     if (!empty($safeTable)) {
1753 1753
         // sanitize string
1754 1754
         return $safeTable;
@@ -1780,14 +1780,14 @@  discard block
 block discarded – undo
1780 1780
     $lowercase = false,
1781 1781
     $SETTINGS
1782 1782
 ) {
1783
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1784
-    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1783
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1784
+    $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1785 1785
     $generator->register();
1786 1786
     $generator = new PasswordGenerator\Generator\ComputerPasswordGenerator();
1787 1787
 
1788 1788
     // Is PHP7 being used?
1789 1789
     if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
1790
-        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1790
+        $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'].'/includes/libraries');
1791 1791
         $php7generator->register();
1792 1792
         $generator->setRandomGenerator(new PasswordGenerator\RandomGenerator\Php7RandomGenerator());
1793 1793
     }
@@ -1818,7 +1818,7 @@  discard block
 block discarded – undo
1818 1818
 function send_syslog($message, $host, $port, $component = 'teampass')
1819 1819
 {
1820 1820
     $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
1821
-    $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message;
1821
+    $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message;
1822 1822
     socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port);
1823 1823
     socket_close($sock);
1824 1824
 }
@@ -1842,7 +1842,7 @@  discard block
 block discarded – undo
1842 1842
     }
1843 1843
 
1844 1844
     // include librairies & connect to DB
1845
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1845
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1846 1846
     if (defined('DB_PASSWD_CLEAR') === false) {
1847 1847
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1848 1848
     }
@@ -1868,14 +1868,14 @@  discard block
 block discarded – undo
1868 1868
     if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) {
1869 1869
         if ($type === 'user_mngt') {
1870 1870
             send_syslog(
1871
-                'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ',
1871
+                'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ',
1872 1872
                 $SETTINGS['syslog_host'],
1873 1873
                 $SETTINGS['syslog_port'],
1874 1874
                 'teampass'
1875 1875
             );
1876 1876
         } else {
1877 1877
             send_syslog(
1878
-                'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ',
1878
+                'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ',
1879 1879
                 $SETTINGS['syslog_host'],
1880 1880
                 $SETTINGS['syslog_port'],
1881 1881
                 'teampass'
@@ -1907,7 +1907,7 @@  discard block
 block discarded – undo
1907 1907
     $encryption_type = null
1908 1908
 ) {
1909 1909
     // include librairies & connect to DB
1910
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
1910
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
1911 1911
     if (defined('DB_PASSWD_CLEAR') === false) {
1912 1912
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
1913 1913
     }
@@ -1953,7 +1953,7 @@  discard block
 block discarded – undo
1953 1953
         if (empty($item_label) === true) {
1954 1954
             $dataItem = DB::queryfirstrow(
1955 1955
                 'SELECT id, id_tree, label
1956
-                FROM ' . prefixTable('items') . '
1956
+                FROM ' . prefixTable('items').'
1957 1957
                 WHERE id = %i',
1958 1958
                 $item_id
1959 1959
             );
@@ -1962,11 +1962,11 @@  discard block
 block discarded – undo
1962 1962
         }
1963 1963
 
1964 1964
         send_syslog(
1965
-            'action=' . str_replace('at_', '', $action) .
1966
-                ' attribute=' . str_replace('at_', '', $attribute[0]) .
1967
-                ' itemno=' . $item_id .
1968
-                ' user=' . isnull($login) === true ? '' : addslashes($login) .
1969
-                ' itemname="' . addslashes($item_label) . '"',
1965
+            'action='.str_replace('at_', '', $action).
1966
+                ' attribute='.str_replace('at_', '', $attribute[0]).
1967
+                ' itemno='.$item_id.
1968
+                ' user='.isnull($login) === true ? '' : addslashes($login).
1969
+                ' itemname="'.addslashes($item_label).'"',
1970 1970
             $SETTINGS['syslog_host'],
1971 1971
             $SETTINGS['syslog_port'],
1972 1972
             'teampass'
@@ -1992,7 +1992,7 @@  discard block
 block discarded – undo
1992 1992
         && $action === 'at_shown'
1993 1993
     ) {
1994 1994
         // Load superglobal
1995
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1995
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1996 1996
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1997 1997
 
1998 1998
         // Get superglobals
@@ -2003,7 +2003,7 @@  discard block
 block discarded – undo
2003 2003
         // Get info about item
2004 2004
         $dataItem = DB::queryfirstrow(
2005 2005
             'SELECT id, id_tree, label
2006
-            FROM ' . prefixTable('items') . '
2006
+            FROM ' . prefixTable('items').'
2007 2007
             WHERE id = %i',
2008 2008
             $item_id
2009 2009
         );
@@ -2018,9 +2018,9 @@  discard block
 block discarded – undo
2018 2018
                 'body' => str_replace(
2019 2019
                     array('#tp_user#', '#tp_item#', '#tp_link#'),
2020 2020
                     array(
2021
-                        addslashes($globalsName . ' ' . $globalsLastname),
2021
+                        addslashes($globalsName.' '.$globalsLastname),
2022 2022
                         addslashes($item_label),
2023
-                        $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $item_id,
2023
+                        $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$item_id,
2024 2024
                     ),
2025 2025
                     langHdl('email_on_open_notification_mail')
2026 2026
                 ),
@@ -2042,7 +2042,7 @@  discard block
 block discarded – undo
2042 2042
 function notifyChangesToSubscribers($item_id, $label, $changes, $SETTINGS)
2043 2043
 {
2044 2044
     // Load superglobal
2045
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2045
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2046 2046
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2047 2047
 
2048 2048
     // Get superglobals
@@ -2054,8 +2054,8 @@  discard block
 block discarded – undo
2054 2054
     $notification = DB::queryOneColumn(
2055 2055
         'email',
2056 2056
         'SELECT *
2057
-        FROM ' . prefixTable('notification') . ' AS n
2058
-        INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id)
2057
+        FROM ' . prefixTable('notification').' AS n
2058
+        INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id)
2059 2059
         WHERE n.item_id = %i AND n.user_id != %i',
2060 2060
         $item_id,
2061 2061
         $globalsUserId
@@ -2068,7 +2068,7 @@  discard block
 block discarded – undo
2068 2068
         // Get list of changes
2069 2069
         $htmlChanges = '<ul>';
2070 2070
         foreach ($changes as $change) {
2071
-            $htmlChanges .= '<li>' . $change . '</li>';
2071
+            $htmlChanges .= '<li>'.$change.'</li>';
2072 2072
         }
2073 2073
         $htmlChanges .= '</ul>';
2074 2074
 
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
 function geItemReadablePath($id_tree, $label, $SETTINGS)
2103 2103
 {
2104 2104
     // Class loader
2105
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
2105
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
2106 2106
 
2107 2107
     //Load Tree
2108 2108
     $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries');
@@ -2113,15 +2113,15 @@  discard block
 block discarded – undo
2113 2113
     $path = '';
2114 2114
     foreach ($arbo as $elem) {
2115 2115
         if (empty($path) === true) {
2116
-            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
2116
+            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
2117 2117
         } else {
2118
-            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
2118
+            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
2119 2119
         }
2120 2120
     }
2121 2121
 
2122 2122
     // Build text to show user
2123 2123
     if (empty($label) === false) {
2124
-        return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')';
2124
+        return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')';
2125 2125
     } else {
2126 2126
         return empty($path) === true ? '' : $path;
2127 2127
     }
@@ -2180,10 +2180,10 @@  discard block
 block discarded – undo
2180 2180
  */
2181 2181
 function handleConfigFile($action, $SETTINGS, $field = null, $value = null)
2182 2182
 {
2183
-    $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php';
2183
+    $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php';
2184 2184
 
2185 2185
     // include librairies & connect to DB
2186
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2186
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2187 2187
     if (defined('DB_PASSWD_CLEAR') === false) {
2188 2188
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2189 2189
     }
@@ -2197,8 +2197,8 @@  discard block
 block discarded – undo
2197 2197
     if (file_exists($tp_config_file) === false || $action === 'rebuild') {
2198 2198
         // perform a copy
2199 2199
         if (file_exists($tp_config_file)) {
2200
-            if (!copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) {
2201
-                return "ERROR: Could not copy file '" . $tp_config_file . "'";
2200
+            if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) {
2201
+                return "ERROR: Could not copy file '".$tp_config_file."'";
2202 2202
             }
2203 2203
         }
2204 2204
 
@@ -2209,11 +2209,11 @@  discard block
 block discarded – undo
2209 2209
         $data[1] = "global \$SETTINGS;\n";
2210 2210
         $data[2] = "\$SETTINGS = array (\n";
2211 2211
         $rows = DB::query(
2212
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s',
2212
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s',
2213 2213
             'admin'
2214 2214
         );
2215 2215
         foreach ($rows as $record) {
2216
-            array_push($data, "    '" . $record['intitule'] . "' => '" . $record['valeur'] . "',\n");
2216
+            array_push($data, "    '".$record['intitule']."' => '".$record['valeur']."',\n");
2217 2217
         }
2218 2218
         array_push($data, ");\n");
2219 2219
         $data = array_unique($data);
@@ -2227,15 +2227,15 @@  discard block
 block discarded – undo
2227 2227
                 break;
2228 2228
             }
2229 2229
 
2230
-            if (stristr($line, "'" . $field . "' => '")) {
2231
-                $data[$inc] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n";
2230
+            if (stristr($line, "'".$field."' => '")) {
2231
+                $data[$inc] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n";
2232 2232
                 $bFound = true;
2233 2233
                 break;
2234 2234
             }
2235 2235
             ++$inc;
2236 2236
         }
2237 2237
         if ($bFound === false) {
2238
-            $data[($inc)] = "    '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n);\n";
2238
+            $data[($inc)] = "    '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n);\n";
2239 2239
         }
2240 2240
     }
2241 2241
 
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
         $settings = array();
2274 2274
 
2275 2275
         $rows = DB::query(
2276
-            'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2',
2276
+            'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2',
2277 2277
             array(
2278 2278
                 'type' => 'admin',
2279 2279
                 'type2' => 'settings',
@@ -2300,7 +2300,7 @@  discard block
 block discarded – undo
2300 2300
     $source_cf = array();
2301 2301
     $rows = DB::QUERY(
2302 2302
         'SELECT id_category
2303
-        FROM ' . prefixTable('categories_folders') . '
2303
+        FROM ' . prefixTable('categories_folders').'
2304 2304
         WHERE id_folder = %i',
2305 2305
         $source_id
2306 2306
     );
@@ -2311,7 +2311,7 @@  discard block
 block discarded – undo
2311 2311
     $target_cf = array();
2312 2312
     $rows = DB::QUERY(
2313 2313
         'SELECT id_category
2314
-        FROM ' . prefixTable('categories_folders') . '
2314
+        FROM ' . prefixTable('categories_folders').'
2315 2315
         WHERE id_folder = %i',
2316 2316
         $target_id
2317 2317
     );
@@ -2346,9 +2346,9 @@  discard block
 block discarded – undo
2346 2346
     $password = null
2347 2347
 ) {
2348 2348
     // Load AntiXSS
2349
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2350
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2351
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2349
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2350
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2351
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2352 2352
     $antiXss = new voku\helper\AntiXSS();
2353 2353
 
2354 2354
     // Protect against bad inputs
@@ -2362,7 +2362,7 @@  discard block
 block discarded – undo
2362 2362
 
2363 2363
     if (empty($password) === true || is_null($password) === true) {
2364 2364
         // get KEY to define password
2365
-        $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt');
2365
+        $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt');
2366 2366
         $password = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key);
2367 2367
     }
2368 2368
 
@@ -2408,15 +2408,15 @@  discard block
 block discarded – undo
2408 2408
 ) {
2409 2409
     // load PhpEncryption library
2410 2410
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2411
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2412
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2413
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2414
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2415
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2416
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2417
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2418
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2419
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2411
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2412
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2413
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2414
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2415
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2416
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2417
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2418
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2419
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2420 2420
 
2421 2421
     try {
2422 2422
         \Defuse\Crypto\File::encryptFileWithPassword(
@@ -2454,15 +2454,15 @@  discard block
 block discarded – undo
2454 2454
 ) {
2455 2455
     // load PhpEncryption library
2456 2456
     $path_to_encryption = '/includes/libraries/Encryption/Encryption/';
2457
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php';
2458
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php';
2459
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php';
2460
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php';
2461
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php';
2462
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php';
2463
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php';
2464
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php';
2465
-    include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php';
2457
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php';
2458
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php';
2459
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php';
2460
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php';
2461
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php';
2462
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php';
2463
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php';
2464
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php';
2465
+    include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php';
2466 2466
 
2467 2467
     try {
2468 2468
         \Defuse\Crypto\File::decryptFileWithPassword(
@@ -2508,9 +2508,9 @@  discard block
 block discarded – undo
2508 2508
 function fileDelete($file, $SETTINGS)
2509 2509
 {
2510 2510
     // Load AntiXSS
2511
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php';
2512
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php';
2513
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
2511
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php';
2512
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php';
2513
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
2514 2514
     $antiXss = new voku\helper\AntiXSS();
2515 2515
 
2516 2516
     $file = $antiXss->xss_clean($file);
@@ -2556,7 +2556,7 @@  discard block
 block discarded – undo
2556 2556
             continue;
2557 2557
         }
2558 2558
 
2559
-        $fullPath = $dir . '/' . $file;
2559
+        $fullPath = $dir.'/'.$file;
2560 2560
 
2561 2561
         if (is_dir($fullPath)) {
2562 2562
             if ($res = @chmod($fullPath, $dirPermissions)) {
@@ -2586,7 +2586,7 @@  discard block
 block discarded – undo
2586 2586
  */
2587 2587
 function accessToItemIsGranted($item_id, $SETTINGS)
2588 2588
 {
2589
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2589
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
2590 2590
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
2591 2591
 
2592 2592
     // Prepare superGlobal variables
@@ -2596,7 +2596,7 @@  discard block
 block discarded – undo
2596 2596
     // Load item data
2597 2597
     $data = DB::queryFirstRow(
2598 2598
         'SELECT id_tree
2599
-        FROM ' . prefixTable('items') . '
2599
+        FROM ' . prefixTable('items').'
2600 2600
         WHERE id = %i',
2601 2601
         $item_id
2602 2602
     );
@@ -2678,8 +2678,8 @@  discard block
 block discarded – undo
2678 2678
 function performDBQuery($SETTINGS, $fields, $table)
2679 2679
 {
2680 2680
     // include librairies & connect to DB
2681
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
2682
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
2681
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
2682
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
2683 2683
     if (defined('DB_PASSWD_CLEAR') === false) {
2684 2684
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
2685 2685
     }
@@ -2692,7 +2692,7 @@  discard block
 block discarded – undo
2692 2692
 
2693 2693
     // Insert log in DB
2694 2694
     return DB::query(
2695
-        'SELECT ' . $fields . '
2695
+        'SELECT '.$fields.'
2696 2696
         FROM ' . prefixTable($table)
2697 2697
     );
2698 2698
 }
@@ -2707,15 +2707,15 @@  discard block
 block discarded – undo
2707 2707
 function formatSizeUnits($bytes)
2708 2708
 {
2709 2709
     if ($bytes >= 1073741824) {
2710
-        $bytes = number_format($bytes / 1073741824, 2) . ' GB';
2710
+        $bytes = number_format($bytes / 1073741824, 2).' GB';
2711 2711
     } elseif ($bytes >= 1048576) {
2712
-        $bytes = number_format($bytes / 1048576, 2) . ' MB';
2712
+        $bytes = number_format($bytes / 1048576, 2).' MB';
2713 2713
     } elseif ($bytes >= 1024) {
2714
-        $bytes = number_format($bytes / 1024, 2) . ' KB';
2714
+        $bytes = number_format($bytes / 1024, 2).' KB';
2715 2715
     } elseif ($bytes > 1) {
2716
-        $bytes = $bytes . ' bytes';
2716
+        $bytes = $bytes.' bytes';
2717 2717
     } elseif ($bytes == 1) {
2718
-        $bytes = $bytes . ' byte';
2718
+        $bytes = $bytes.' byte';
2719 2719
     } else {
2720 2720
         $bytes = '0 bytes';
2721 2721
     }
@@ -2895,7 +2895,7 @@  discard block
 block discarded – undo
2895 2895
     // Decrypt
2896 2896
     try {
2897 2897
         $ret = base64_encode($rsa->decrypt(base64_decode($key)));
2898
-    } catch(Exception $e) {
2898
+    } catch (Exception $e) {
2899 2899
         return $e;
2900 2900
     }
2901 2901
 
@@ -2937,16 +2937,16 @@  discard block
 block discarded – undo
2937 2937
 
2938 2938
     // Encrypt the file content
2939 2939
     $plaintext = file_get_contents(
2940
-        filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL)
2940
+        filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL)
2941 2941
     );
2942 2942
 
2943 2943
     $ciphertext = $cipher->encrypt($plaintext);
2944 2944
 
2945 2945
     // Save new file
2946 2946
     $hash = md5($plaintext);
2947
-    $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash;
2947
+    $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash;
2948 2948
     file_put_contents($fileOut, $ciphertext);
2949
-    unlink($fileInPath . '/' . $fileInName);
2949
+    unlink($fileInPath.'/'.$fileInName);
2950 2950
 
2951 2951
     return array(
2952 2952
         'fileHash' => base64_encode($hash),
@@ -2989,7 +2989,7 @@  discard block
 block discarded – undo
2989 2989
     $cipher->disablePadding();
2990 2990
 
2991 2991
     // Get file content
2992
-    $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName);
2992
+    $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName);
2993 2993
 
2994 2994
     // Decrypt file content and return
2995 2995
     return base64_encode($cipher->decrypt($ciphertext));
@@ -3045,8 +3045,8 @@  discard block
 block discarded – undo
3045 3045
     $SETTINGS
3046 3046
 ) {
3047 3047
     // include librairies & connect to DB
3048
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
3049
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
3048
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
3049
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
3050 3050
     if (defined('DB_PASSWD_CLEAR') === false) {
3051 3051
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
3052 3052
     }
@@ -3065,7 +3065,7 @@  discard block
 block discarded – undo
3065 3065
     );
3066 3066
 
3067 3067
     // Superglobals
3068
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
3068
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
3069 3069
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
3070 3070
 
3071 3071
     // Prepare superGlobal variables
@@ -3092,8 +3092,8 @@  discard block
 block discarded – undo
3092 3092
         // Create sharekey for each user
3093 3093
         $users = DB::query(
3094 3094
             'SELECT id, public_key
3095
-            FROM ' . prefixTable('users') . '
3096
-            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '")
3095
+            FROM ' . prefixTable('users').'
3096
+            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'")
3097 3097
             AND public_key != ""'
3098 3098
         );
3099 3099
         foreach ($users as $user) {
@@ -3194,13 +3194,13 @@  discard block
 block discarded – undo
3194 3194
     ];
3195 3195
 
3196 3196
     // Load expected libraries
3197
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
3198
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
3199
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
3200
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
3201
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
3202
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
3203
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
3197
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
3198
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
3199
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
3200
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
3201
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
3202
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
3203
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
3204 3204
 
3205 3205
     $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
3206 3206
     $ad->register();
@@ -3213,7 +3213,7 @@  discard block
 block discarded – undo
3213 3213
     } catch (\LdapRecord\Auth\BindException $e) {
3214 3214
         $error = $e->getDetailedError();
3215 3215
 
3216
-        echo "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage();
3216
+        echo "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage();
3217 3217
         return false;
3218 3218
     }
3219 3219
 
@@ -3224,7 +3224,7 @@  discard block
 block discarded – undo
3224 3224
     } catch (\LdapRecord\Auth\BindException $e) {
3225 3225
         $error = $e->getDetailedError();
3226 3226
         
3227
-        echo "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage();
3227
+        echo "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage();
3228 3228
         return false;
3229 3229
     }
3230 3230
 
@@ -3245,8 +3245,8 @@  discard block
 block discarded – undo
3245 3245
 function deleteUserObjetsKeys($userId, $SETTINGS)
3246 3246
 {
3247 3247
     // include librairies & connect to DB
3248
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
3249
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
3248
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
3249
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
3250 3250
     if (defined('DB_PASSWD_CLEAR') === false) {
3251 3251
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
3252 3252
     }
@@ -3307,7 +3307,7 @@  discard block
 block discarded – undo
3307 3307
         foreach (DateTimeZone::listIdentifiers() as $timezone) {
3308 3308
             $now->setTimezone(new DateTimeZone($timezone));
3309 3309
             $offsets[] = $offset = $now->getOffset();
3310
-            $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone);
3310
+            $timezones[$timezone] = '('.format_GMT_offset($offset).') '.format_timezone_name($timezone);
3311 3311
         }
3312 3312
 
3313 3313
         array_multisort($offsets, $timezones);
@@ -3319,7 +3319,7 @@  discard block
 block discarded – undo
3319 3319
 function format_GMT_offset($offset) {
3320 3320
     $hours = intval($offset / 3600);
3321 3321
     $minutes = abs(intval($offset % 3600 / 60));
3322
-    return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
3322
+    return 'GMT'.($offset ? sprintf('%+03d:%02d', $hours, $minutes) : '');
3323 3323
 }
3324 3324
 
3325 3325
 function format_timezone_name($name) {
@@ -3341,7 +3341,7 @@  discard block
 block discarded – undo
3341 3341
 function mfa_auth_requested($userRolesIds, $mfaRoles)
3342 3342
 {
3343 3343
     $mfaRoles = array_values(json_decode($mfaRoles, true));
3344
-    $userRolesIds = array_filter(explode(';' , $userRolesIds));
3344
+    $userRolesIds = array_filter(explode(';', $userRolesIds));
3345 3345
 
3346 3346
     if (count($mfaRoles) === 0 || count($mfaRoles) === 0) {
3347 3347
         return true;
Please login to merge, or discard this patch.
sources/items.queries.php 1 patch
Spacing   +289 added lines, -289 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // Do checks
37
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
38
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
37
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
38
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
39 39
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) {
40 40
     // Not allowed page
41 41
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
42
-    include $SETTINGS['cpassman_dir'] . '/error.php';
42
+    include $SETTINGS['cpassman_dir'].'/error.php';
43 43
     exit();
44 44
 }
45 45
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     date_default_timezone_set('UTC');
53 53
 }
54 54
 
55
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
56
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
55
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
56
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
57 57
 header('Content-type: text/html; charset=utf-8');
58 58
 header('Cache-Control: no-cache, must-revalidate');
59 59
 require_once 'main.functions.php';
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 }
76 76
 
77 77
 // Connect to mysql server
78
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
78
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
79 79
 if (defined('DB_PASSWD_CLEAR') === false) {
80 80
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
81 81
 }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 DB::$encoding = DB_ENCODING;
88 88
 
89 89
 // Class loader
90
-require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
90
+require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
91 91
 
92 92
 //Load Tree
93 93
 $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries');
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                 // About special settings
303 303
                 $dataFolderSettings = DB::queryFirstRow(
304 304
                     'SELECT bloquer_creation, bloquer_modification, personal_folder
305
-                    FROM ' . prefixTable('nested_tree') . ' 
305
+                    FROM ' . prefixTable('nested_tree').' 
306 306
                     WHERE id = %i',
307 307
                     $post_folder_id
308 308
                 );
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                 // Get folder complexity
318 318
                 $folderComplexity = DB::queryfirstrow(
319 319
                     'SELECT valeur
320
-                    FROM ' . prefixTable('misc') . '
320
+                    FROM ' . prefixTable('misc').'
321 321
                     WHERE type = %s AND intitule = %i',
322 322
                     'complex',
323 323
                     $post_folder_id
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                 $itemExists = 0;
343 343
                 $newID = '';
344 344
                 $data = DB::queryfirstrow(
345
-                    'SELECT * FROM ' . prefixTable('items') . '
345
+                    'SELECT * FROM '.prefixTable('items').'
346 346
                     WHERE label = %s AND inactif = %i',
347 347
                     $post_label,
348 348
                     0
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                                 // should we encrypt the data
469 469
                                 $dataTmp = DB::queryFirstRow(
470 470
                                     'SELECT encrypted_data
471
-                                    FROM ' . prefixTable('categories') . '
471
+                                    FROM ' . prefixTable('categories').'
472 472
                                     WHERE id = %i',
473 473
                                     $field_data[0]
474 474
                                 );
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
                     ) {
525 525
                         DB::queryFirstRow(
526 526
                             'SELECT *
527
-                            FROM ' . prefixTable('templates') . '
527
+                            FROM ' . prefixTable('templates').'
528 528
                             WHERE item_id = %i',
529 529
                             $newID
530 530
                         );
@@ -593,11 +593,11 @@  discard block
 block discarded – undo
593 593
                     ) {
594 594
                         foreach ($post_restricted_to as $userRest) {
595 595
                             if (empty($userRest) === false) {
596
-                                $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= %i', $userRest);
596
+                                $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= %i', $userRest);
597 597
                                 if (empty($listOfRestricted)) {
598 598
                                     $listOfRestricted = $dataTmp['login'];
599 599
                                 } else {
600
-                                    $listOfRestricted .= ';' . $dataTmp['login'];
600
+                                    $listOfRestricted .= ';'.$dataTmp['login'];
601 601
                                 }
602 602
                             }
603 603
                         }
@@ -610,11 +610,11 @@  discard block
 block discarded – undo
610 610
                         if (empty($data['restricted_to']) === false) {
611 611
                             foreach (explode(';', $data['restricted_to']) as $userRest) {
612 612
                                 if (empty($userRest) === false) {
613
-                                    $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= ' . $userRest);
613
+                                    $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= '.$userRest);
614 614
                                     if (empty($oldRestrictionList) === true) {
615 615
                                         $oldRestrictionList = $dataTmp['login'];
616 616
                                     } else {
617
-                                        $oldRestrictionList .= ';' . $dataTmp['login'];
617
+                                        $oldRestrictionList .= ';'.$dataTmp['login'];
618 618
                                     }
619 619
                                 }
620 620
                             }
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
                     if (empty($post_uploaded_file_id) === false) {
678 678
                         $rows = DB::query(
679 679
                             'SELECT id
680
-                            FROM ' . prefixTable('files') . '
680
+                            FROM ' . prefixTable('files').'
681 681
                             WHERE id_item = %s',
682 682
                             $post_uploaded_file_id
683 683
                         );
@@ -717,14 +717,14 @@  discard block
 block discarded – undo
717 717
                                     langHdl('email_subject'),
718 718
                                     str_replace(
719 719
                                         array('#label', '#link'),
720
-                                        array($path, $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $post_folder_id . '&id=' . $newID . $txt['email_body3']),
720
+                                        array($path, $SETTINGS['email_server_url'].'/index.php?page=items&group='.$post_folder_id.'&id='.$newID.$txt['email_body3']),
721 721
                                         langHdl('new_item_email_body')
722 722
                                     ),
723 723
                                     $emailAddress,
724 724
                                     $SETTINGS,
725 725
                                     str_replace(
726 726
                                         array('#label', '#link'),
727
-                                        array($path, $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $post_folder_id . '&id=' . $newID . $txt['email_body3']),
727
+                                        array($path, $SETTINGS['email_server_url'].'/index.php?page=items&group='.$post_folder_id.'&id='.$newID.$txt['email_body3']),
728 728
                                         langHdl('new_item_email_body')
729 729
                                     )
730 730
                                 );
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
                 // About special settings
890 890
                 $dataFolderSettings = DB::queryFirstRow(
891 891
                     'SELECT bloquer_creation, bloquer_modification, personal_folder
892
-                    FROM ' . prefixTable('nested_tree') . ' 
892
+                    FROM ' . prefixTable('nested_tree').' 
893 893
                     WHERE id = %i',
894 894
                     $post_folder_id
895 895
                 );
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
                 // Get folder complexity
905 905
                 $folderComplexity = DB::queryfirstrow(
906 906
                     'SELECT valeur
907
-                    FROM ' . prefixTable('misc') . '
907
+                    FROM ' . prefixTable('misc').'
908 908
                     WHERE type = %s AND intitule = %i',
909 909
                     'complex',
910 910
                     $post_folder_id
@@ -943,8 +943,8 @@  discard block
 block discarded – undo
943 943
                 // Get all informations for this item
944 944
                 $dataItem = DB::queryfirstrow(
945 945
                     'SELECT *
946
-                    FROM ' . prefixTable('items') . ' as i
947
-                    INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
946
+                    FROM ' . prefixTable('items').' as i
947
+                    INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
948 948
                     WHERE i.id=%i AND l.action = %s',
949 949
                     $post_item_id,
950 950
                     'at_creation'
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 				//db::debugmode(true);
955 955
                 DB::query(
956 956
                     'SELECT *
957
-                    FROM ' . prefixTable('sharekeys_items') . '
957
+                    FROM ' . prefixTable('sharekeys_items').'
958 958
                     WHERE object_id = %i AND user_id = %s',
959 959
                     $post_item_id,
960 960
                     $_SESSION['user_id']
@@ -1004,9 +1004,9 @@  discard block
 block discarded – undo
1004 1004
                         'SELECT i.id as id, i.label as label, i.description as description, i.pw as pw, i.url as url, i.id_tree as id_tree, i.perso as perso, i.login as login, 
1005 1005
                         i.inactif as inactif, i.restricted_to as restricted_to, i.anyone_can_modify as anyone_can_modify, i.email as email, i.notification as notification,
1006 1006
                         u.login as user_login, u.email as user_email
1007
-                        FROM ' . prefixTable('items') . ' as i
1008
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id=l.id_item)
1009
-                        INNER JOIN ' . prefixTable('users') . ' as u ON (u.id=l.id_user)
1007
+                        FROM ' . prefixTable('items').' as i
1008
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id=l.id_item)
1009
+                        INNER JOIN ' . prefixTable('users').' as u ON (u.id=l.id_user)
1010 1010
                         WHERE i.id=%i',
1011 1011
                         $post_item_id
1012 1012
                     );
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
                     // Should we log a password change?
1015 1015
                     $userKey = DB::queryFirstRow(
1016 1016
                         'SELECT share_key
1017
-                        FROM ' . prefixTable('sharekeys_items') . '
1017
+                        FROM ' . prefixTable('sharekeys_items').'
1018 1018
                         WHERE user_id = %i AND object_id = %i',
1019 1019
                         $_SESSION['user_id'],
1020 1020
                         $post_item_id
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
                     // Get list of tags
1074 1074
                     $itemTags = DB::queryFirstColumn(
1075 1075
                         'SELECT tag
1076
-                        FROM ' . prefixTable('tags') . '
1076
+                        FROM ' . prefixTable('tags').'
1077 1077
                         WHERE item_id = %i',
1078 1078
                         $post_item_id
1079 1079
                     );
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
                             $_SESSION['user_id'],
1118 1118
                             'at_modification',
1119 1119
                             $_SESSION['login'],
1120
-                            'at_tag : ' . implode(' ', $itemTags) . ' => ' . $post_tags
1120
+                            'at_tag : '.implode(' ', $itemTags).' => '.$post_tags
1121 1121
                         );
1122 1122
                     }
1123 1123
                     
@@ -1157,8 +1157,8 @@  discard block
 block discarded – undo
1157 1157
                                     'SELECT c.id AS id, c.title AS title, i.data AS data, i.data_iv AS data_iv,
1158 1158
                                     i.encryption_type AS encryption_type, c.encrypted_data AS encrypted_data,
1159 1159
                                     c.masked AS masked, i.id AS field_item_id
1160
-                                    FROM ' . prefixTable('categories_items') . ' AS i
1161
-                                    INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id)
1160
+                                    FROM ' . prefixTable('categories_items').' AS i
1161
+                                    INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id)
1162 1162
                                     WHERE i.field_id = %i AND i.item_id = %i',
1163 1163
                                     $field['id'],
1164 1164
                                     $post_item_id
@@ -1172,7 +1172,7 @@  discard block
 block discarded – undo
1172 1172
                                     // Perform new query
1173 1173
                                     $dataTmpCat = DB::queryFirstRow(
1174 1174
                                         'SELECT id, title, encrypted_data, masked
1175
-                                        FROM ' . prefixTable('categories') . '
1175
+                                        FROM ' . prefixTable('categories').'
1176 1176
                                         WHERE id = %i',
1177 1177
                                         $field['id']
1178 1178
                                     );
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
                                         $_SESSION['user_id'],
1245 1245
                                         'at_modification',
1246 1246
                                         $_SESSION['login'],
1247
-                                        'at_field : ' . $dataTmpCat['title'] . ' : ' . $field['value']
1247
+                                        'at_field : '.$dataTmpCat['title'].' : '.$field['value']
1248 1248
                                     );
1249 1249
                                 } else {
1250 1250
                                     // compare the old and new value
@@ -1252,7 +1252,7 @@  discard block
 block discarded – undo
1252 1252
                                         // Get user sharekey for this field
1253 1253
                                         $userKey = DB::queryFirstRow(
1254 1254
                                             'SELECT share_key
1255
-                                            FROM ' . prefixTable('sharekeys_fields') . '
1255
+                                            FROM ' . prefixTable('sharekeys_fields').'
1256 1256
                                             WHERE user_id = %i AND object_id = %i',
1257 1257
                                             $_SESSION['user_id'],
1258 1258
                                             $dataTmpCat['field_item_id']
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
                                             $_SESSION['user_id'],
1322 1322
                                             'at_modification',
1323 1323
                                             $_SESSION['login'],
1324
-                                            'at_field : ' . $dataTmpCat['title'] . ' => ' . $oldVal
1324
+                                            'at_field : '.$dataTmpCat['title'].' => '.$oldVal
1325 1325
                                         );
1326 1326
                                     }
1327 1327
                                 }
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
                     ) {
1347 1347
                         DB::queryFirstRow(
1348 1348
                             'SELECT *
1349
-                            FROM ' . prefixTable('templates') . '
1349
+                            FROM ' . prefixTable('templates').'
1350 1350
                             WHERE item_id = %i',
1351 1351
                             $post_item_id
1352 1352
                         );
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
                         // check if elem exists in Table. If not add it or update it.
1390 1390
                         DB::query(
1391 1391
                             'SELECT *
1392
-                            FROM ' . prefixTable('automatic_del') . '
1392
+                            FROM ' . prefixTable('automatic_del').'
1393 1393
                             WHERE item_id = %i',
1394 1394
                             $post_item_id
1395 1395
                         );
@@ -1416,7 +1416,7 @@  discard block
 block discarded – undo
1416 1416
                                 // Store updates performed
1417 1417
                                 array_push(
1418 1418
                                     $arrayOfChanges,
1419
-                                    langHdl('automatic_deletion_engaged') . ': ' . langHdl('enabled')
1419
+                                    langHdl('automatic_deletion_engaged').': '.langHdl('enabled')
1420 1420
                                 );
1421 1421
 
1422 1422
                                 // update LOG
@@ -1459,7 +1459,7 @@  discard block
 block discarded – undo
1459 1459
                                 // Store updates performed
1460 1460
                                 array_push(
1461 1461
                                     $arrayOfChanges,
1462
-                                    langHdl('automatic_deletion_engaged') . ': ' . langHdl('disabled')
1462
+                                    langHdl('automatic_deletion_engaged').': '.langHdl('disabled')
1463 1463
                                 );
1464 1464
 
1465 1465
                                 // update LOG
@@ -1492,7 +1492,7 @@  discard block
 block discarded – undo
1492 1492
                             if (empty($userId) === false) {
1493 1493
                                 $dataTmp = DB::queryfirstrow(
1494 1494
                                     'SELECT id, name, lastname
1495
-                                    FROM ' . prefixTable('users') . '
1495
+                                    FROM ' . prefixTable('users').'
1496 1496
                                     WHERE id= %i',
1497 1497
                                     $userId
1498 1498
                                 );
@@ -1500,7 +1500,7 @@  discard block
 block discarded – undo
1500 1500
                                 // Add to array
1501 1501
                                 array_push(
1502 1502
                                     $arrayOfUsersRestriction,
1503
-                                    $dataTmp['name'] . ' ' . $dataTmp['lastname']
1503
+                                    $dataTmp['name'].' '.$dataTmp['lastname']
1504 1504
                                 );
1505 1505
                                 array_push(
1506 1506
                                     $arrayOfUsersIdRestriction,
@@ -1531,8 +1531,8 @@  discard block
 block discarded – undo
1531 1531
                         // get values before deleting them
1532 1532
                         $rows = DB::query(
1533 1533
                             'SELECT t.title, t.id AS id
1534
-                            FROM ' . prefixTable('roles_title') . ' as t
1535
-                            INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (t.id=r.role_id)
1534
+                            FROM ' . prefixTable('roles_title').' as t
1535
+                            INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (t.id=r.role_id)
1536 1536
                             WHERE r.item_id = %i
1537 1537
                             ORDER BY t.title ASC',
1538 1538
                             $post_item_id
@@ -1566,7 +1566,7 @@  discard block
 block discarded – undo
1566 1566
                                 );
1567 1567
                                 $dataTmp = DB::queryfirstrow(
1568 1568
                                     'SELECT title
1569
-                                    FROM ' . prefixTable('roles_title') . '
1569
+                                    FROM ' . prefixTable('roles_title').'
1570 1570
                                     WHERE id = %i',
1571 1571
                                     $role
1572 1572
                                 );
@@ -1607,8 +1607,8 @@  discard block
 block discarded – undo
1607 1607
                             $_SESSION['user_id'],
1608 1608
                             'at_modification',
1609 1609
                             $_SESSION['login'],
1610
-                            'at_restriction : ' . (count($diffUsersRestiction) > 0 ?
1611
-                                implode(', ', $arrayOfUsersRestriction) . (count($diffRolesRestiction) > 0 ? ', ' : '') : '') . (count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '')
1610
+                            'at_restriction : '.(count($diffUsersRestiction) > 0 ?
1611
+                                implode(', ', $arrayOfUsersRestriction).(count($diffRolesRestiction) > 0 ? ', ' : '') : '').(count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '')
1612 1612
                         );
1613 1613
                     }
1614 1614
 
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
                             $_SESSION['user_id'],
1629 1629
                             'at_modification',
1630 1630
                             $_SESSION['login'],
1631
-                            'at_label : ' . $data['label'] . ' => ' . $post_label
1631
+                            'at_label : '.$data['label'].' => '.$post_label
1632 1632
                         );
1633 1633
                     }
1634 1634
                     // LOGIN
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
                             $_SESSION['user_id'],
1648 1648
                             'at_modification',
1649 1649
                             $_SESSION['login'],
1650
-                            'at_login : ' . $data['login'] . ' => ' . $post_login
1650
+                            'at_login : '.$data['login'].' => '.$post_login
1651 1651
                         );
1652 1652
                     }
1653 1653
                     // EMAIL
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
                             $_SESSION['user_id'],
1667 1667
                             'at_modification',
1668 1668
                             $_SESSION['login'],
1669
-                            'at_email : ' . $data['email'] . ' => ' . $post_email
1669
+                            'at_email : '.$data['email'].' => '.$post_email
1670 1670
                         );
1671 1671
                     }
1672 1672
                     // URL
@@ -1685,7 +1685,7 @@  discard block
 block discarded – undo
1685 1685
                             $_SESSION['user_id'],
1686 1686
                             'at_modification',
1687 1687
                             $_SESSION['login'],
1688
-                            'at_url : ' . $data['url'] . ' => ' . $post_url
1688
+                            'at_url : '.$data['url'].' => '.$post_url
1689 1689
                         );
1690 1690
                     }
1691 1691
                     // DESCRIPTION
@@ -1710,7 +1710,7 @@  discard block
 block discarded – undo
1710 1710
                     // FOLDER
1711 1711
                     if ($data['id_tree'] !== $post_folder_id) {
1712 1712
                         // Get name of folders
1713
-                        $dataTmp = DB::query('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id IN %li', array($data['id_tree'], $post_folder_id));
1713
+                        $dataTmp = DB::query('SELECT title FROM '.prefixTable('nested_tree').' WHERE id IN %li', array($data['id_tree'], $post_folder_id));
1714 1714
 
1715 1715
                         // Store updates performed
1716 1716
                         array_push(
@@ -1726,7 +1726,7 @@  discard block
 block discarded – undo
1726 1726
                             $_SESSION['user_id'],
1727 1727
                             'at_modification',
1728 1728
                             $_SESSION['login'],
1729
-                            'at_category : ' . $dataTmp[0]['title'] . ' => ' . $dataTmp[1]['title']
1729
+                            'at_category : '.$dataTmp[0]['title'].' => '.$dataTmp[1]['title']
1730 1730
                         );
1731 1731
                         // ask for page reloading
1732 1732
                         $reloadPage = true;
@@ -1736,7 +1736,7 @@  discard block
 block discarded – undo
1736 1736
                         // Store updates performed
1737 1737
                         array_push(
1738 1738
                             $arrayOfChanges,
1739
-                            langHdl('at_anyoneconmodify') . ': ' . ((int) $post_anyone_can_modify === 0 ? langHdl('disabled') : langHdl('enabled'))
1739
+                            langHdl('at_anyoneconmodify').': '.((int) $post_anyone_can_modify === 0 ? langHdl('disabled') : langHdl('enabled'))
1740 1740
                         );
1741 1741
 
1742 1742
                         // Log
@@ -1747,15 +1747,15 @@  discard block
 block discarded – undo
1747 1747
                             $_SESSION['user_id'],
1748 1748
                             'at_modification',
1749 1749
                             $_SESSION['login'],
1750
-                            'at_anyoneconmodify : ' . ((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled')
1750
+                            'at_anyoneconmodify : '.((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled')
1751 1751
                         );
1752 1752
                     }
1753 1753
 
1754 1754
                     // Reload new values
1755 1755
                     $dataItem = DB::queryfirstrow(
1756 1756
                         'SELECT *
1757
-                        FROM ' . prefixTable('items') . ' as i
1758
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
1757
+                        FROM ' . prefixTable('items').' as i
1758
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
1759 1759
                         WHERE i.id = %i AND l.action = %s',
1760 1760
                         $post_item_id,
1761 1761
                         'at_creation'
@@ -1764,8 +1764,8 @@  discard block
 block discarded – undo
1764 1764
                     $history = '';
1765 1765
                     $rows = DB::query(
1766 1766
                         'SELECT l.date as date, l.action as action, l.raison as raison, u.login as login
1767
-                        FROM ' . prefixTable('log_items') . ' as l
1768
-                        LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
1767
+                        FROM ' . prefixTable('log_items').' as l
1768
+                        LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
1769 1769
                         WHERE l.action <> %s AND id_item=%s',
1770 1770
                         'at_shown',
1771 1771
                         $post_item_id
@@ -1773,14 +1773,14 @@  discard block
 block discarded – undo
1773 1773
                     foreach ($rows as $record) {
1774 1774
                         $reason = explode(':', $record['raison']);
1775 1775
                         if (count($reason) > 0) {
1776
-                            $sentence = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date']) . ' - '
1777
-                                . $record['login'] . ' - ' . langHdl($record['action']) . ' - '
1778
-                                . (empty($record['raison']) === false ? (count($reason) > 1 ? langHdl(trim($reason[0])) . ' : ' . $reason[1]
1776
+                            $sentence = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date']).' - '
1777
+                                . $record['login'].' - '.langHdl($record['action']).' - '
1778
+                                . (empty($record['raison']) === false ? (count($reason) > 1 ? langHdl(trim($reason[0])).' : '.$reason[1]
1779 1779
                                     : langHdl(trim($reason[0]))) : '');
1780 1780
                             if (empty($history)) {
1781 1781
                                 $history = $sentence;
1782 1782
                             } else {
1783
-                                $history .= '<br />' . $sentence;
1783
+                                $history .= '<br />'.$sentence;
1784 1784
                             }
1785 1785
                         }
1786 1786
                     }
@@ -1791,19 +1791,19 @@  discard block
 block discarded – undo
1791 1791
                     // Prepare files listing
1792 1792
                     $files = $filesEdit = '';
1793 1793
                     // launch query
1794
-                    $rows = DB::query('SELECT id, name, file, extension FROM ' . prefixTable('files') . ' WHERE id_item=%i', $post_item_id);
1794
+                    $rows = DB::query('SELECT id, name, file, extension FROM '.prefixTable('files').' WHERE id_item=%i', $post_item_id);
1795 1795
                     foreach ($rows as $record) {
1796 1796
                         // get icon image depending on file format
1797 1797
                         $iconImage = fileFormatImage($record['extension']);
1798 1798
 
1799 1799
                         // If file is an image, then prepare lightbox. If not image, then prepare donwload
1800 1800
                         if (in_array($record['extension'], TP_IMAGE_FILE_EXT)) {
1801
-                            $files .= '<i class=\'fa fa-file-image-o\' /></i>&nbsp;<a class="image_dialog" href="#' . $record['id'] . '" title="' . $record['name'] . '">' . $record['name'] . '</a><br />';
1801
+                            $files .= '<i class=\'fa fa-file-image-o\' /></i>&nbsp;<a class="image_dialog" href="#'.$record['id'].'" title="'.$record['name'].'">'.$record['name'].'</a><br />';
1802 1802
                         } else {
1803
-                            $files .= '<i class=\'fa fa-file-text-o\' /></i>&nbsp;<a href=\'sources/downloadFile.php?name=' . urlencode($record['name']) . '&type=sub&key=' . $_SESSION['key'] . '&key_tmp=' . $_SESSION['key_tmp'] . '&fileid=' . $record['id'] . '\' target=\'_blank\'>' . $record['name'] . '</a><br />';
1803
+                            $files .= '<i class=\'fa fa-file-text-o\' /></i>&nbsp;<a href=\'sources/downloadFile.php?name='.urlencode($record['name']).'&type=sub&key='.$_SESSION['key'].'&key_tmp='.$_SESSION['key_tmp'].'&fileid='.$record['id'].'\' target=\'_blank\'>'.$record['name'].'</a><br />';
1804 1804
                         }
1805 1805
                         // Prepare list of files for edit dialogbox
1806
-                        $filesEdit .= '<span id="span_edit_file_' . $record['id'] . '"><span class="fa fa-' . $iconImage . '"></span>&nbsp;<span class="fa fa-eraser tip" style="cursor:pointer;"  onclick="delete_attached_file(\"' . $record['id'] . '\")" title="' . langHdl('at_delete') . '"></span>&nbsp;' . $record['name'] . '</span><br />';
1806
+                        $filesEdit .= '<span id="span_edit_file_'.$record['id'].'"><span class="fa fa-'.$iconImage.'"></span>&nbsp;<span class="fa fa-eraser tip" style="cursor:pointer;"  onclick="delete_attached_file(\"'.$record['id'].'\")" title="'.langHdl('at_delete').'"></span>&nbsp;'.$record['name'].'</span><br />';
1807 1807
                     }
1808 1808
                     // Send email
1809 1809
                     if (is_array($post_diffusion_list) === true && count($post_diffusion_list) > 0) {
@@ -1918,7 +1918,7 @@  discard block
 block discarded – undo
1918 1918
             ) {
1919 1919
                 // load the original record into an array
1920 1920
                 $originalRecord = DB::queryfirstrow(
1921
-                    'SELECT * FROM ' . prefixTable('items') . '
1921
+                    'SELECT * FROM '.prefixTable('items').'
1922 1922
                     WHERE id = %i',
1923 1923
                     $post_item_id
1924 1924
                 );
@@ -1937,7 +1937,7 @@  discard block
 block discarded – undo
1937 1937
 
1938 1938
                 // Load the destination folder record into an array
1939 1939
                 $dataDestination = DB::queryfirstrow(
1940
-                    'SELECT personal_folder FROM ' . prefixTable('nested_tree') . '
1940
+                    'SELECT personal_folder FROM '.prefixTable('nested_tree').'
1941 1941
                     WHERE id = %i',
1942 1942
                     $post_dest_id
1943 1943
                 );
@@ -1945,7 +1945,7 @@  discard block
 block discarded – undo
1945 1945
                 // Get the ITEM object key for the user
1946 1946
                 $userKey = DB::queryFirstRow(
1947 1947
                     'SELECT share_key
1948
-                    FROM ' . prefixTable('sharekeys_items') . '
1948
+                    FROM ' . prefixTable('sharekeys_items').'
1949 1949
                     WHERE user_id = %i AND object_id = %i',
1950 1950
                     $_SESSION['user_id'],
1951 1951
                     $post_item_id
@@ -2017,7 +2017,7 @@  discard block
 block discarded – undo
2017 2017
                 // Manage Custom Fields
2018 2018
                 $rows = DB::query(
2019 2019
                     'SELECT *
2020
-                    FROM ' . prefixTable('categories_items') . '
2020
+                    FROM ' . prefixTable('categories_items').'
2021 2021
                     WHERE item_id = %i',
2022 2022
                     $post_item_id
2023 2023
                 );
@@ -2065,15 +2065,15 @@  discard block
 block discarded – undo
2065 2065
                 $rows = DB::query(
2066 2066
                     'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension,
2067 2067
                     f.size AS size, f.type AS type, s.share_key AS share_key
2068
-                    FROM ' . prefixTable('files') . ' AS f
2069
-                    INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
2068
+                    FROM ' . prefixTable('files').' AS f
2069
+                    INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
2070 2070
                     WHERE s.user_id = %i AND f.id_item = %i',
2071 2071
                     $_SESSION['user_id'],
2072 2072
                     $post_item_id
2073 2073
                 );
2074 2074
                 foreach ($rows as $record) {
2075 2075
                     // Check if file still exists
2076
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($record['file'])) === true) {
2076
+                    if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($record['file'])) === true) {
2077 2077
                         // Step1 - decrypt the file
2078 2078
                         $fileContent = decryptFile(
2079 2079
                             $record['file'],
@@ -2082,8 +2082,8 @@  discard block
 block discarded – undo
2082 2082
                         );
2083 2083
 
2084 2084
                         // Step2 - create file
2085
-                        $newFileName = md5(time() . '_' . $record['id']) . '.' . $record['extension'];
2086
-                        $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab');
2085
+                        $newFileName = md5(time().'_'.$record['id']).'.'.$record['extension'];
2086
+                        $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab');
2087 2087
                         if ($outstream === false) {
2088 2088
                             echo prepareExchangedData(
2089 2089
                                 array(
@@ -2133,7 +2133,7 @@  discard block
 block discarded – undo
2133 2133
 
2134 2134
                 // -------------------------
2135 2135
                 // Add specific restrictions
2136
-                $rows = DB::query('SELECT * FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i', $post_item_id);
2136
+                $rows = DB::query('SELECT * FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i', $post_item_id);
2137 2137
                 foreach ($rows as $record) {
2138 2138
                     DB::insert(
2139 2139
                         prefixTable('restriction_to_roles'),
@@ -2145,7 +2145,7 @@  discard block
 block discarded – undo
2145 2145
                 }
2146 2146
 
2147 2147
                 // Add Tags
2148
-                $rows = DB::query('SELECT * FROM ' . prefixTable('tags') . ' WHERE item_id = %i', $post_item_id);
2148
+                $rows = DB::query('SELECT * FROM '.prefixTable('tags').' WHERE item_id = %i', $post_item_id);
2149 2149
                 foreach ($rows as $record) {
2150 2150
                     DB::insert(
2151 2151
                         prefixTable('tags'),
@@ -2175,7 +2175,7 @@  discard block
 block discarded – undo
2175 2175
                     $_SESSION['login']
2176 2176
                 );
2177 2177
                 // reload cache table
2178
-                include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
2178
+                include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
2179 2179
                 updateCacheTable('reload', $SETTINGS, '');
2180 2180
 
2181 2181
                 echo (string) prepareExchangedData(
@@ -2247,7 +2247,7 @@  discard block
 block discarded – undo
2247 2247
             // then we can show it
2248 2248
             $item_deleted = DB::queryFirstRow(
2249 2249
                 'SELECT *
2250
-                FROM ' . prefixTable('log_items') . '
2250
+                FROM ' . prefixTable('log_items').'
2251 2251
                 WHERE id_item = %i AND action = %s
2252 2252
                 ORDER BY date DESC
2253 2253
                 LIMIT 0, 1',
@@ -2258,7 +2258,7 @@  discard block
 block discarded – undo
2258 2258
 
2259 2259
             $item_restored = DB::queryFirstRow(
2260 2260
                 'SELECT *
2261
-                FROM ' . prefixTable('log_items') . '
2261
+                FROM ' . prefixTable('log_items').'
2262 2262
                 WHERE id_item = %i AND action = %s
2263 2263
                 ORDER BY date DESC
2264 2264
                 LIMIT 0, 1',
@@ -2282,8 +2282,8 @@  discard block
 block discarded – undo
2282 2282
             // Get all informations for this item
2283 2283
             $dataItem = DB::queryfirstrow(
2284 2284
                 'SELECT *
2285
-                FROM ' . prefixTable('items') . ' as i
2286
-                INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
2285
+                FROM ' . prefixTable('items').' as i
2286
+                INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
2287 2287
                 WHERE i.id = %i AND l.action = %s',
2288 2288
                 $post_id,
2289 2289
                 'at_creation'
@@ -2292,7 +2292,7 @@  discard block
 block discarded – undo
2292 2292
             // Notification
2293 2293
             DB::queryfirstrow(
2294 2294
                 'SELECT *
2295
-                FROM ' . prefixTable('notification') . '
2295
+                FROM ' . prefixTable('notification').'
2296 2296
                 WHERE item_id = %i AND user_id = %i',
2297 2297
                 $post_id,
2298 2298
                 $_SESSION['user_id']
@@ -2339,13 +2339,13 @@  discard block
 block discarded – undo
2339 2339
                     && $SETTINGS['enable_email_notification_on_item_shown'] === '1'
2340 2340
                     && $user['admin'] === '1'
2341 2341
                 ) {
2342
-                    $_SESSION['listNotificationEmails'] .= $user['email'] . ',';
2342
+                    $_SESSION['listNotificationEmails'] .= $user['email'].',';
2343 2343
                 }
2344 2344
             }
2345 2345
 
2346 2346
             // manage case of API user
2347 2347
             if ($dataItem['id_user'] === API_USER_ID) {
2348
-                $arrData['author'] = 'API [' . $dataItem['description'] . ']';
2348
+                $arrData['author'] = 'API ['.$dataItem['description'].']';
2349 2349
                 $arrData['id_user'] = API_USER_ID;
2350 2350
                 $arrData['author_email'] = '';
2351 2351
                 $arrData['notification_status'] = false;
@@ -2355,7 +2355,7 @@  discard block
 block discarded – undo
2355 2355
             $tags = array();
2356 2356
             $rows = DB::query(
2357 2357
                 'SELECT tag
2358
-                FROM ' . prefixTable('tags') . '
2358
+                FROM ' . prefixTable('tags').'
2359 2359
                 WHERE item_id = %i',
2360 2360
                 $post_id
2361 2361
             );
@@ -2380,7 +2380,7 @@  discard block
 block discarded – undo
2380 2380
             // Check if user has a role that is accepted
2381 2381
             $rows_tmp = DB::query(
2382 2382
                 'SELECT role_id
2383
-                FROM ' . prefixTable('restriction_to_roles') . '
2383
+                FROM ' . prefixTable('restriction_to_roles').'
2384 2384
                 WHERE item_id=%i',
2385 2385
                 $post_id
2386 2386
             );
@@ -2394,7 +2394,7 @@  discard block
 block discarded – undo
2394 2394
             // Get the object key for the user
2395 2395
             $userKey = DB::queryFirstRow(
2396 2396
                 'SELECT share_key
2397
-                FROM ' . prefixTable('sharekeys_items') . '
2397
+                FROM ' . prefixTable('sharekeys_items').'
2398 2398
                 WHERE user_id = %i AND object_id = %i',
2399 2399
                 $_SESSION['user_id'],
2400 2400
                 $post_id
@@ -2479,8 +2479,8 @@  discard block
 block discarded – undo
2479 2479
                     // Add restriction if item is restricted to roles
2480 2480
                     $rows = DB::query(
2481 2481
                         'SELECT t.title, t.id
2482
-                        FROM ' . prefixTable('roles_title') . ' AS t
2483
-                        INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (t.id=r.role_id)
2482
+                        FROM ' . prefixTable('roles_title').' AS t
2483
+                        INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (t.id=r.role_id)
2484 2484
                         WHERE r.item_id = %i
2485 2485
                         ORDER BY t.title ASC',
2486 2486
                         $post_id
@@ -2496,8 +2496,8 @@  discard block
 block discarded – undo
2496 2496
                     $tmp = array();
2497 2497
                     $rows = DB::query(
2498 2498
                         'SELECT k.label, k.id
2499
-                        FROM ' . prefixTable('kb_items') . ' as i
2500
-                        INNER JOIN ' . prefixTable('kb') . ' as k ON (i.kb_id=k.id)
2499
+                        FROM ' . prefixTable('kb_items').' as i
2500
+                        INNER JOIN ' . prefixTable('kb').' as k ON (i.kb_id=k.id)
2501 2501
                         WHERE i.item_id = %i
2502 2502
                         ORDER BY k.label ASC',
2503 2503
                         $post_id
@@ -2577,7 +2577,7 @@  discard block
 block discarded – undo
2577 2577
                     $arrCatList = array();
2578 2578
                     $rows_tmp = DB::query(
2579 2579
                         'SELECT id_category
2580
-                        FROM ' . prefixTable('categories_folders') . '
2580
+                        FROM ' . prefixTable('categories_folders').'
2581 2581
                         WHERE id_folder=%i',
2582 2582
                         $post_folder_id
2583 2583
                     );
@@ -2592,8 +2592,8 @@  discard block
 block discarded – undo
2592 2592
                             'SELECT i.id AS id, i.field_id AS field_id, i.data AS data, i.item_id AS item_id,
2593 2593
                             i.encryption_type AS encryption_type, c.encrypted_data, c.parent_id AS parent_id,
2594 2594
                             c.type as field_type, c.masked AS field_masked, c.role_visibility AS role_visibility
2595
-                            FROM ' . prefixTable('categories_items') . ' AS i
2596
-                            INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id)
2595
+                            FROM ' . prefixTable('categories_items').' AS i
2596
+                            INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id)
2597 2597
                             WHERE i.item_id=%i AND c.parent_id IN %ls',
2598 2598
                             $post_id,
2599 2599
                             $arrCatList
@@ -2604,11 +2604,11 @@  discard block
 block discarded – undo
2604 2604
 							//db::debugmode(true);
2605 2605
                             $userKey = DB::queryFirstRow(
2606 2606
                                 'SELECT share_key
2607
-                                FROM ' . prefixTable('sharekeys_fields') . '
2607
+                                FROM ' . prefixTable('sharekeys_fields').'
2608 2608
                                 WHERE user_id = %i AND object_id = %i',
2609 2609
                                 $_SESSION['user_id'],
2610 2610
                                 $row['id']
2611
-                            );//db::debugmode(false);
2611
+                            ); //db::debugmode(false);
2612 2612
                             if (DB::count() === 0) {
2613 2613
                                 // Not encrypted
2614 2614
                                 $fieldText['string'] = $row['data'];
@@ -2649,7 +2649,7 @@  discard block
 block discarded – undo
2649 2649
                 if (isset($SETTINGS['item_creation_templates']) && $SETTINGS['item_creation_templates'] === '1') {
2650 2650
                     $rows_tmp = DB::queryfirstrow(
2651 2651
                         'SELECT category_id
2652
-                        FROM ' . prefixTable('templates') . '
2652
+                        FROM ' . prefixTable('templates').'
2653 2653
                         WHERE item_id = %i',
2654 2654
                         $post_id
2655 2655
                     );
@@ -2674,7 +2674,7 @@  discard block
 block discarded – undo
2674 2674
                     // Is the Item to be deleted?
2675 2675
                     $dataDelete = DB::queryfirstrow(
2676 2676
                         'SELECT * 
2677
-                        FROM ' . prefixTable('automatic_del') . '
2677
+                        FROM ' . prefixTable('automatic_del').'
2678 2678
                         WHERE item_id = %i',
2679 2679
                         $post_id
2680 2680
                     );
@@ -2756,11 +2756,11 @@  discard block
 block discarded – undo
2756 2756
                 if (empty($dataItem['restricted_to']) === false) {
2757 2757
                     foreach (explode(';', $dataItem['restricted_to']) as $userRest) {
2758 2758
                         if (empty($userRest) === false) {
2759
-                            $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= ' . $userRest);
2759
+                            $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= '.$userRest);
2760 2760
                             if (empty($listOfRestricted)) {
2761 2761
                                 $listOfRestricted = $dataTmp['login'];
2762 2762
                             } else {
2763
-                                $listOfRestricted .= ';' . $dataTmp['login'];
2763
+                                $listOfRestricted .= ';'.$dataTmp['login'];
2764 2764
                             }
2765 2765
                         }
2766 2766
                     }
@@ -2816,8 +2816,8 @@  discard block
 block discarded – undo
2816 2816
             // Load item data
2817 2817
             $dataItem = DB::queryFirstRow(
2818 2818
                 'SELECT i.*, n.title AS folder_title
2819
-                FROM ' . prefixTable('items') . ' AS i
2820
-                INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
2819
+                FROM ' . prefixTable('items').' AS i
2820
+                INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
2821 2821
                 WHERE i.id = %i',
2822 2822
                 $post_id
2823 2823
             );
@@ -2839,7 +2839,7 @@  discard block
 block discarded – undo
2839 2839
             // Check if user has a role that is accepted
2840 2840
             $rows_tmp = DB::query(
2841 2841
                 'SELECT role_id
2842
-                FROM ' . prefixTable('restriction_to_roles') . '
2842
+                FROM ' . prefixTable('restriction_to_roles').'
2843 2843
                 WHERE item_id=%i',
2844 2844
                 $post_id
2845 2845
             );
@@ -2885,7 +2885,7 @@  discard block
 block discarded – undo
2885 2885
                 // launch query
2886 2886
                 $rows = DB::query(
2887 2887
                     'SELECT id, name, file, extension, size
2888
-                    FROM ' . prefixTable('files') . '
2888
+                    FROM ' . prefixTable('files').'
2889 2889
                     WHERE id_item = %i AND confirmed = 1',
2890 2890
                     $post_id
2891 2891
                 );
@@ -2894,7 +2894,7 @@  discard block
 block discarded – undo
2894 2894
                         $attachments,
2895 2895
                         array(
2896 2896
                             'icon' => fileFormatImage(strtolower($record['extension'])),
2897
-                            'filename' => basename($record['name'], '.' . $record['extension']),
2897
+                            'filename' => basename($record['name'], '.'.$record['extension']),
2898 2898
                             'extension' => $record['extension'],
2899 2899
                             'size' => formatSizeUnits($record['size']),
2900 2900
                             'is_image' => in_array(strtolower($record['extension']), TP_IMAGE_FILE_EXT) === true ? 1 : 0,
@@ -2923,7 +2923,7 @@  discard block
 block discarded – undo
2923 2923
                         array(
2924 2924
                             'latest_items' => implode(';', $_SESSION['latest_items']),
2925 2925
                         ),
2926
-                        'id=' . $_SESSION['user_id']
2926
+                        'id='.$_SESSION['user_id']
2927 2927
                     );
2928 2928
                 }
2929 2929
 
@@ -2932,8 +2932,8 @@  discard block
 block discarded – undo
2932 2932
                 $listOptionsForRoles = array();
2933 2933
                 $rows = DB::query(
2934 2934
                     'SELECT r.role_id AS role_id, t.title AS title
2935
-                    FROM ' . prefixTable('roles_values') . ' AS r
2936
-                    INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id)
2935
+                    FROM ' . prefixTable('roles_values').' AS r
2936
+                    INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id)
2937 2937
                     WHERE r.folder_id = %i',
2938 2938
                     $dataItem['id_tree']
2939 2939
                 );
@@ -2947,9 +2947,9 @@  discard block
 block discarded – undo
2947 2947
                     );
2948 2948
                     $rows2 = DB::query(
2949 2949
                         'SELECT id, login, fonction_id, email, name, lastname
2950
-                        FROM ' . prefixTable('users') . '
2950
+                        FROM ' . prefixTable('users').'
2951 2951
                         WHERE fonction_id LIKE %s',
2952
-                        '%' . $record['role_id'] . '%'
2952
+                        '%'.$record['role_id'].'%'
2953 2953
                     );
2954 2954
                     foreach ($rows2 as $record2) {
2955 2955
                         foreach (explode(';', $record2['fonction_id']) as $role) {
@@ -2962,7 +2962,7 @@  discard block
 block discarded – undo
2962 2962
                                     array(
2963 2963
                                         'id' => (int) $record2['id'],
2964 2964
                                         'login' => $record2['login'],
2965
-                                        'name' => $record2['name'] . ' ' . $record2['lastname'],
2965
+                                        'name' => $record2['name'].' '.$record2['lastname'],
2966 2966
                                         'email' => $record2['email'],
2967 2967
                                     )
2968 2968
                                 );
@@ -2981,16 +2981,16 @@  discard block
 block discarded – undo
2981 2981
                     $path = '';
2982 2982
                     foreach ($arbo as $elem) {
2983 2983
                         if (empty($path) === true) {
2984
-                            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' ';
2984
+                            $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' ';
2985 2985
                         } else {
2986
-                            $path .= '&#8594; ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
2986
+                            $path .= '&#8594; '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
2987 2987
                         }
2988 2988
                     }
2989 2989
                     // Build text to show user
2990 2990
                     if (empty($path) === true) {
2991 2991
                         $path = addslashes($dataItem['label']);
2992 2992
                     } else {
2993
-                        $path = addslashes($dataItem['label']) . ' (' . $path . ')';
2993
+                        $path = addslashes($dataItem['label']).' ('.$path.')';
2994 2994
                     }
2995 2995
 
2996 2996
                     // send back infos
@@ -3004,7 +3004,7 @@  discard block
 block discarded – undo
3004 3004
                                 array(
3005 3005
                                     addslashes($_SESSION['login']),
3006 3006
                                     $path,
3007
-                                    $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $dataItem['id'],
3007
+                                    $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$dataItem['id'],
3008 3008
                                 ),
3009 3009
                                 langHdl('email_on_open_notification_mail')
3010 3010
                             ),
@@ -3015,7 +3015,7 @@  discard block
 block discarded – undo
3015 3015
                 }
3016 3016
 
3017 3017
                 // has this item a change proposal
3018
-                DB::query('SELECT * FROM ' . prefixTable('items_change') . ' WHERE item_id = %i', $post_id);
3018
+                DB::query('SELECT * FROM '.prefixTable('items_change').' WHERE item_id = %i', $post_id);
3019 3019
                 $returnArray['has_change_proposal'] = DB::count();
3020 3020
 
3021 3021
                 // Setting
@@ -3105,7 +3105,7 @@  discard block
 block discarded – undo
3105 3105
             // Load item data
3106 3106
             $data = DB::queryFirstRow(
3107 3107
                 'SELECT id_tree
3108
-                FROM ' . prefixTable('items') . '
3108
+                FROM ' . prefixTable('items').'
3109 3109
                 WHERE id = %i',
3110 3110
                 $post_item_id
3111 3111
             );
@@ -3174,13 +3174,13 @@  discard block
 block discarded – undo
3174 3174
 
3175 3175
             // Check if user is allowed to access this folder
3176 3176
             if (!in_array($post_folder_id, $_SESSION['groupes_visibles'])) {
3177
-                echo '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3177
+                echo '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3178 3178
                 break;
3179 3179
             }
3180 3180
 
3181 3181
             // Check if title doesn't contains html codes
3182 3182
             if (preg_match_all('|<[^>]+>(.*)</[^>]+>|U', $title, $out)) {
3183
-                echo '[ { "error" : "' . langHdl('error_html_codes') . '" } ]';
3183
+                echo '[ { "error" : "'.langHdl('error_html_codes').'" } ]';
3184 3184
                 break;
3185 3185
             }
3186 3186
             // check that title is not numeric
@@ -3192,9 +3192,9 @@  discard block
 block discarded – undo
3192 3192
             // Check if duplicate folders name are allowed
3193 3193
             $createNewFolder = true;
3194 3194
             if (isset($SETTINGS['duplicate_folder']) && $SETTINGS['duplicate_folder'] === '0') {
3195
-                $data = DB::queryFirstRow('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE title = %s', $title);
3195
+                $data = DB::queryFirstRow('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE title = %s', $title);
3196 3196
                 if (empty($data['id']) === false && $dataReceived['folder'] != $data['id']) {
3197
-                    echo '[ { "error" : "' . langHdl('error_group_exist') . '" } ]';
3197
+                    echo '[ { "error" : "'.langHdl('error_group_exist').'" } ]';
3198 3198
                     break;
3199 3199
                 }
3200 3200
             }
@@ -3202,7 +3202,7 @@  discard block
 block discarded – undo
3202 3202
             // query on folder
3203 3203
             $data = DB::queryfirstrow(
3204 3204
                 'SELECT parent_id, personal_folder
3205
-                FROM ' . prefixTable('nested_tree') . '
3205
+                FROM ' . prefixTable('nested_tree').'
3206 3206
                 WHERE id = %i',
3207 3207
                 $post_folder_id
3208 3208
             );
@@ -3212,20 +3212,20 @@  discard block
 block discarded – undo
3212 3212
             if ($_SESSION['is_admin'] != 1 && $_SESSION['user_manager'] != 1 && $data['personal_folder'] === '0') {
3213 3213
                 $data = DB::queryfirstrow(
3214 3214
                     'SELECT valeur
3215
-                    FROM ' . prefixTable('misc') . '
3215
+                    FROM ' . prefixTable('misc').'
3216 3216
                     WHERE intitule = %i AND type = %s',
3217 3217
                     $data['parent_id'],
3218 3218
                     'complex'
3219 3219
                 );
3220 3220
                 if (intval($dataReceived['complexity']) < intval($data['valeur'])) {
3221
-                    echo '[ { "error" : "' . langHdl('error_folder_complexity_lower_than_top_folder') . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]"} ]';
3221
+                    echo '[ { "error" : "'.langHdl('error_folder_complexity_lower_than_top_folder').' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]"} ]';
3222 3222
                     break;
3223 3223
                 }
3224 3224
             }
3225 3225
 
3226 3226
             // update Folders table
3227 3227
             $tmp = DB::queryFirstRow(
3228
-                'SELECT title, parent_id, personal_folder FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
3228
+                'SELECT title, parent_id, personal_folder FROM '.prefixTable('nested_tree').' WHERE id = %i',
3229 3229
                 $dataReceived['folder']
3230 3230
             );
3231 3231
             if ($tmp['parent_id'] != 0 || $tmp['title'] != $_SESSION['user_id'] || $tmp['personal_folder'] != 1) {
@@ -3289,42 +3289,42 @@  discard block
 block discarded – undo
3289 3289
                     in_array($post_target_folder_id, $_SESSION['groupes_visibles']) === false) && ($post_target_folder_id === '0' &&
3290 3290
                     isset($SETTINGS['can_create_root_folder']) === true && $SETTINGS['can_create_root_folder'] === '1')
3291 3291
             ) {
3292
-                $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3292
+                $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3293 3293
                 echo $returnValues;
3294 3294
                 break;
3295 3295
             }
3296 3296
 
3297 3297
             $tmp_source = DB::queryFirstRow(
3298 3298
                 'SELECT title, parent_id, personal_folder
3299
-                FROM ' . prefixTable('nested_tree') . '
3299
+                FROM ' . prefixTable('nested_tree').'
3300 3300
                 WHERE id = %i',
3301 3301
                 $post_source_folder_id
3302 3302
             );
3303 3303
 
3304 3304
             $tmp_target = DB::queryFirstRow(
3305 3305
                 'SELECT title, parent_id, personal_folder
3306
-                FROM ' . prefixTable('nested_tree') . '
3306
+                FROM ' . prefixTable('nested_tree').'
3307 3307
                 WHERE id = %i',
3308 3308
                 $post_target_folder_id
3309 3309
             );
3310 3310
 
3311 3311
             // check if target is not a child of source
3312 3312
             if ($tree->isChildOf($post_target_folder_id, $post_source_folder_id) === true) {
3313
-                $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3313
+                $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3314 3314
                 echo $returnValues;
3315 3315
                 break;
3316 3316
             }
3317 3317
 
3318 3318
             // check if source or target folder is PF. If Yes, then cancel operation
3319 3319
             if ($tmp_source['personal_folder'] === '1' || $tmp_target['personal_folder'] === '1') {
3320
-                $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3320
+                $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3321 3321
                 echo $returnValues;
3322 3322
                 break;
3323 3323
             }
3324 3324
 
3325 3325
             // check if source or target folder is PF. If Yes, then cancel operation
3326 3326
             if ($tmp_source['title'] === $_SESSION['user_id'] || $tmp_target['title'] === $_SESSION['user_id']) {
3327
-                $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]';
3327
+                $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]';
3328 3328
                 echo $returnValues;
3329 3329
                 break;
3330 3330
             }
@@ -3447,7 +3447,7 @@  discard block
 block discarded – undo
3447 3447
                 foreach ($_SESSION['user_roles'] as $role) {
3448 3448
                     $roleQ = DB::queryfirstrow(
3449 3449
                         'SELECT allow_pw_change
3450
-                        FROM ' . prefixTable('roles_title') . '
3450
+                        FROM ' . prefixTable('roles_title').'
3451 3451
                         WHERE id = %i',
3452 3452
                         $role
3453 3453
                     );
@@ -3472,11 +3472,11 @@  discard block
 block discarded – undo
3472 3472
                     
3473 3473
                     foreach ($_SESSION['user_roles'] as $role) {
3474 3474
                         $access = DB::queryFirstRow(
3475
-                            'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i',
3475
+                            'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i',
3476 3476
                             $role,
3477 3477
                             $post_id
3478 3478
                         );
3479
-                        if (DB::count()>0) {
3479
+                        if (DB::count() > 0) {
3480 3480
                             if ($access['type'] === 'R') {
3481 3481
                                 array_push($arrTmp, 10);
3482 3482
                             } elseif ($access['type'] === 'W') {
@@ -3540,7 +3540,7 @@  discard block
 block discarded – undo
3540 3540
                 } else {
3541 3541
                     DB::query(
3542 3542
                         'SELECT *
3543
-                        FROM ' . prefixTable('items') . '
3543
+                        FROM ' . prefixTable('items').'
3544 3544
                         WHERE inactif = %i',
3545 3545
                         0
3546 3546
                     );
@@ -3551,7 +3551,7 @@  discard block
 block discarded – undo
3551 3551
 
3552 3552
                 // Get folder complexity
3553 3553
                 $folderComplexity = DB::queryFirstRow(
3554
-                    'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %i',
3554
+                    'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %i',
3555 3555
                     'complex',
3556 3556
                     $post_id
3557 3557
                 );
@@ -3563,7 +3563,7 @@  discard block
 block discarded – undo
3563 3563
                 if (isset($SETTINGS['item_extra_fields']) && $SETTINGS['item_extra_fields'] === '1') {
3564 3564
                     $folderRow = DB::query(
3565 3565
                         'SELECT id_category
3566
-                        FROM ' . prefixTable('categories_folders') . '
3566
+                        FROM ' . prefixTable('categories_folders').'
3567 3567
                         WHERE id_folder = %i',
3568 3568
                         $post_id
3569 3569
                     );
@@ -3680,13 +3680,13 @@  discard block
 block discarded – undo
3680 3680
                 // List all ITEMS
3681 3681
                 if ($folderIsPf === false) {
3682 3682
                     $where->add('i.inactif=%i', 0);
3683
-                    $where->add('l.date=%l', '(SELECT date FROM ' . prefixTable('log_items') . " WHERE action IN ('at_creation', 'at_modification') AND id_item=i.id ORDER BY date DESC LIMIT 1)");
3683
+                    $where->add('l.date=%l', '(SELECT date FROM '.prefixTable('log_items')." WHERE action IN ('at_creation', 'at_modification') AND id_item=i.id ORDER BY date DESC LIMIT 1)");
3684 3684
                     if (empty($limited_to_items) === false) {
3685 3685
                         $where->add('i.id IN %ls', explode(',', $limited_to_items));
3686 3686
                     }
3687 3687
 
3688
-                    $query_limit = ' LIMIT ' .
3689
-                        $start . ',' .
3688
+                    $query_limit = ' LIMIT '.
3689
+                        $start.','.
3690 3690
                         $post_nb_items_to_display_once;
3691 3691
                     //db::debugmode(true);
3692 3692
                     $rows = DB::query(
@@ -3697,9 +3697,9 @@  discard block
 block discarded – undo
3697 3697
                         MIN(l.action) AS log_action,
3698 3698
                         l.id_user AS log_user,
3699 3699
                         i.url AS link
3700
-                        FROM ' . prefixTable('items') . ' AS i
3701
-                        INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
3702
-                        INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item)
3700
+                        FROM ' . prefixTable('items').' AS i
3701
+                        INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
3702
+                        INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item)
3703 3703
                         WHERE %l
3704 3704
                         GROUP BY i.id, l.date, l.id_user, l.action
3705 3705
                         ORDER BY i.label ASC, l.date DESC' . $query_limit,
@@ -3718,9 +3718,9 @@  discard block
 block discarded – undo
3718 3718
                         MIN(l.action) AS log_action,
3719 3719
                         l.id_user AS log_user,
3720 3720
                         i.url AS link
3721
-                        FROM ' . prefixTable('items') . ' AS i
3722
-                        INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id)
3723
-                        INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item)
3721
+                        FROM ' . prefixTable('items').' AS i
3722
+                        INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id)
3723
+                        INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item)
3724 3724
                         WHERE %l
3725 3725
                         GROUP BY i.id, l.date, l.id_user, l.action
3726 3726
                         ORDER BY i.label ASC, l.date DESC',
@@ -3752,7 +3752,7 @@  discard block
 block discarded – undo
3752 3752
                         $item_is_restricted_to_role = false;
3753 3753
                         DB::queryfirstrow(
3754 3754
                             'SELECT role_id
3755
-                            FROM ' . prefixTable('restriction_to_roles') . '
3755
+                            FROM ' . prefixTable('restriction_to_roles').'
3756 3756
                             WHERE item_id = %i',
3757 3757
                             $record['id']
3758 3758
                         );
@@ -3764,7 +3764,7 @@  discard block
 block discarded – undo
3764 3764
                         $user_is_included_in_role = false;
3765 3765
                         $roles = DB::query(
3766 3766
                             'SELECT role_id
3767
-                            FROM ' . prefixTable('restriction_to_roles') . '
3767
+                            FROM ' . prefixTable('restriction_to_roles').'
3768 3768
                             WHERE item_id = %i AND role_id IN %ls',
3769 3769
                             $record['id'],
3770 3770
                             $_SESSION['user_roles']
@@ -3972,9 +3972,9 @@  discard block
 block discarded – undo
3972 3972
             if ((int) $start === 0) {
3973 3973
                 DB::query(
3974 3974
                     'SELECT i.id
3975
-                    FROM ' . prefixTable('items') . ' as i
3976
-                    INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
3977
-                    INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
3975
+                    FROM ' . prefixTable('items').' as i
3976
+                    INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
3977
+                    INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
3978 3978
                     WHERE %l
3979 3979
                     ORDER BY i.label ASC, l.date DESC',
3980 3980
                     $where
@@ -4042,8 +4042,8 @@  discard block
 block discarded – undo
4042 4042
             // Run query
4043 4043
             $dataItem = DB::queryfirstrow(
4044 4044
                 'SELECT i.pw AS pw, s.share_key AS share_key
4045
-                FROM ' . prefixTable('items') . ' AS i
4046
-                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
4045
+                FROM ' . prefixTable('items').' AS i
4046
+                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
4047 4047
                 WHERE user_id = %i AND i.id = %i',
4048 4048
                 $_SESSION['user_id'],
4049 4049
                 $post_item_id
@@ -4086,7 +4086,7 @@  discard block
 block discarded – undo
4086 4086
             if (null !== $post_item_id && empty($post_item_id) === false) {
4087 4087
                 $dataItem = DB::queryfirstrow(
4088 4088
                     'SELECT perso, anyone_can_modify
4089
-                    FROM ' . prefixTable('items') . '
4089
+                    FROM ' . prefixTable('items').'
4090 4090
                     WHERE id=%i',
4091 4091
                     $post_item_id
4092 4092
                 );
@@ -4123,7 +4123,7 @@  discard block
 block discarded – undo
4123 4123
                 */
4124 4124
 
4125 4125
                 // Lock Item (if already locked), go back and warn
4126
-                $dataTmp = DB::queryFirstRow('SELECT timestamp, user_id FROM ' . prefixTable('items_edition') . ' WHERE item_id = %i', $post_item_id);
4126
+                $dataTmp = DB::queryFirstRow('SELECT timestamp, user_id FROM '.prefixTable('items_edition').' WHERE item_id = %i', $post_item_id);
4127 4127
 
4128 4128
                 // If token is taken for this Item and delay is passed then delete it.
4129 4129
                 if (
@@ -4134,7 +4134,7 @@  discard block
 block discarded – undo
4134 4134
                     DB::delete(prefixTable('items_edition'), 'item_id = %i', $post_item_id);
4135 4135
                     //reload the previous data
4136 4136
                     $dataTmp = DB::queryFirstRow(
4137
-                        'SELECT timestamp, user_id FROM ' . prefixTable('items_edition') . ' WHERE item_id = %i',
4137
+                        'SELECT timestamp, user_id FROM '.prefixTable('items_edition').' WHERE item_id = %i',
4138 4138
                         $post_item_id
4139 4139
                     );
4140 4140
                 }
@@ -4174,7 +4174,7 @@  discard block
 block discarded – undo
4174 4174
             // do query on this folder
4175 4175
             $data_this_folder = DB::queryFirstRow(
4176 4176
                 'SELECT id, personal_folder, title
4177
-                FROM ' . prefixTable('nested_tree') . '
4177
+                FROM ' . prefixTable('nested_tree').'
4178 4178
                 WHERE id = %s',
4179 4179
                 $post_groupe
4180 4180
             );
@@ -4211,8 +4211,8 @@  discard block
 block discarded – undo
4211 4211
             $visibilite = '';
4212 4212
             $data = DB::queryFirstRow(
4213 4213
                 'SELECT m.valeur, n.personal_folder
4214
-                FROM ' . prefixTable('misc') . ' AS m
4215
-                INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (m.intitule = n.id)
4214
+                FROM ' . prefixTable('misc').' AS m
4215
+                INNER JOIN ' . prefixTable('nested_tree').' AS n ON (m.intitule = n.id)
4216 4216
                 WHERE type=%s AND intitule = %s',
4217 4217
                 'complex',
4218 4218
                 $post_groupe
@@ -4225,8 +4225,8 @@  discard block
 block discarded – undo
4225 4225
                 // Prepare Item actual visibility (what Users/Roles can see it)
4226 4226
                 $rows = DB::query(
4227 4227
                     'SELECT t.title
4228
-                    FROM ' . prefixTable('roles_values') . ' as v
4229
-                    INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id)
4228
+                    FROM ' . prefixTable('roles_values').' as v
4229
+                    INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id)
4230 4230
                     WHERE v.folder_id = %i
4231 4231
                     GROUP BY title',
4232 4232
                     $post_groupe
@@ -4235,7 +4235,7 @@  discard block
 block discarded – undo
4235 4235
                     if (empty($visibilite)) {
4236 4236
                         $visibilite = $record['title'];
4237 4237
                     } else {
4238
-                        $visibilite .= ' - ' . $record['title'];
4238
+                        $visibilite .= ' - '.$record['title'];
4239 4239
                     }
4240 4240
                 }
4241 4241
             } else {
@@ -4245,14 +4245,14 @@  discard block
 block discarded – undo
4245 4245
                 // do new query to know if current folder is pf
4246 4246
                 $data_pf = DB::queryFirstRow(
4247 4247
                     'SELECT personal_folder
4248
-                    FROM ' . prefixTable('nested_tree') . '
4248
+                    FROM ' . prefixTable('nested_tree').'
4249 4249
                     WHERE id = %s',
4250 4250
                     $post_groupe
4251 4251
                 );
4252 4252
                 
4253 4253
                 $folder_is_personal = $data_pf !== null ? (int) $data_pf['personal_folder'] : 0;
4254 4254
                 
4255
-                $visibilite = $_SESSION['name'] . ' ' . $_SESSION['lastname'] . ' (' . $_SESSION['login'] . ')';
4255
+                $visibilite = $_SESSION['name'].' '.$_SESSION['lastname'].' ('.$_SESSION['login'].')';
4256 4256
             }
4257 4257
 
4258 4258
             recupDroitCreationSansComplexite($post_groupe);
@@ -4262,8 +4262,8 @@  discard block
 block discarded – undo
4262 4262
             $listOptionsForRoles = array();
4263 4263
             $rows = DB::query(
4264 4264
                 'SELECT r.role_id AS role_id, t.title AS title
4265
-                FROM ' . prefixTable('roles_values') . ' AS r
4266
-                INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id)
4265
+                FROM ' . prefixTable('roles_values').' AS r
4266
+                INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id)
4267 4267
                 WHERE r.folder_id = %i',
4268 4268
                 $post_groupe
4269 4269
             );
@@ -4277,7 +4277,7 @@  discard block
 block discarded – undo
4277 4277
                 );
4278 4278
                 $rows2 = DB::query(
4279 4279
                     'SELECT id, login, fonction_id, email, name, lastname
4280
-                    FROM ' . prefixTable('users') . '
4280
+                    FROM ' . prefixTable('users').'
4281 4281
                     WHERE admin = 0'
4282 4282
                 );
4283 4283
                 foreach ($rows2 as $record2) {
@@ -4291,7 +4291,7 @@  discard block
 block discarded – undo
4291 4291
                                 array(
4292 4292
                                     'id' => $record2['id'],
4293 4293
                                     'login' => $record2['login'],
4294
-                                    'name' => $record2['name'] . ' ' . $record2['lastname'],
4294
+                                    'name' => $record2['name'].' '.$record2['lastname'],
4295 4295
                                     'email' => $record2['email'],
4296 4296
                                 )
4297 4297
                             );
@@ -4308,13 +4308,13 @@  discard block
 block discarded – undo
4308 4308
 					//db::debugmode(true);
4309 4309
 					$access = DB::queryFirstRow(
4310 4310
 						'SELECT type
4311
-						FROM ' . prefixTable('roles_values') . '
4311
+						FROM ' . prefixTable('roles_values').'
4312 4312
 						WHERE role_id = %i AND folder_id = %i',
4313 4313
 						$role,
4314 4314
 						$post_groupe
4315 4315
 					);
4316 4316
 					//db::debugmode(false);
4317
-                    if (DB::count()>0) {
4317
+                    if (DB::count() > 0) {
4318 4318
                         if ($access['type'] === 'R') {
4319 4319
                             array_push($arrTmp, 10);
4320 4320
                         } elseif ($access['type'] === 'W') {
@@ -4384,7 +4384,7 @@  discard block
 block discarded – undo
4384 4384
             // Get some info before deleting
4385 4385
             $data = DB::queryFirstRow(
4386 4386
                 'SELECT name, id_item, file
4387
-                FROM ' . prefixTable('files') . '
4387
+                FROM ' . prefixTable('files').'
4388 4388
                 WHERE id = %i',
4389 4389
                 $fileId
4390 4390
             );
@@ -4392,7 +4392,7 @@  discard block
 block discarded – undo
4392 4392
             // Load item data
4393 4393
             $data_item = DB::queryFirstRow(
4394 4394
                 'SELECT id_tree
4395
-                FROM ' . prefixTable('items') . '
4395
+                FROM ' . prefixTable('items').'
4396 4396
                 WHERE id = %i',
4397 4397
                 $data['id_item']
4398 4398
             );
@@ -4419,7 +4419,7 @@  discard block
 block discarded – undo
4419 4419
                     $_SESSION['user_id'],
4420 4420
                     'at_modification',
4421 4421
                     $_SESSION['login'],
4422
-                    'at_del_file : ' . $data['name']
4422
+                    'at_del_file : '.$data['name']
4423 4423
                 );
4424 4424
 
4425 4425
                 // DElete sharekeys
@@ -4430,7 +4430,7 @@  discard block
 block discarded – undo
4430 4430
                 );
4431 4431
 
4432 4432
                 // Delete file from server
4433
-                fileDelete($SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($data['file']), $SETTINGS);
4433
+                fileDelete($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($data['file']), $SETTINGS);
4434 4434
             }
4435 4435
 
4436 4436
             echo (string) prepareExchangedData(
@@ -4449,7 +4449,7 @@  discard block
 block discarded – undo
4449 4449
         case 'clear_html_tags':
4450 4450
             // Get information for this item
4451 4451
             $dataItem = DB::queryfirstrow(
4452
-                'SELECT description FROM ' . prefixTable('items') . ' WHERE id=%i',
4452
+                'SELECT description FROM '.prefixTable('items').' WHERE id=%i',
4453 4453
                 filter_input(INPUT_POST, 'id_item', FILTER_SANITIZE_NUMBER_INT)
4454 4454
             );
4455 4455
             // Clean up the string
@@ -4487,12 +4487,12 @@  discard block
 block discarded – undo
4487 4487
                 // Update SESSION with this new favourite
4488 4488
                 $data = DB::queryfirstrow(
4489 4489
                     'SELECT label,id_tree
4490
-                    FROM ' . prefixTable('items') . '
4490
+                    FROM ' . prefixTable('items').'
4491 4491
                     WHERE id = ' . mysqli_real_escape_string($link, $post_item_id)
4492 4492
                 );
4493 4493
                 $_SESSION['favourites_tab'][$post_item_id] = array(
4494 4494
                     'label' => $data['label'],
4495
-                    'url' => 'index.php?page=items&amp;group=' . $data['id_tree'] . '&amp;id=' . $post_item_id,
4495
+                    'url' => 'index.php?page=items&amp;group='.$data['id_tree'].'&amp;id='.$post_item_id,
4496 4496
                 );
4497 4497
             } elseif ((int) filter_input(INPUT_POST, 'action', FILTER_SANITIZE_NUMBER_INT) === 1) {
4498 4498
                 // delete from session
@@ -4560,8 +4560,8 @@  discard block
 block discarded – undo
4560 4560
             // get data about item
4561 4561
             $dataSource = DB::queryfirstrow(
4562 4562
                 'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label
4563
-                FROM ' . prefixTable('items') . ' as i
4564
-                INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id)
4563
+                FROM ' . prefixTable('items').' as i
4564
+                INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id)
4565 4565
                 WHERE i.id=%i',
4566 4566
                 $post_item_id
4567 4567
             );
@@ -4569,7 +4569,7 @@  discard block
 block discarded – undo
4569 4569
             // get data about new folder
4570 4570
             $dataDestination = DB::queryfirstrow(
4571 4571
                 'SELECT personal_folder, title
4572
-                FROM ' . prefixTable('nested_tree') . '
4572
+                FROM ' . prefixTable('nested_tree').'
4573 4573
                 WHERE id = %i',
4574 4574
                 $post_folder_id
4575 4575
             );
@@ -4621,7 +4621,7 @@  discard block
 block discarded – undo
4621 4621
                 // Get fields for this Item
4622 4622
                 $rows = DB::query(
4623 4623
                     'SELECT id
4624
-                    FROM ' . prefixTable('categories_items') . '
4624
+                    FROM ' . prefixTable('categories_items').'
4625 4625
                     WHERE item_id = %i',
4626 4626
                     $post_item_id
4627 4627
                 );
@@ -4638,7 +4638,7 @@  discard block
 block discarded – undo
4638 4638
                 // Get FILES for this Item
4639 4639
                 $rows = DB::query(
4640 4640
                     'SELECT id
4641
-                    FROM ' . prefixTable('files') . '
4641
+                    FROM ' . prefixTable('files').'
4642 4642
                     WHERE id_item = %i',
4643 4643
                     $post_item_id
4644 4644
                 );
@@ -4683,7 +4683,7 @@  discard block
 block discarded – undo
4683 4683
                 // Get the ITEM object key for the user
4684 4684
                 $userKey = DB::queryFirstRow(
4685 4685
                     'SELECT share_key
4686
-                    FROM ' . prefixTable('sharekeys_items') . '
4686
+                    FROM ' . prefixTable('sharekeys_items').'
4687 4687
                     WHERE user_id = %i AND object_id = %i',
4688 4688
                     $_SESSION['user_id'],
4689 4689
                     $post_item_id
@@ -4694,8 +4694,8 @@  discard block
 block discarded – undo
4694 4694
                     // This is a public object
4695 4695
                     $users = DB::query(
4696 4696
                         'SELECT id, public_key
4697
-                        FROM ' . prefixTable('users') . '
4698
-                        WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
4697
+                        FROM ' . prefixTable('users').'
4698
+                        WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
4699 4699
                         AND public_key != ""'
4700 4700
                     );
4701 4701
                     foreach ($users as $user) {
@@ -4715,14 +4715,14 @@  discard block
 block discarded – undo
4715 4715
                 // Get fields for this Item
4716 4716
                 $rows = DB::query(
4717 4717
                     'SELECT id
4718
-                    FROM ' . prefixTable('categories_items') . '
4718
+                    FROM ' . prefixTable('categories_items').'
4719 4719
                     WHERE item_id = %i',
4720 4720
                     $post_item_id
4721 4721
                 );
4722 4722
                 foreach ($rows as $field) {
4723 4723
                     $userKey = DB::queryFirstRow(
4724 4724
                         'SELECT share_key
4725
-                        FROM ' . prefixTable('sharekeys_fields') . '
4725
+                        FROM ' . prefixTable('sharekeys_fields').'
4726 4726
                         WHERE user_id = %i AND object_id = %i',
4727 4727
                         $_SESSION['user_id'],
4728 4728
                         $field['id']
@@ -4733,8 +4733,8 @@  discard block
 block discarded – undo
4733 4733
                         // This is a public object
4734 4734
                         $users = DB::query(
4735 4735
                             'SELECT id, public_key
4736
-                            FROM ' . prefixTable('users') . '
4737
-                            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
4736
+                            FROM ' . prefixTable('users').'
4737
+                            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
4738 4738
                             AND public_key != ""'
4739 4739
                         );
4740 4740
                         foreach ($users as $user) {
@@ -4755,14 +4755,14 @@  discard block
 block discarded – undo
4755 4755
                 // Get FILES for this Item
4756 4756
                 $rows = DB::query(
4757 4757
                     'SELECT id
4758
-                    FROM ' . prefixTable('files') . '
4758
+                    FROM ' . prefixTable('files').'
4759 4759
                     WHERE id_item = %i',
4760 4760
                     $post_item_id
4761 4761
                 );
4762 4762
                 foreach ($rows as $attachment) {
4763 4763
                     $userKey = DB::queryFirstRow(
4764 4764
                         'SELECT share_key
4765
-                        FROM ' . prefixTable('sharekeys_files') . '
4765
+                        FROM ' . prefixTable('sharekeys_files').'
4766 4766
                         WHERE user_id = %i AND object_id = %i',
4767 4767
                         $_SESSION['user_id'],
4768 4768
                         $attachment['id']
@@ -4773,8 +4773,8 @@  discard block
 block discarded – undo
4773 4773
                         // This is a public object
4774 4774
                         $users = DB::query(
4775 4775
                             'SELECT id, public_key
4776
-                            FROM ' . prefixTable('users') . '
4777
-                            WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
4776
+                            FROM ' . prefixTable('users').'
4777
+                            WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
4778 4778
                             AND public_key != ""'
4779 4779
                         );
4780 4780
                         foreach ($users as $user) {
@@ -4811,7 +4811,7 @@  discard block
 block discarded – undo
4811 4811
                 $_SESSION['user_id'],
4812 4812
                 'at_modification',
4813 4813
                 $_SESSION['login'],
4814
-                'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title']
4814
+                'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title']
4815 4815
             );
4816 4816
 
4817 4817
             $returnValues = array(
@@ -4863,8 +4863,8 @@  discard block
 block discarded – undo
4863 4863
                     // get data about item
4864 4864
                     $dataSource = DB::queryfirstrow(
4865 4865
                         'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label
4866
-                        FROM ' . prefixTable('items') . ' as i
4867
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id)
4866
+                        FROM ' . prefixTable('items').' as i
4867
+                        INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id)
4868 4868
                         WHERE i.id=%i',
4869 4869
                         $item_id
4870 4870
                     );
@@ -4886,7 +4886,7 @@  discard block
 block discarded – undo
4886 4886
 
4887 4887
                     // get data about new folder
4888 4888
                     $dataDestination = DB::queryfirstrow(
4889
-                        'SELECT personal_folder, title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
4889
+                        'SELECT personal_folder, title FROM '.prefixTable('nested_tree').' WHERE id = %i',
4890 4890
                         $post_folder_id
4891 4891
                     );
4892 4892
 
@@ -4927,7 +4927,7 @@  discard block
 block discarded – undo
4927 4927
                         // Get fields for this Item
4928 4928
                         $rows = DB::query(
4929 4929
                             'SELECT id
4930
-                            FROM ' . prefixTable('categories_items') . '
4930
+                            FROM ' . prefixTable('categories_items').'
4931 4931
                             WHERE item_id = %i',
4932 4932
                             $item_id
4933 4933
                         );
@@ -4944,7 +4944,7 @@  discard block
 block discarded – undo
4944 4944
                         // Get FILES for this Item
4945 4945
                         $rows = DB::query(
4946 4946
                             'SELECT id
4947
-                            FROM ' . prefixTable('files') . '
4947
+                            FROM ' . prefixTable('files').'
4948 4948
                             WHERE id_item = %i',
4949 4949
                             $item_id
4950 4950
                         );
@@ -4997,7 +4997,7 @@  discard block
 block discarded – undo
4997 4997
                         // Get the ITEM object key for the user
4998 4998
                         $userKey = DB::queryFirstRow(
4999 4999
                             'SELECT share_key
5000
-                            FROM ' . prefixTable('sharekeys_items') . '
5000
+                            FROM ' . prefixTable('sharekeys_items').'
5001 5001
                             WHERE user_id = %i AND object_id = %i',
5002 5002
                             $_SESSION['user_id'],
5003 5003
                             $item_id
@@ -5008,8 +5008,8 @@  discard block
 block discarded – undo
5008 5008
                             // This is a public object
5009 5009
                             $users = DB::query(
5010 5010
                                 'SELECT id, public_key
5011
-                                FROM ' . prefixTable('users') . '
5012
-                                WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
5011
+                                FROM ' . prefixTable('users').'
5012
+                                WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
5013 5013
                                 AND public_key != ""'
5014 5014
                             );
5015 5015
                             foreach ($users as $user) {
@@ -5029,14 +5029,14 @@  discard block
 block discarded – undo
5029 5029
                         // Get fields for this Item
5030 5030
                         $rows = DB::query(
5031 5031
                             'SELECT id
5032
-                            FROM ' . prefixTable('categories_items') . '
5032
+                            FROM ' . prefixTable('categories_items').'
5033 5033
                             WHERE item_id = %i',
5034 5034
                             $item_id
5035 5035
                         );
5036 5036
                         foreach ($rows as $field) {
5037 5037
                             $userKey = DB::queryFirstRow(
5038 5038
                                 'SELECT share_key
5039
-                                FROM ' . prefixTable('sharekeys_fields') . '
5039
+                                FROM ' . prefixTable('sharekeys_fields').'
5040 5040
                                 WHERE user_id = %i AND object_id = %i',
5041 5041
                                 $_SESSION['user_id'],
5042 5042
                                 $field['id']
@@ -5047,8 +5047,8 @@  discard block
 block discarded – undo
5047 5047
                                 // This is a public object
5048 5048
                                 $users = DB::query(
5049 5049
                                     'SELECT id, public_key
5050
-                                    FROM ' . prefixTable('users') . '
5051
-                                    WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
5050
+                                    FROM ' . prefixTable('users').'
5051
+                                    WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
5052 5052
                                     AND public_key != ""'
5053 5053
                                 );
5054 5054
                                 foreach ($users as $user) {
@@ -5069,14 +5069,14 @@  discard block
 block discarded – undo
5069 5069
                         // Get FILES for this Item
5070 5070
                         $rows = DB::query(
5071 5071
                             'SELECT id
5072
-                            FROM ' . prefixTable('files') . '
5072
+                            FROM ' . prefixTable('files').'
5073 5073
                             WHERE id_item = %i',
5074 5074
                             $item_id
5075 5075
                         );
5076 5076
                         foreach ($rows as $attachment) {
5077 5077
                             $userKey = DB::queryFirstRow(
5078 5078
                                 'SELECT share_key
5079
-                                FROM ' . prefixTable('sharekeys_files') . '
5079
+                                FROM ' . prefixTable('sharekeys_files').'
5080 5080
                                 WHERE user_id = %i AND object_id = %i',
5081 5081
                                 $_SESSION['user_id'],
5082 5082
                                 $attachment['id']
@@ -5087,8 +5087,8 @@  discard block
 block discarded – undo
5087 5087
                                 // This is a public object
5088 5088
                                 $users = DB::query(
5089 5089
                                     'SELECT id, public_key
5090
-                                    FROM ' . prefixTable('users') . '
5091
-                                    WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '")
5090
+                                    FROM ' . prefixTable('users').'
5091
+                                    WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'")
5092 5092
                                     AND public_key != ""'
5093 5093
                                 );
5094 5094
                                 foreach ($users as $user) {
@@ -5124,13 +5124,13 @@  discard block
 block discarded – undo
5124 5124
                         $_SESSION['user_id'],
5125 5125
                         'at_modification',
5126 5126
                         $_SESSION['login'],
5127
-                        'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title']
5127
+                        'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title']
5128 5128
                     );
5129 5129
                 }
5130 5130
             }
5131 5131
 
5132 5132
             // reload cache table
5133
-            require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
5133
+            require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
5134 5134
             updateCacheTable('reload', $SETTINGS, '');
5135 5135
 
5136 5136
             echo (string) prepareExchangedData(
@@ -5193,7 +5193,7 @@  discard block
 block discarded – undo
5193 5193
                     // get info
5194 5194
                     $dataSource = DB::queryfirstrow(
5195 5195
                         'SELECT label, id_tree
5196
-                        FROM ' . prefixTable('items') . '
5196
+                        FROM ' . prefixTable('items').'
5197 5197
                         WHERE id=%i',
5198 5198
                         $item_id
5199 5199
                     );
@@ -5292,8 +5292,8 @@  discard block
 block discarded – undo
5292 5292
                     $content = explode(',', filter_input(INPUT_POST, 'content', FILTER_SANITIZE_STRING));
5293 5293
                 }
5294 5294
                 // Variables
5295
-                $dataAuthor = DB::queryfirstrow('SELECT email,login FROM ' . prefixTable('users') . ' WHERE id= ' . $content[1]);
5296
-                $dataItem = DB::queryfirstrow('SELECT label, id_tree FROM ' . prefixTable('items') . ' WHERE id= ' . $content[0]);
5295
+                $dataAuthor = DB::queryfirstrow('SELECT email,login FROM '.prefixTable('users').' WHERE id= '.$content[1]);
5296
+                $dataItem = DB::queryfirstrow('SELECT label, id_tree FROM '.prefixTable('items').' WHERE id= '.$content[0]);
5297 5297
 
5298 5298
                 // Get path
5299 5299
                 $path = geItemReadablePath(
@@ -5307,7 +5307,7 @@  discard block
 block discarded – undo
5307 5307
                         langHdl('email_request_access_subject'),
5308 5308
                         str_replace(
5309 5309
                             array('#tp_item_author#', '#tp_user#', '#tp_item#'),
5310
-                            array(' ' . addslashes($dataAuthor['login']), addslashes($_SESSION['login']), $path),
5310
+                            array(' '.addslashes($dataAuthor['login']), addslashes($_SESSION['login']), $path),
5311 5311
                             langHdl('email_request_access_mail')
5312 5312
                         ),
5313 5313
                         $dataAuthor['email'],
@@ -5318,7 +5318,7 @@  discard block
 block discarded – undo
5318 5318
             } elseif ($post_cat === 'share_this_item') {
5319 5319
                 $dataItem = DB::queryfirstrow(
5320 5320
                     'SELECT label,id_tree
5321
-                    FROM ' . prefixTable('items') . '
5321
+                    FROM ' . prefixTable('items').'
5322 5322
                     WHERE id= %i',
5323 5323
                     $post_id
5324 5324
                 );
@@ -5342,7 +5342,7 @@  discard block
 block discarded – undo
5342 5342
                             ),
5343 5343
                             array(
5344 5344
                                 empty($SETTINGS['email_server_url']) === false ?
5345
-                                    $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $post_id : $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $post_id,
5345
+                                    $SETTINGS['email_server_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$post_id : $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$post_id,
5346 5346
                                 addslashes($_SESSION['login']),
5347 5347
                                 addslashes($path),
5348 5348
                             ),
@@ -5377,7 +5377,7 @@  discard block
 block discarded – undo
5377 5377
                 if (filter_input(INPUT_POST, 'notify_type', FILTER_SANITIZE_STRING) === 'on_show') {
5378 5378
                     // Check if values already exist
5379 5379
                     $data = DB::queryfirstrow(
5380
-                        'SELECT notification FROM ' . prefixTable('items') . ' WHERE id = %i',
5380
+                        'SELECT notification FROM '.prefixTable('items').' WHERE id = %i',
5381 5381
                         $post_item_id
5382 5382
                     );
5383 5383
                     $notifiedUsers = explode(';', $data['notification']);
@@ -5388,8 +5388,8 @@  discard block
 block discarded – undo
5388 5388
                             prefixTable('items'),
5389 5389
                             array(
5390 5390
                                 'notification' => empty($data['notification']) ?
5391
-                                    filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT) . ';'
5392
-                                    : $data['notification'] . filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT),
5391
+                                    filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT).';'
5392
+                                    : $data['notification'].filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT),
5393 5393
                             ),
5394 5394
                             'id=%i',
5395 5395
                             $post_item_id
@@ -5404,7 +5404,7 @@  discard block
 block discarded – undo
5404 5404
                             array(
5405 5405
                                 'notification' => empty($data['notification']) ?
5406 5406
                                     filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT)
5407
-                                    : $data['notification'] . ';' . filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT),
5407
+                                    : $data['notification'].';'.filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT),
5408 5408
                             ),
5409 5409
                             'id=%i',
5410 5410
                             $post_item_id
@@ -5429,8 +5429,8 @@  discard block
 block discarded – undo
5429 5429
                 // Get all informations for this item
5430 5430
                 $dataItem = DB::queryfirstrow(
5431 5431
                     'SELECT *
5432
-                    FROM ' . prefixTable('items') . ' as i
5433
-                    INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id)
5432
+                    FROM ' . prefixTable('items').' as i
5433
+                    INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id)
5434 5434
                     WHERE i.id=%i AND l.action = %s',
5435 5435
                     $dataReceived['item_id'],
5436 5436
                     'at_creation'
@@ -5466,14 +5466,14 @@  discard block
 block discarded – undo
5466 5466
                     );
5467 5467
                     // Prepare new line
5468 5468
                     $data = DB::queryfirstrow(
5469
-                        'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i ORDER BY date DESC',
5469
+                        'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i ORDER BY date DESC',
5470 5470
                         $dataReceived['item_id']
5471 5471
                     );
5472
-                    $historic = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $data['date']) . ' - ' . $_SESSION['login'] . ' - ' . langHdl($data['action']) . ' - ' . $data['raison'];
5472
+                    $historic = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $data['date']).' - '.$_SESSION['login'].' - '.langHdl($data['action']).' - '.$data['raison'];
5473 5473
                     // send back
5474 5474
                     $data = array(
5475 5475
                         'error' => '',
5476
-                        'new_line' => '<br>' . addslashes($historic),
5476
+                        'new_line' => '<br>'.addslashes($historic),
5477 5477
                     );
5478 5478
                     echo (string) prepareExchangedData($data, 'encode');
5479 5479
                 } else {
@@ -5508,7 +5508,7 @@  discard block
 block discarded – undo
5508 5508
         */
5509 5509
         case 'is_item_changed':
5510 5510
             $data = DB::queryFirstRow(
5511
-                'SELECT date FROM ' . prefixTable('log_items') . ' WHERE action = %s AND id_item = %i ORDER BY date DESC',
5511
+                'SELECT date FROM '.prefixTable('log_items').' WHERE action = %s AND id_item = %i ORDER BY date DESC',
5512 5512
                 'at_modification',
5513 5513
                 $post_item_id
5514 5514
             );
@@ -5532,7 +5532,7 @@  discard block
 block discarded – undo
5532 5532
             }
5533 5533
 
5534 5534
             // delete all existing old otv codes
5535
-            $rows = DB::query('SELECT id FROM ' . prefixTable('otv') . ' WHERE timestamp < ' . (time() - $SETTINGS['otv_expiration_period'] * 86400));
5535
+            $rows = DB::query('SELECT id FROM '.prefixTable('otv').' WHERE timestamp < '.(time() - $SETTINGS['otv_expiration_period'] * 86400));
5536 5536
             foreach ($rows as $record) {
5537 5537
                 DB::delete(prefixTable('otv'), 'id=%i', $record['id']);
5538 5538
             }
@@ -5554,8 +5554,8 @@  discard block
 block discarded – undo
5554 5554
             // Should we log a password change?
5555 5555
             $itemQ = DB::queryFirstRow(
5556 5556
                 'SELECT s.share_key, i.pw
5557
-                FROM ' . prefixTable('items') . ' AS i
5558
-                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (i.id = s.object_id)
5557
+                FROM ' . prefixTable('items').' AS i
5558
+                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (i.id = s.object_id)
5559 5559
                 WHERE s.user_id = %i AND s.object_id = %i',
5560 5560
                 $_SESSION['user_id'],
5561 5561
                 $post_id
@@ -5605,8 +5605,8 @@  discard block
 block discarded – undo
5605 5605
             if (isset($SETTINGS['otv_expiration_period']) === false) {
5606 5606
                 $SETTINGS['otv_expiration_period'] = 7;
5607 5607
             }
5608
-            $url = $SETTINGS['cpassman_url'] . '/index.php?otv=true&' . http_build_query($otv_session);
5609
-            $exp_date = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time() + (intval($SETTINGS['otv_expiration_period']) * 86400));
5608
+            $url = $SETTINGS['cpassman_url'].'/index.php?otv=true&'.http_build_query($otv_session);
5609
+            $exp_date = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time() + (intval($SETTINGS['otv_expiration_period']) * 86400));
5610 5610
 
5611 5611
             echo json_encode(
5612 5612
                 array(
@@ -5643,8 +5643,8 @@  discard block
 block discarded – undo
5643 5643
                 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status,
5644 5644
                 f.extension AS extension, f.type AS type,
5645 5645
                 s.share_key AS share_key
5646
-                FROM ' . prefixTable('files') . ' AS f
5647
-                INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
5646
+                FROM ' . prefixTable('files').' AS f
5647
+                INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
5648 5648
                 WHERE s.user_id = %i AND s.object_id = %i',
5649 5649
                 $_SESSION['user_id'],
5650 5650
                 $post_id
@@ -5665,7 +5665,7 @@  discard block
 block discarded – undo
5665 5665
             //$fileName = basename($file_info['name'], '.'.$file_info['extension']);
5666 5666
 
5667 5667
             // prepare image info
5668
-            $post_title = basename($file_info['name'], '.' . $file_info['extension']);
5668
+            $post_title = basename($file_info['name'], '.'.$file_info['extension']);
5669 5669
             $post_title = isBase64($post_title) === true ?
5670 5670
                 base64_decode($post_title) : $post_title;
5671 5671
             $image_code = $file_info['file'];
@@ -5682,7 +5682,7 @@  discard block
 block discarded – undo
5682 5682
             echo (string) prepareExchangedData(
5683 5683
                 array(
5684 5684
                     'error' => false,
5685
-                    'filename' => $post_title . '.' . $file_info['extension'],
5685
+                    'filename' => $post_title.'.'.$file_info['extension'],
5686 5686
                     'file_type' => $file_info['type'],
5687 5687
                     'file_content' => $fileContent,
5688 5688
                 ),
@@ -5703,11 +5703,11 @@  discard block
 block discarded – undo
5703 5703
 
5704 5704
             // get file info
5705 5705
             $result = DB::queryfirstrow(
5706
-                'SELECT file FROM ' . prefixTable('files') . ' WHERE id=%i',
5706
+                'SELECT file FROM '.prefixTable('files').' WHERE id=%i',
5707 5707
                 intval(substr(filter_input(INPUT_POST, 'uri', FILTER_SANITIZE_STRING), 1))
5708 5708
             );
5709 5709
 
5710
-            fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $result['file'] . filter_input(INPUT_POST, 'file_suffix', FILTER_SANITIZE_STRING), $SETTINGS);
5710
+            fileDelete($SETTINGS['path_to_upload_folder'].'/'.$result['file'].filter_input(INPUT_POST, 'file_suffix', FILTER_SANITIZE_STRING), $SETTINGS);
5711 5711
 
5712 5712
             break;
5713 5713
 
@@ -5731,16 +5731,16 @@  discard block
 block discarded – undo
5731 5731
             $idFolder = $dataReceived['idFolder'];
5732 5732
 
5733 5733
             // don't check if Personal Folder
5734
-            $data = DB::queryFirstRow('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', $idFolder);
5734
+            $data = DB::queryFirstRow('SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', $idFolder);
5735 5735
             if ($data['title'] == $_SESSION['user_id']) {
5736 5736
                 // send data
5737
-                echo '[{"duplicate" : "' . $duplicate . '" , error" : ""}]';
5737
+                echo '[{"duplicate" : "'.$duplicate.'" , error" : ""}]';
5738 5738
             } else {
5739 5739
                 if (filter_input(INPUT_POST, 'option', FILTER_SANITIZE_STRING) === 'same_folder') {
5740 5740
                     // case unique folder
5741 5741
                     DB::query(
5742 5742
                         'SELECT label
5743
-                        FROM ' . prefixTable('items') . '
5743
+                        FROM ' . prefixTable('items').'
5744 5744
                         WHERE id_tree = %i AND label = %s',
5745 5745
                         $idFolder,
5746 5746
                         $label
@@ -5753,7 +5753,7 @@  discard block
 block discarded – undo
5753 5753
                     $listPf = '';
5754 5754
                     if (empty($row['id']) === false) {
5755 5755
                         $rows = DB::query(
5756
-                            'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i',
5756
+                            'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i',
5757 5757
                             '1'
5758 5758
                         );
5759 5759
                         foreach ($rows as $record) {
@@ -5768,12 +5768,12 @@  discard block
 block discarded – undo
5768 5768
                     $where->add('id_tree = %i', $idFolder);
5769 5769
                     $where->add('label = %s', $label);
5770 5770
                     if (empty($arrayPf) === false) {
5771
-                        $where->add('id_tree NOT IN (' . implode(',', $arrayPf) . ')');
5771
+                        $where->add('id_tree NOT IN ('.implode(',', $arrayPf).')');
5772 5772
                     }
5773 5773
 
5774 5774
                     DB::query(
5775 5775
                         'SELECT label
5776
-                        FROM ' . prefixTable('items') . '
5776
+                        FROM ' . prefixTable('items').'
5777 5777
                         WHERE %l',
5778 5778
                         $where
5779 5779
                     );
@@ -5785,7 +5785,7 @@  discard block
 block discarded – undo
5785 5785
                 }
5786 5786
 
5787 5787
                 // send data
5788
-                echo '[{"duplicate" : "' . $duplicate . '" , "error" : ""}]';
5788
+                echo '[{"duplicate" : "'.$duplicate.'" , "error" : ""}]';
5789 5789
             }
5790 5790
             break;
5791 5791
 
@@ -5841,7 +5841,7 @@  discard block
 block discarded – undo
5841 5841
             }
5842 5842
 
5843 5843
             //Build tree
5844
-            $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
5844
+            $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
5845 5845
             $tree->register();
5846 5846
             $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
5847 5847
             $tree->rebuild();
@@ -5894,7 +5894,7 @@  discard block
 block discarded – undo
5894 5894
                             if (empty($arr_data['folders'][$inc]['path']) === true) {
5895 5895
                                 $arr_data['folders'][$inc]['path'] = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
5896 5896
                             } else {
5897
-                                $arr_data['folders'][$inc]['path'] .= ' / ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
5897
+                                $arr_data['folders'][$inc]['path'] .= ' / '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES);
5898 5898
                             }
5899 5899
                         }
5900 5900
 
@@ -5960,8 +5960,8 @@  discard block
 block discarded – undo
5960 5960
                     $rows_tmp = DB::query(
5961 5961
                         'SELECT c.id, c.title, c.level, c.type, c.masked, c.order, c.encrypted_data, c.role_visibility, c.is_mandatory,
5962 5962
                         f.id_category AS category_id
5963
-                        FROM ' . prefixTable('categories_folders') . ' AS f
5964
-                        INNER JOIN ' . prefixTable('categories') . ' AS c ON (f.id_category = c.parent_id)
5963
+                        FROM ' . prefixTable('categories_folders').' AS f
5964
+                        INNER JOIN ' . prefixTable('categories').' AS c ON (f.id_category = c.parent_id)
5965 5965
                         WHERE id_folder=%i',
5966 5966
                         $folder
5967 5967
                     );
@@ -5988,7 +5988,7 @@  discard block
 block discarded – undo
5988 5988
                 $valTemp = '';
5989 5989
                 $data = DB::queryFirstRow(
5990 5990
                     'SELECT valeur
5991
-                    FROM ' . prefixTable('misc') . '
5991
+                    FROM ' . prefixTable('misc').'
5992 5992
                     WHERE type = %s AND intitule=%i',
5993 5993
                     'complex',
5994 5994
                     $folder
@@ -6005,14 +6005,14 @@  discard block
 block discarded – undo
6005 6005
                 $valTemp = '';
6006 6006
                 $rows_tmp = DB::query(
6007 6007
                     'SELECT t.title
6008
-                    FROM ' . prefixTable('roles_values') . ' as v
6009
-                    INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id)
6008
+                    FROM ' . prefixTable('roles_values').' as v
6009
+                    INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id)
6010 6010
                     WHERE v.folder_id = %i
6011 6011
                     GROUP BY title',
6012 6012
                     $folder
6013 6013
                 );
6014 6014
                 foreach ($rows_tmp as $record) {
6015
-                    $valTemp .= (empty($valTemp) === true ? '' : ' - ') . $record['title'];
6015
+                    $valTemp .= (empty($valTemp) === true ? '' : ' - ').$record['title'];
6016 6016
                 }
6017 6017
                 $arr_data[$folder]['visibilityRoles'] = $valTemp;
6018 6018
             }
@@ -6040,7 +6040,7 @@  discard block
 block discarded – undo
6040 6040
             // get item info
6041 6041
             $dataItem = DB::queryFirstRow(
6042 6042
                 'SELECT *
6043
-                FROM ' . prefixTable('items') . '
6043
+                FROM ' . prefixTable('items').'
6044 6044
                 WHERE id=%i',
6045 6045
                 $post_item_id
6046 6046
             );
@@ -6050,8 +6050,8 @@  discard block
 block discarded – undo
6050 6050
             $rows = DB::query(
6051 6051
                 'SELECT l.date as date, l.action as action, l.raison as raison, l.raison_iv AS raison_iv,
6052 6052
                 u.login as login, u.avatar_thumb as avatar_thumb, u.name as name, u.lastname as lastname
6053
-                FROM ' . prefixTable('log_items') . ' as l
6054
-                LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
6053
+                FROM ' . prefixTable('log_items').' as l
6054
+                LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
6055 6055
                 WHERE id_item=%i AND action <> %s
6056 6056
                 ORDER BY date DESC',
6057 6057
                 $post_item_id,
@@ -6065,7 +6065,7 @@  discard block
 block discarded – undo
6065 6065
                 }
6066 6066
                 // imported via API
6067 6067
                 if (empty($record['login'])) {
6068
-                    $record['login'] = langHdl('imported_via_api') . ' [' . $record['raison'] . ']';
6068
+                    $record['login'] = langHdl('imported_via_api').' ['.$record['raison'].']';
6069 6069
                 }
6070 6070
 
6071 6071
                 if (
@@ -6076,13 +6076,13 @@  discard block
 block discarded – undo
6076 6076
                 ) {
6077 6077
                     // Prepare avatar
6078 6078
                     if (isset($record['avatar_thumb']) && empty($record['avatar_thumb']) === false) {
6079
-                        if (file_exists($SETTINGS['cpassman_dir'] . '/includes/avatars/' . $record['avatar_thumb'])) {
6080
-                            $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $record['avatar_thumb'];
6079
+                        if (file_exists($SETTINGS['cpassman_dir'].'/includes/avatars/'.$record['avatar_thumb'])) {
6080
+                            $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$record['avatar_thumb'];
6081 6081
                         } else {
6082
-                            $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
6082
+                            $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
6083 6083
                         }
6084 6084
                     } else {
6085
-                        $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg';
6085
+                        $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg';
6086 6086
                     }
6087 6087
 
6088 6088
                     // Prepare action
@@ -6099,19 +6099,19 @@  discard block
 block discarded – undo
6099 6099
                         $action = langHdl($reason[0]);
6100 6100
                         if ($reason[0] === 'at_moved') {
6101 6101
                             $tmp = explode(' -> ', $reason[1]);
6102
-                            $detail = langHdl('from') . ' <span class="font-weight-light">' . $tmp[0] . '</span> ' . langHdl('to') . ' <span class="font-weight-light">' . $tmp[1] . ' </span>';
6102
+                            $detail = langHdl('from').' <span class="font-weight-light">'.$tmp[0].'</span> '.langHdl('to').' <span class="font-weight-light">'.$tmp[1].' </span>';
6103 6103
                         } elseif ($reason[0] === 'at_field') {
6104 6104
                             $tmp = explode(' => ', $reason[1]);
6105 6105
                             if (count($tmp) > 1) {
6106
-                                $detail = '<b>' . trim($tmp[0]) . '</b> | ' . langHdl('previous_value') .
6107
-                                    ': <span class="font-weight-light">' . trim($tmp[1]) . '</span>';
6106
+                                $detail = '<b>'.trim($tmp[0]).'</b> | '.langHdl('previous_value').
6107
+                                    ': <span class="font-weight-light">'.trim($tmp[1]).'</span>';
6108 6108
                             } else {
6109 6109
                                 $detail = trim($reason[1]);
6110 6110
                             }
6111 6111
                         } elseif (in_array($reason[0], array('at_restriction', 'at_email', 'at_login', 'at_label', 'at_url', 'at_tag')) === true) {
6112 6112
                             $tmp = explode(' => ', $reason[1]);
6113 6113
                             $detail = empty(trim($tmp[0])) === true ?
6114
-                                langHdl('no_previous_value') : langHdl('previous_value') . ': <span class="font-weight-light">' . $tmp[0] . ' </span>';
6114
+                                langHdl('no_previous_value') : langHdl('previous_value').': <span class="font-weight-light">'.$tmp[0].' </span>';
6115 6115
                         } elseif ($reason[0] === 'at_automatic_del') {
6116 6116
                             $detail = langHdl($reason[1]);
6117 6117
                         } elseif ($reason[0] === 'at_anyoneconmodify') {
@@ -6120,7 +6120,7 @@  discard block
 block discarded – undo
6120 6120
                             $tmp = explode(':', $reason[1]);
6121 6121
                             $tmp = explode('.', $tmp[0]);
6122 6122
                             $detail = isBase64($tmp[0]) === true ?
6123
-                                base64_decode($tmp[0]) . '.' . $tmp[1] : $tmp[0];
6123
+                                base64_decode($tmp[0]).'.'.$tmp[1] : $tmp[0];
6124 6124
                         } elseif ($reason[0] === 'at_import') {
6125 6125
                             $detail = '';
6126 6126
                         } elseif (in_array($reason[0], array('csv', 'pdf')) === true) {
@@ -6139,8 +6139,8 @@  discard block
 block discarded – undo
6139 6139
                         array(
6140 6140
                             'avatar' => $avatar,
6141 6141
                             'login' => $record['login'],
6142
-                            'name' => $record['name'] . ' ' . $record['lastname'],
6143
-                            'date' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date']),
6142
+                            'name' => $record['name'].' '.$record['lastname'],
6143
+                            'date' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date']),
6144 6144
                             'action' => $action,
6145 6145
                             'detail' => $detail,
6146 6146
                         )
@@ -6223,18 +6223,18 @@  discard block
 block discarded – undo
6223 6223
 
6224 6224
             // get some info to add to the notification email
6225 6225
             $resp_user = DB::queryfirstrow(
6226
-                'SELECT login FROM ' . prefixTable('users') . ' WHERE id = %i',
6226
+                'SELECT login FROM '.prefixTable('users').' WHERE id = %i',
6227 6227
                 $_SESSION['user_id']
6228 6228
             );
6229 6229
             $resp_folder = DB::queryfirstrow(
6230
-                'SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
6230
+                'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i',
6231 6231
                 $folder
6232 6232
             );
6233 6233
 
6234 6234
             // notify Managers
6235 6235
             $rows = DB::query(
6236 6236
                 'SELECT email
6237
-                FROM ' . prefixTable('users') . '
6237
+                FROM ' . prefixTable('users').'
6238 6238
                 WHERE `gestionnaire` = %i AND `email` IS NOT NULL',
6239 6239
                 1
6240 6240
             );
@@ -6265,14 +6265,14 @@  discard block
 block discarded – undo
6265 6265
             // Get list of users
6266 6266
             $usersList = array();
6267 6267
             $usersString = '';
6268
-            $rows = DB::query('SELECT id,login,email FROM ' . prefixTable('users') . ' ORDER BY login ASC');
6268
+            $rows = DB::query('SELECT id,login,email FROM '.prefixTable('users').' ORDER BY login ASC');
6269 6269
             foreach ($rows as $record) {
6270 6270
                 $usersList[$record['login']] = array(
6271 6271
                     'id' => $record['id'],
6272 6272
                     'login' => $record['login'],
6273 6273
                     'email' => $record['email'],
6274 6274
                 );
6275
-                $usersString .= $record['id'] . '#' . $record['login'] . ';';
6275
+                $usersString .= $record['id'].'#'.$record['login'].';';
6276 6276
             }
6277 6277
 
6278 6278
             $data = array(
@@ -6306,20 +6306,20 @@  discard block
 block discarded – undo
6306 6306
             // Send email
6307 6307
             $dataItem = DB::queryfirstrow(
6308 6308
                 'SELECT label, id_tree
6309
-                FROM ' . prefixTable('items') . '
6309
+                FROM ' . prefixTable('items').'
6310 6310
                 WHERE id = %i',
6311 6311
                 $post_item_id
6312 6312
             );
6313 6313
             $dataItemLog = DB::queryfirstrow(
6314 6314
                 'SELECT id_user
6315
-                FROM ' . prefixTable('log_items') . '
6315
+                FROM ' . prefixTable('log_items').'
6316 6316
                 WHERE id_item = %i AND action = %s',
6317 6317
                 $post_item_id,
6318 6318
                 'at_creation'
6319 6319
             );
6320 6320
             $dataAuthor = DB::queryfirstrow(
6321 6321
                 'SELECT email, login
6322
-                FROM ' . prefixTable('users') . '
6322
+                FROM ' . prefixTable('users').'
6323 6323
                 WHERE id = %i',
6324 6324
                 $dataItemLog['id_user']
6325 6325
             );
@@ -6398,7 +6398,7 @@  discard block
 block discarded – undo
6398 6398
 
6399 6399
             DB::query(
6400 6400
                 'SELECT *
6401
-                FROM ' . prefixTable('notification') . '
6401
+                FROM ' . prefixTable('notification').'
6402 6402
                 WHERE item_id = %i AND user_id = %i',
6403 6403
                 $post_item_id,
6404 6404
                 $_SESSION['user_id']
@@ -6464,7 +6464,7 @@  discard block
 block discarded – undo
6464 6464
             // And related logs
6465 6465
             $rows = DB::query(
6466 6466
                 'SELECT id, file AS filename
6467
-                FROM ' . prefixTable('files') . '
6467
+                FROM ' . prefixTable('files').'
6468 6468
                 WHERE id_item = %i AND confirmed = %i',
6469 6469
                 $post_item_id,
6470 6470
                 0
@@ -6478,12 +6478,12 @@  discard block
 block discarded – undo
6478 6478
                 );
6479 6479
 
6480 6480
                 // Delete file on server
6481
-                unlink($SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($file['filename']));
6481
+                unlink($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($file['filename']));
6482 6482
 
6483 6483
                 // Delete related logs
6484 6484
                 $logFile = DB::query(
6485 6485
                     'SELECT increment_id, raison
6486
-                    FROM ' . prefixTable('log_items') . '
6486
+                    FROM ' . prefixTable('log_items').'
6487 6487
                     WHERE id_item = %i AND id_user = %i AND action = %s AND raison LIKE "at_add_file :%"',
6488 6488
                     $post_item_id,
6489 6489
                     $_SESSION['user_id'],
@@ -6536,7 +6536,7 @@  discard block
 block discarded – undo
6536 6536
             // Confirm attachments
6537 6537
             $rows = DB::query(
6538 6538
                 'SELECT id, file AS filename
6539
-                FROM ' . prefixTable('files') . '
6539
+                FROM ' . prefixTable('files').'
6540 6540
                 WHERE id_item = %i AND confirmed = %i',
6541 6541
                 $post_item_id,
6542 6542
                 0
@@ -6573,15 +6573,15 @@  discard block
 block discarded – undo
6573 6573
         case 'autocomplete_tags':
6574 6574
             // Get a list off all existing TAGS
6575 6575
             $listOfTags = '';
6576
-            $rows = DB::query('SELECT tag FROM ' . prefixTable('tags') . ' WHERE tag LIKE %ss GROUP BY tag', $_GET['term']);
6576
+            $rows = DB::query('SELECT tag FROM '.prefixTable('tags').' WHERE tag LIKE %ss GROUP BY tag', $_GET['term']);
6577 6577
             foreach ($rows as $record) {
6578 6578
                 if (empty($listOfTags)) {
6579
-                    $listOfTags = '"' . $record['tag'] . '"';
6579
+                    $listOfTags = '"'.$record['tag'].'"';
6580 6580
                 } else {
6581
-                    $listOfTags .= ', "' . $record['tag'] . '"';
6581
+                    $listOfTags .= ', "'.$record['tag'].'"';
6582 6582
                 }
6583 6583
             }
6584
-            echo '[' . $listOfTags . ']';
6584
+            echo '['.$listOfTags.']';
6585 6585
             break;
6586 6586
     }
6587 6587
 }
@@ -6594,7 +6594,7 @@  discard block
 block discarded – undo
6594 6594
 {
6595 6595
     $data = DB::queryFirstRow(
6596 6596
         'SELECT bloquer_creation, bloquer_modification, personal_folder
6597
-        FROM ' . prefixTable('nested_tree') . ' WHERE id = %i',
6597
+        FROM ' . prefixTable('nested_tree').' WHERE id = %i',
6598 6598
         $groupe
6599 6599
     );
6600 6600
     // Check if it's in a personal folder. If yes, then force complexity overhead.
Please login to merge, or discard this patch.
sources/identify.php 1 patch
Spacing   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 // Load AntiXSS
46
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
46
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
47 47
 $antiXss = new voku\helper\AntiXSS();
48 48
 
49
-require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
50
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
51
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
49
+require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
50
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
51
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
52 52
 
53 53
 // init
54 54
 $ldap_suffix = '';
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
 
58 58
 // If Debug then clean the files
59 59
 if (DEBUGLDAP === true) {
60
-    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'] . '/ldap.debug.txt');
60
+    define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'].'/ldap.debug.txt');
61 61
     $fp = fopen(DEBUGLDAPFILE, 'w');
62 62
     fclose($fp);
63 63
 }
64 64
 if (DEBUGDUO === true) {
65
-    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'] . '/duo.debug.txt');
65
+    define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'].'/duo.debug.txt');
66 66
     $fp = fopen(DEBUGDUOFILE, 'w');
67 67
     fclose($fp);
68 68
 }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 if (defined('DB_PASSWD_CLEAR') === false) {
80 80
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
81 81
 }
82
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
82
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
83 83
 if (defined('DB_PASSWD_CLEAR') === false) {
84 84
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
85 85
 }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     // Get DUO keys
100 100
     $duoData = DB::query(
101 101
         'SELECT intitule, valeur
102
-        FROM ' . prefixTable('misc') . '
102
+        FROM ' . prefixTable('misc').'
103 103
         WHERE type = %s',
104 104
         'duoSecurity'
105 105
     );
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     }
109 109
 
110 110
     // load library
111
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
111
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
112 112
     $sig_request = Duo::signRequest(
113 113
         $_GLOBALS['IKEY'],
114 114
         $_GLOBALS['SKEY'],
@@ -120,17 +120,17 @@  discard block
 block discarded – undo
120 120
         debugIdentify(
121 121
             DEBUGDUO,
122 122
             DEBUGDUOFILE,
123
-            "\n\n-----\n\n" .
124
-                'sig request : ' . $post_login . "\n" .
125
-                'resp : ' . $sig_request . "\n"
123
+            "\n\n-----\n\n".
124
+                'sig request : '.$post_login."\n".
125
+                'resp : '.$sig_request."\n"
126 126
         );
127 127
     }
128 128
 
129 129
     // load csrfprotector
130
-    $csrfp_config = include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/csrfp/libs/csrfp.config.php';
130
+    $csrfp_config = include_once $SETTINGS['cpassman_dir'].'/includes/libraries/csrfp/libs/csrfp.config.php';
131 131
 
132 132
     // return result
133
-    echo '[{"sig_request" : "' . $sig_request . '" , "csrfp_token" : "' . $csrfp_config['CSRFP_TOKEN'] . '" , "csrfp_key" : "' . filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING) . '"}]';
133
+    echo '[{"sig_request" : "'.$sig_request.'" , "csrfp_token" : "'.$csrfp_config['CSRFP_TOKEN'].'" , "csrfp_key" : "'.filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING).'"}]';
134 134
     // ---
135 135
     // ---
136 136
 } elseif ($post_type === 'identify_duo_user_check') {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     //--------
141 141
 
142 142
     // load library
143
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php';
143
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php';
144 144
     $authenticated_username = Duo::verifyResponse(
145 145
         $SETTINGS['duo_ikey'],
146 146
         $SETTINGS['duo_skey'],
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
         debugIdentify(
153 153
             DEBUGDUO,
154 154
             DEBUGDUOFILE,
155
-            "\n\n-----\n\n" .
156
-                'sig response : ' . $post_sig_response . "\n" .
157
-                'resp : ' . $authenticated_username . "\n"
155
+            "\n\n-----\n\n".
156
+                'sig response : '.$post_sig_response."\n".
157
+                'resp : '.$authenticated_username."\n"
158 158
         );
159 159
     }
160 160
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             // is user in Teampass?
166 166
             $userInfo = DB::queryfirstrow(
167 167
                 'SELECT id
168
-                FROM ' . prefixTable('users') . '
168
+                FROM ' . prefixTable('users').'
169 169
                 WHERE login = %s',
170 170
                 $post_login
171 171
             );
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
             }
177 177
         }
178 178
 
179
-        echo '[{"authenticated_username" : "' . $authenticated_username . '"}]';
179
+        echo '[{"authenticated_username" : "'.$authenticated_username.'"}]';
180 180
     } else {
181
-        echo '[{"authenticated_username" : "' . $authenticated_username . '"}]';
181
+        echo '[{"authenticated_username" : "'.$authenticated_username.'"}]';
182 182
     }
183 183
     // ---
184 184
     // ---
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 
191 191
     // Load superGlobals
192
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
192
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
193 193
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
194 194
 
195 195
     // Prepare GET variables
@@ -282,19 +282,19 @@  discard block
 block discarded – undo
282 282
     } else {
283 283
         throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1);
284 284
     }
285
-    include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
285
+    include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
286 286
 
287 287
     header('Content-type: text/html; charset=utf-8');
288 288
     error_reporting(E_ERROR);
289
-    include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
290
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
289
+    include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
290
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
291 291
 
292 292
     // Load AntiXSS
293
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php';
293
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php';
294 294
     $antiXss = new voku\helper\AntiXSS();
295 295
 
296 296
     // Load superGlobals
297
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
297
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
298 298
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
299 299
 
300 300
     // Prepare GET variables
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
306 306
 
307 307
     // connect to the server
308
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
308
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
309 309
     if (defined('DB_PASSWD_CLEAR') === false) {
310 310
         define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
311 311
     }
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
     DB::$encoding = DB_ENCODING;
318 318
 
319 319
     // User's language loading
320
-    include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $sessionUserLanguage . '.php';
320
+    include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$sessionUserLanguage.'.php';
321 321
     //echo $dataReceived." -->".empty($sessionKey)."<-- ".$sessionKey." ** " ;
322 322
     // decrypt and retreive data in JSON format
323 323
     if (empty($sessionKey) === true) {
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
     // Check if user exists
398 398
     $userInfo = DB::queryFirstRow(
399 399
         'SELECT *
400
-        FROM ' . prefixTable('users') . '
400
+        FROM ' . prefixTable('users').'
401 401
         WHERE login=%s',
402 402
         $username
403 403
     );
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
         //$arrAttempts = array();
609 609
         $rows = DB::query(
610 610
             'SELECT date
611
-            FROM ' . prefixTable('log_system') . "
611
+            FROM ' . prefixTable('log_system')."
612 612
             WHERE field_1 = %s
613 613
             AND type = 'failed_auth'
614 614
             AND label = 'user_password_not_correct'
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
             foreach ($rows as $record) {
625 625
                 array_push(
626 626
                     $arrAttempts,
627
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date'])
627
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date'])
628 628
                 );
629 629
             }
630 630
         }
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
         foreach ($superGlobal->get('user_roles', 'SESSION') as $role) {
765 765
             $resRoles = DB::queryFirstRow(
766 766
                 'SELECT title, complexity
767
-                FROM ' . prefixTable('roles_title') . '
767
+                FROM ' . prefixTable('roles_title').'
768 768
                 WHERE id=%i',
769 769
                 $role
770 770
             );
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 
786 786
         // build complete array of roles
787 787
         $superGlobal->put('arr_roles_full', array(), 'SESSION');
788
-        $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC');
788
+        $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC');
789 789
         foreach ($rows as $record) {
790 790
             $superGlobal->put(
791 791
                 $record['id'],
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
             if (!empty($item)) {
881 881
                 $dataLastItems = DB::queryFirstRow(
882 882
                     'SELECT id,label,id_tree
883
-                    FROM ' . prefixTable('items') . '
883
+                    FROM ' . prefixTable('items').'
884 884
                     WHERE id=%i',
885 885
                     $item
886 886
                 );
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
                     array(
890 890
                         'id' => $item,
891 891
                         'label' => $dataLastItems['label'],
892
-                        'url' => 'index.php?page=items&amp;group=' . $dataLastItems['id_tree'] . '&amp;id=' . $item,
892
+                        'url' => 'index.php?page=items&amp;group='.$dataLastItems['id_tree'].'&amp;id='.$item,
893 893
                     ),
894 894
                     'SESSION',
895 895
                     'latest_items_tab'
@@ -906,12 +906,12 @@  discard block
 block discarded – undo
906 906
         ) {
907 907
             // get all Admin users
908 908
             $receivers = '';
909
-            $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1);
909
+            $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1);
910 910
             foreach ($rows as $record) {
911 911
                 if (empty($receivers)) {
912 912
                     $receivers = $record['email'];
913 913
                 } else {
914
-                    $receivers = ',' . $record['email'];
914
+                    $receivers = ','.$record['email'];
915 915
                 }
916 916
             }
917 917
             // Add email to table
@@ -927,7 +927,7 @@  discard block
 block discarded – undo
927 927
                             '#tp_time#',
928 928
                         ),
929 929
                         array(
930
-                            ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')',
930
+                            ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')',
931 931
                             date($SETTINGS['date_format'], $superGlobal->get('last_connection', 'SESSION')),
932 932
                             date($SETTINGS['time_format'], $superGlobal->get('last_connection', 'SESSION')),
933 933
                         ),
@@ -1076,8 +1076,8 @@  discard block
 block discarded – undo
1076 1076
     debugIdentify(
1077 1077
         DEBUGDUO,
1078 1078
         DEBUGDUOFILE,
1079
-        "\n\n----\n" .
1080
-            'Identified : ' . filter_var($return, FILTER_SANITIZE_STRING) . "\n\n"
1079
+        "\n\n----\n".
1080
+            'Identified : '.filter_var($return, FILTER_SANITIZE_STRING)."\n\n"
1081 1081
     );
1082 1082
 
1083 1083
     echo prepareExchangedData(
@@ -1143,44 +1143,44 @@  discard block
 block discarded – undo
1143 1143
     ];
1144 1144
     
1145 1145
     // Load expected libraries
1146
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/illuminate/Contracts/Auth/Authenticatable.php';
1147
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php';
1148
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
1149
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php';
1150
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php';
1151
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php';
1152
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php';
1153
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php';
1154
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php';
1155
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php';
1156
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php';
1157
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php';
1158
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php';
1159
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php';
1160
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
1161
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php';
1162
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php';
1163
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php';
1164
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php';
1165
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php';
1166
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php';
1167
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php';
1168
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php';
1169
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php';
1170
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php';
1171
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php';
1172
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php';
1173
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php';
1174
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php';
1175
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php';
1176
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php';
1177
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php';
1178
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php';
1179
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php';
1180
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php';
1181
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php';
1182
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php';
1183
-    require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php';
1146
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/illuminate/Contracts/Auth/Authenticatable.php';
1147
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php';
1148
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php';
1149
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php';
1150
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php';
1151
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php';
1152
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php';
1153
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php';
1154
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php';
1155
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php';
1156
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php';
1157
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php';
1158
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php';
1159
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php';
1160
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php';
1161
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php';
1162
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php';
1163
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php';
1164
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php';
1165
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php';
1166
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php';
1167
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php';
1168
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php';
1169
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php';
1170
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php';
1171
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php';
1172
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php';
1173
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php';
1174
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php';
1175
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php';
1176
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php';
1177
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php';
1178
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php';
1179
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php';
1180
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php';
1181
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php';
1182
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php';
1183
+    require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php';
1184 1184
 
1185 1185
     $ad = new SplClassLoader('LdapRecord', '../includes/libraries');
1186 1186
     $ad->register();
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
         return array(
1197 1197
             'error' => true,
1198
-            'message' => langHdl('error').' : '.$error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage()." ".$config['username'],
1198
+            'message' => langHdl('error').' : '.$error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage()." ".$config['username'],
1199 1199
              
1200 1200
         );
1201 1201
     }
@@ -1223,7 +1223,7 @@  discard block
 block discarded – undo
1223 1223
     }
1224 1224
 
1225 1225
     // load passwordLib library
1226
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1226
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1227 1227
     $pwdlib->register();
1228 1228
     $pwdlib = new PasswordLib\PasswordLib();
1229 1229
     $hashedPassword = $pwdlib->createPasswordHash($passwordClear);
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
             'id = %i',
1240 1240
             $userInfo['id']
1241 1241
         );
1242
-    } else if ($userInfo['special']=== 'user_added_from_ldap') {
1242
+    } else if ($userInfo['special'] === 'user_added_from_ldap') {
1243 1243
         // Case where user has been added from LDAP and never being connected to TP
1244 1244
         // We need to create his keys
1245 1245
         /*$userKeys = generateUserKeys($passwordClear);
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
 function yubicoMFACheck($dataReceived, $userInfo, $SETTINGS)
1293 1293
 {
1294 1294
     // Load superGlobals
1295
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1295
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1296 1296
     $superGlobal = new protect\SuperGlobal\SuperGlobal();
1297 1297
     $sessionAdmin = $superGlobal->get('user_admin', 'SESSION');
1298 1298
     $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
     }
1335 1335
 
1336 1336
     // Now check yubico validity
1337
-    include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php';
1337
+    include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php';
1338 1338
     $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key);
1339 1339
     $auth = $yubi->verify($yubico_key); //, null, null, null, 60
1340 1340
 
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
             'gestionnaire' => '0',
1387 1387
             'can_manage_all_users' => '0',
1388 1388
             'personal_folder' => $SETTINGS['enable_pf_feature'] === '1' ? '1' : '0',
1389
-            'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'] . ';' : '') . (isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'),
1389
+            'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'].';' : '').(isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'),
1390 1390
             'groupes_interdits' => '',
1391 1391
             'groupes_visibles' => '',
1392 1392
             'last_pw_change' => time(),
@@ -1412,7 +1412,7 @@  discard block
 block discarded – undo
1412 1412
         );
1413 1413
 
1414 1414
         // Rebuild tree
1415
-        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1415
+        $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries');
1416 1416
         $tree->register();
1417 1417
         $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');
1418 1418
         $tree->rebuild();
@@ -1443,14 +1443,14 @@  discard block
 block discarded – undo
1443 1443
         && empty($dataReceived['GACode']) === false
1444 1444
     ) {
1445 1445
         // Load superGlobals
1446
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1446
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php';
1447 1447
         $superGlobal = new protect\SuperGlobal\SuperGlobal();
1448 1448
         $sessionAdmin = $superGlobal->get('user_admin', 'SESSION');
1449 1449
         $sessionUrl = $superGlobal->get('initial_url', 'SESSION');
1450 1450
         $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION');
1451 1451
         
1452 1452
         // load library
1453
-        include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1453
+        include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php';
1454 1454
 
1455 1455
         // create new instance
1456 1456
         $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']);
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
 
1477 1477
             // generate new QR
1478 1478
             $new_2fa_qr = $tfa->getQRCodeImageAsDataUri(
1479
-                'Teampass - ' . $username,
1479
+                'Teampass - '.$username,
1480 1480
                 $userInfo['ga']
1481 1481
             );
1482 1482
 
@@ -1491,7 +1491,7 @@  discard block
 block discarded – undo
1491 1491
             );
1492 1492
 
1493 1493
             $firstTime = array(
1494
-                'value' => '<img src="' . $new_2fa_qr . '">',
1494
+                'value' => '<img src="'.$new_2fa_qr.'">',
1495 1495
                 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '',
1496 1496
                 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '',
1497 1497
                 'pwd_attempts' => (int) $sessionPwdAttempts,
@@ -1544,8 +1544,8 @@  discard block
 block discarded – undo
1544 1544
     $userPasswordVerified = false;
1545 1545
 
1546 1546
     // load passwordLib library
1547
-    include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php';
1548
-    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries');
1547
+    include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php';
1548
+    $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries');
1549 1549
     $pwdlib->register();
1550 1550
     $pwdlib = new PasswordLib\PasswordLib();
1551 1551
 
Please login to merge, or discard this patch.
sources/fields.queries.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -506,8 +506,7 @@  discard block
 block discarded – undo
506 506
             $post_masked = filter_var($dataReceived['masked'], FILTER_SANITIZE_STRING);
507 507
             $post_encrypted = filter_var($dataReceived['encrypted'], FILTER_SANITIZE_STRING);
508 508
             $post_roles = filter_var_array($dataReceived['roles'], FILTER_SANITIZE_STRING);
509
-            $post_fieldId = isset($dataReceived['fieldId']) === false ? '' :
510
-                filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT);
509
+            $post_fieldId = isset($dataReceived['fieldId']) === false ? '' : filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT);
511 510
 
512 511
             if (empty($post_fieldId) === false) {
513 512
                 // UPDATE FIELD
@@ -522,7 +521,7 @@  discard block
 block discarded – undo
522 521
                         'encrypted_data' => $post_encrypted,
523 522
                         'is_mandatory' => $post_mandatory,
524 523
                         'masked' => $post_masked,
525
-                        'role_visibility' => isnull($post_roles) === true || count($post_roles) ===0 ? '' : implode(',', $post_roles),
524
+                        'role_visibility' => isnull($post_roles) === true || count($post_roles) === 0 ? '' : implode(',', $post_roles),
526 525
                         'order' => calculateOrder($post_fieldId, $post_order),
527 526
                     ),
528 527
                     'id = %i',
@@ -627,8 +626,7 @@  discard block
 block discarded – undo
627 626
             $post_masked = filter_var($dataReceived['masked'], FILTER_SANITIZE_STRING);
628 627
             $post_encrypted = filter_var($dataReceived['encrypted'], FILTER_SANITIZE_STRING);
629 628
             $post_roles = filter_var_array($dataReceived['roles'], FILTER_SANITIZE_STRING);
630
-            $post_fieldId = isset($dataReceived['fieldId']) === false ? '' :
631
-                filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT);
629
+            $post_fieldId = isset($dataReceived['fieldId']) === false ? '' : filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT);
632 630
 
633 631
             // NEW FIELD
634 632
             DB::insert(
Please login to merge, or discard this patch.
sources/utilities.queries.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 }
36 36
 
37 37
 // Do checks
38
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
39
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
38
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
39
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
40 40
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'utilities.database', $SETTINGS) === false) {
41 41
     // Not allowed page
42 42
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
43
-    include $SETTINGS['cpassman_dir'] . '/error.php';
43
+    include $SETTINGS['cpassman_dir'].'/error.php';
44 44
     exit();
45 45
 }
46 46
 
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
     date_default_timezone_set('UTC');
54 54
 }
55 55
 
56
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
57
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
56
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
57
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
58 58
 header('Content-type: text/html; charset=utf-8');
59 59
 header('Cache-Control: no-cache, must-revalidate');
60 60
 require_once 'main.functions.php';
61 61
 
62 62
 //Connect to DB
63
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
63
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
64 64
 if (defined('DB_PASSWD_CLEAR') === false) {
65 65
     define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS));
66 66
 }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             $arrFolders = array();
116 116
             $rows = DB::query(
117 117
                 'SELECT valeur, intitule
118
-                FROM ' . prefixTable('misc') . '
118
+                FROM ' . prefixTable('misc').'
119 119
                 WHERE type  = %s',
120 120
                 'folder_deleted'
121 121
             );
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
                 'SELECT u.login as login, u.name as name, u.lastname as lastname,
137 137
                 i.id as id, i.label as label,
138 138
                 i.id_tree as id_tree, l.date as date, n.title as folder_title
139
-                FROM ' . prefixTable('log_items') . ' as l
140
-                INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
141
-                INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
142
-                INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree=n.id)
139
+                FROM ' . prefixTable('log_items').' as l
140
+                INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
141
+                INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
142
+                INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree=n.id)
143 143
                 WHERE i.inactif = %i
144 144
                 AND l.action = %s',
145 145
                 1,
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                             'label' => $record['label'],
162 162
                             'date' => date($SETTINGS['date_format'], $record['date']),
163 163
                             'login' => $record['login'],
164
-                            'name' => $record['name'] . ' ' . $record['lastname'],
164
+                            'name' => $record['name'].' '.$record['lastname'],
165 165
                             'folder_label' => $record['folder_title'],
166 166
                             'folder_deleted' => $thisFolder,
167 167
                         )
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
             foreach ($post_folders as $folderId) {
217 217
                 $data = DB::queryfirstrow(
218 218
                     'SELECT valeur
219
-                    FROM ' . prefixTable('misc') . "
219
+                    FROM ' . prefixTable('misc')."
220 220
                     WHERE type = 'folder_deleted'
221 221
                     AND intitule = %s",
222
-                    'f' . $folderId
222
+                    'f'.$folderId
223 223
                 );
224 224
                 if ((int) $data['valeur'] !== 0) {
225 225
                     $folderData = explode(', ', $data['valeur']);
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                         prefixTable('misc'),
246 246
                         'type = %s AND intitule = %s',
247 247
                         'folder_deleted',
248
-                        'f' . $folderId
248
+                        'f'.$folderId
249 249
                     );
250 250
 
251 251
                     // Restore all items in this folder
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                     // Get list of all items in thos folder
262 262
                     $items = DB::query(
263 263
                         'SELECT id
264
-                        FROM ' . prefixTable('items') . '
264
+                        FROM ' . prefixTable('items').'
265 265
                         WHERE id_tree = %i',
266 266
                         $folderId
267 267
                     );
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
             foreach ($post_folders as $folderId) {
347 347
                 $data = DB::queryfirstrow(
348 348
                     'SELECT valeur
349
-                    FROM ' . prefixTable('misc') . "
349
+                    FROM ' . prefixTable('misc')."
350 350
                     WHERE type = 'folder_deleted'
351 351
                     AND intitule = %s",
352
-                    'f' . $folderId
352
+                    'f'.$folderId
353 353
                 );
354 354
                 if ((int) $data['valeur'] !== 0) {
355 355
                     $folderData = explode(', ', $data['valeur']);
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
                         prefixTable('misc'),
382 382
                         'type = %s AND intitule = %s',
383 383
                         'folder_deleted',
384
-                        'f' . $folderData[0]
384
+                        'f'.$folderData[0]
385 385
                     );
386 386
 
387 387
                     // Delete all items in this folder
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
                     // Get list of all items in thos folder
396 396
                     $items = DB::query(
397 397
                         'SELECT id
398
-                        FROM ' . prefixTable('items') . '
398
+                        FROM ' . prefixTable('items').'
399 399
                         WHERE id_tree = %i',
400 400
                         $folderData[0]
401 401
                     );
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
             ) {
492 492
                 if ($post_log_type === 'items') {
493 493
                     DB::query(
494
-                        'SELECT * FROM ' . prefixTable('log_items') . '
494
+                        'SELECT * FROM '.prefixTable('log_items').'
495 495
                         WHERE action=%s ' .  'AND date BETWEEN %i AND %i'
496 496
                         . ($post_filter_action === 'all' ? '' : ' AND action = %s')
497 497
                         . ($post_filter_user === -1 ? '' : ' AND id_user = %i'),
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
                 } elseif ($post_log_type === 'connections') {
514 514
                     db::debugmode(true);
515 515
                     DB::query(
516
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
516
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
517 517
                             'AND date BETWEEN %i AND %i',
518 518
                         'user_connection',
519 519
                         $post_date_from,
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
                     );
531 531
                 } elseif ($post_log_type === 'errors') {
532 532
                     DB::query(
533
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
533
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
534 534
                             'AND date BETWEEN %i AND %i',
535 535
                         'error',
536 536
                         $post_date_from,
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
                     );
548 548
                 } elseif ($post_log_type === 'copy') {
549 549
                     DB::query(
550
-                        'SELECT * FROM ' . prefixTable('log_items') . ' WHERE action=%s ' .
550
+                        'SELECT * FROM '.prefixTable('log_items').' WHERE action=%s '.
551 551
                             'AND date BETWEEN %i AND %i',
552 552
                         'at_copy',
553 553
                         $post_date_from,
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
                     );
565 565
                 } elseif ($post_log_type === 'admin') {
566 566
                     DB::query(
567
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
567
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
568 568
                             'AND date BETWEEN %i AND %i',
569 569
                         'admin_action',
570 570
                         $post_date_from,
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
                     );
582 582
                 } elseif ($post_log_type === 'failed') {
583 583
                     DB::query(
584
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
584
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
585 585
                             'AND date BETWEEN %i AND %i',
586 586
                         'failed_auth',
587 587
                         $post_date_from,
Please login to merge, or discard this patch.
sources/aes.functions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
35 35
 }
36 36
 
37 37
 // Do checks
38
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
39
-require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php';
38
+require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php';
39
+require_once $SETTINGS['cpassman_dir'].'/sources/checks.php';
40 40
 if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) {
41 41
     // Not allowed page
42 42
     $_SESSION['error']['code'] = ERR_NOT_ALLOWED;
43
-    include $SETTINGS['cpassman_dir'] . '/error.php';
43
+    include $SETTINGS['cpassman_dir'].'/error.php';
44 44
     exit();
45 45
 }
46 46
 
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
     date_default_timezone_set('UTC');
54 54
 }
55 55
 
56
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php';
57
-require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
56
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php';
57
+require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
58 58
 header('Content-type: text/html; charset=utf-8');
59 59
 header('Cache-Control: no-cache, must-revalidate');
60 60
 require_once 'main.functions.php';
61 61
 
62 62
 // Connect to mysql server
63
-require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php';
63
+require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php';
64 64
 $link = mysqli_connect(DB_HOST, DB_USER, defuseReturnDecrypted(DB_PASSWD, $SETTINGS), DB_NAME, (int) DB_PORT, null);
65 65
 //$link->set_charset(DB_ENCODING);
66 66
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             // Get user info
87 87
             $userInfo = DB::queryFirstRow(
88 88
                 'SELECT id, public_key, private_key
89
-                FROM ' . prefixTable('users') . '
89
+                FROM ' . prefixTable('users').'
90 90
                 WHERE id = %i',
91 91
                 $post_user_id
92 92
             );
Please login to merge, or discard this patch.