Passed
Push — wip_sessions ( b55e55...384f5b )
by Nils
05:05
created
pages/fields.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('fields') === false) {
66 66
     // Not allowed page
67 67
     $session->set('system-error_code', ERR_NOT_ALLOWED);
68
-    include $SETTINGS['cpassman_dir'] . '/error.php';
68
+    include $SETTINGS['cpassman_dir'].'/error.php';
69 69
     exit;
70 70
 }
71 71
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                                         $folders = $tree->getDescendants();
178 178
 foreach ($folders as $folder) {
179 179
     DB::query(
180
-        'SELECT * FROM ' . prefixTable('nested_tree') . '
180
+        'SELECT * FROM '.prefixTable('nested_tree').'
181 181
                                         WHERE personal_folder = %i AND id = %i',
182 182
         '0',
183 183
         $folder->id
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             $ident .= '-';
190 190
         }
191 191
         echo '
192
-                                        <option value="' . $folder->id . '">' . $ident . '&nbsp;' . str_replace('&', '&amp;', $folder->title) . '</option>';
192
+                                        <option value="' . $folder->id.'">'.$ident.'&nbsp;'.str_replace('&', '&amp;', $folder->title).'</option>';
193 193
     }
194 194
 }
195 195
                                         ?>
@@ -220,9 +220,9 @@  discard block
 block discarded – undo
220 220
                                     <select class="form-control form-item-control select2" style="width:100%;" id="form-field-type">
221 221
                                         <?php
222 222
                                         // Build list of Types
223
-                                        echo '<option value="">-- ' . $lang->get('select') . ' --</option>
224
-                                            <option value="text">' . $lang->get('text') . '</option>
225
-                                            <option value="textarea">' . $lang->get('textarea') . '</option>';
223
+                                        echo '<option value="">-- '.$lang->get('select').' --</option>
224
+                                            <option value="text">' . $lang->get('text').'</option>
225
+                                            <option value="textarea">' . $lang->get('textarea').'</option>';
226 226
                                         ?>
227 227
                                     </select>
228 228
                                 </div>
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
                                     <select class="form-control form-item-control select2" multiple="multiple" style="width:100%;" id="form-field-roles">
256 256
                                         <?php
257 257
                                         // Build list of Roles
258
-                                        echo '<option value="all">' . $lang->get('every_roles') . '</option>';
258
+                                        echo '<option value="all">'.$lang->get('every_roles').'</option>';
259 259
 $rows = DB::query(
260 260
     'SELECT id, title
261
-                                    FROM ' . prefixTable('roles_title') . '
261
+                                    FROM ' . prefixTable('roles_title').'
262 262
                                     ORDER BY title ASC'
263 263
 );
264 264
 foreach ($rows as $record) {
265
-    echo '<option value="' . $record['id'] . '">' . addslashes($record['title']) . '</option>';
265
+    echo '<option value="'.$record['id'].'">'.addslashes($record['title']).'</option>';
266 266
 }
267 267
                                         ?>
268 268
                                     </select>
Please login to merge, or discard this patch.
pages/utilities.logs.js.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('utilities.logs') === false) {
72 72
     // Not allowed page
73 73
     $session->set('system-error_code', ERR_NOT_ALLOWED);
74
-    include $SETTINGS['cpassman_dir'] . '/error.php';
74
+    include $SETTINGS['cpassman_dir'].'/error.php';
75 75
     exit;
76 76
 }
77 77
 ?>
Please login to merge, or discard this patch.
sources/backups.queries.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 ) {
69 69
     // Not allowed page
70 70
     $session->set('system-error_code', ERR_NOT_ALLOWED);
71
-    include $SETTINGS['cpassman_dir'] . '/error.php';
71
+    include $SETTINGS['cpassman_dir'].'/error.php';
72 72
     exit;
73 73
 }
74 74
 
@@ -129,21 +129,21 @@  discard block
 block discarded – undo
129 129
             // Prepare variables
130 130
             $post_key = filter_var($dataReceived['encryptionKey'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
131 131
 
132
-            require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
132
+            require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
133 133
             $return = '';
134 134
 
135 135
             //Get all tables
136 136
             $tables = array();
137 137
             $result = DB::query('SHOW TABLES');
138 138
             foreach ($result as $row) {
139
-                $tables[] = $row['Tables_in_' . DB_NAME];
139
+                $tables[] = $row['Tables_in_'.DB_NAME];
140 140
             }
141 141
 
142 142
             //cycle through
143 143
             foreach ($tables as $table) {
144 144
                 if (empty($pre) || substr_count($table, $pre) > 0) {
145 145
                     // Do query
146
-                    $result = DB::queryRaw('SELECT * FROM ' . $table);
146
+                    $result = DB::queryRaw('SELECT * FROM '.$table);
147 147
                     DB::queryRaw(
148 148
                         'SELECT *
149 149
                         FROM INFORMATION_SCHEMA.COLUMNS
@@ -155,19 +155,19 @@  discard block
 block discarded – undo
155 155
                     $numFields = DB::count();
156 156
 
157 157
                     // prepare a drop table
158
-                    $return .= 'DROP TABLE ' . $table . ';';
159
-                    $row2 = DB::queryfirstrow('SHOW CREATE TABLE ' . $table);
160
-                    $return .= "\n\n" . $row2['Create Table'] . ";\n\n";
158
+                    $return .= 'DROP TABLE '.$table.';';
159
+                    $row2 = DB::queryfirstrow('SHOW CREATE TABLE '.$table);
160
+                    $return .= "\n\n".$row2['Create Table'].";\n\n";
161 161
 
162 162
                     //prepare all fields and datas
163 163
                     for ($i = 0; $i < $numFields; ++$i) {
164 164
                         while ($row = $result->fetch_row()) {
165
-                            $return .= 'INSERT INTO ' . $table . ' VALUES(';
165
+                            $return .= 'INSERT INTO '.$table.' VALUES(';
166 166
                             for ($j = 0; $j < $numFields; ++$j) {
167 167
                                 $row[$j] = is_null($row[$j]) === false ? addslashes($row[$j]) : '';
168 168
                                 $row[$j] = preg_replace("/\n/", '\\n', $row[$j]);
169 169
                                 if (isset($row[$j])) {
170
-                                    $return .= '"' . $row[$j] . '"';
170
+                                    $return .= '"'.$row[$j].'"';
171 171
                                 } else {
172 172
                                     $return .= 'NULL';
173 173
                                 }
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
                 $token = GenerateCryptKey(20, false, true, true, false, true, $SETTINGS);
188 188
 
189 189
                 //save file
190
-                $filename = time() . '-' . $token . '.sql';
191
-                $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+');
190
+                $filename = time().'-'.$token.'.sql';
191
+                $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+');
192 192
                 if ($handle !== false) {
193 193
                     //write file
194 194
                     fwrite($handle, $return);
@@ -200,17 +200,17 @@  discard block
 block discarded – undo
200 200
                     // Encrypt the file
201 201
                     prepareFileWithDefuse(
202 202
                         'encrypt',
203
-                        $SETTINGS['path_to_files_folder'] . '/' . $filename,
204
-                        $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
203
+                        $SETTINGS['path_to_files_folder'].'/'.$filename,
204
+                        $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
205 205
                         $SETTINGS,
206 206
                         $post_key
207 207
                     );
208 208
 
209 209
                     // Do clean
210
-                    unlink($SETTINGS['path_to_files_folder'] . '/' . $filename);
210
+                    unlink($SETTINGS['path_to_files_folder'].'/'.$filename);
211 211
                     rename(
212
-                        $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
213
-                        $SETTINGS['path_to_files_folder'] . '/' . $filename
212
+                        $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
213
+                        $SETTINGS['path_to_files_folder'].'/'.$filename
214 214
                     );
215 215
                 }
216 216
 
@@ -230,9 +230,9 @@  discard block
 block discarded – undo
230 230
                     array(
231 231
                         'error' => false,
232 232
                         'message' => '',
233
-                        'download' => 'sources/downloadFile.php?name=' . urlencode($filename) .
234
-                            '&sub=files&file=' . $filename . '&type=sql&key=' . $session->get('key') . '&key_tmp=' .
235
-                            $session->get('user-key_tmp') . '&pathIsFiles=1',
233
+                        'download' => 'sources/downloadFile.php?name='.urlencode($filename).
234
+                            '&sub=files&file='.$filename.'&type=sql&key='.$session->get('key').'&key_tmp='.
235
+                            $session->get('user-key_tmp').'&pathIsFiles=1',
236 236
                     ),
237 237
                     'encode'
238 238
                 );
@@ -281,12 +281,12 @@  discard block
 block discarded – undo
281 281
             $post_key = filter_var($dataReceived['encryptionKey'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
282 282
             $post_backupFile = filter_var($dataReceived['backupFile'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
283 283
 
284
-            include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
284
+            include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
285 285
 
286 286
             // Get filename from database
287 287
             $data = DB::queryFirstRow(
288 288
                 'SELECT valeur
289
-                FROM ' . prefixTable('misc') . '
289
+                FROM ' . prefixTable('misc').'
290 290
                 WHERE increment_id = %i',
291 291
                 $post_backupFile
292 292
             );
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
                 // Decrypt the file
306 306
                 $ret = prepareFileWithDefuse(
307 307
                     'decrypt',
308
-                    $SETTINGS['path_to_files_folder'] . '/' . $post_backupFile,
309
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile,
308
+                    $SETTINGS['path_to_files_folder'].'/'.$post_backupFile,
309
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile,
310 310
                     $SETTINGS,
311 311
                     $post_key
312 312
                 );
@@ -323,10 +323,10 @@  discard block
 block discarded – undo
323 323
                 }
324 324
 
325 325
                 // Do clean
326
-                fileDelete($SETTINGS['path_to_files_folder'] . '/' . $post_backupFile, $SETTINGS);
327
-                $post_backupFile = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $post_backupFile;
326
+                fileDelete($SETTINGS['path_to_files_folder'].'/'.$post_backupFile, $SETTINGS);
327
+                $post_backupFile = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$post_backupFile;
328 328
             } else {
329
-                $post_backupFile = $SETTINGS['path_to_files_folder'] . '/' . $post_backupFile;
329
+                $post_backupFile = $SETTINGS['path_to_files_folder'].'/'.$post_backupFile;
330 330
             }
331 331
 
332 332
             //read sql file
Please login to merge, or discard this patch.
sources/admin.queries.php 1 patch
Spacing   +143 added lines, -143 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 if ($checkUserAccess->checkSession() === false || $checkUserAccess->userAccessPage('admin') === false) {
71 71
     // Not allowed page
72 72
     $session->set('system-error_code', ERR_NOT_ALLOWED);
73
-    include $SETTINGS['cpassman_dir'] . '/error.php';
73
+    include $SETTINGS['cpassman_dir'].'/error.php';
74 74
     exit;
75 75
 }
76 76
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                         array(
121 121
                             'http' => array(
122 122
                                 'ignore_errors' => true,
123
-                                'proxy' => $SETTINGS['proxy_ip'] . ':' . $SETTINGS['proxy_port'],
123
+                                'proxy' => $SETTINGS['proxy_ip'].':'.$SETTINGS['proxy_port'],
124 124
                             ),
125 125
                         )
126 126
                     );
@@ -139,16 +139,16 @@  discard block
 block discarded – undo
139 139
                     $json_array = json_decode($json, true);
140 140
 
141 141
                     // About version
142
-                    $text .= '<li><u>' . $LANG['your_version'] . '</u> : ' . TP_VERSION;
142
+                    $text .= '<li><u>'.$LANG['your_version'].'</u> : '.TP_VERSION;
143 143
                     if (floatval(TP_VERSION) < floatval($json_array['info']['version'])) {
144
-                        $text .= '&nbsp;&nbsp;<b>' . $LANG['please_update'] . '</b>';
144
+                        $text .= '&nbsp;&nbsp;<b>'.$LANG['please_update'].'</b>';
145 145
                     }
146 146
                     $text .= '</li>';
147 147
 
148 148
                     // Libraries
149 149
                     $text .= '<li><u>Libraries</u> :</li>';
150 150
                     foreach ($json_array['libraries'] as $key => $val) {
151
-                        $text .= "<li>&nbsp;<span class='fa fa-caret-right'></span>&nbsp;" . $key . " (<a href='" . $val . "' target='_blank'>" . $val . '</a>)</li>';
151
+                        $text .= "<li>&nbsp;<span class='fa fa-caret-right'></span>&nbsp;".$key." (<a href='".$val."' target='_blank'>".$val.'</a>)</li>';
152 152
                     }
153 153
                 }
154 154
             } else {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         }
160 160
         $text .= '</ul>';
161 161
 
162
-        echo '[{"error":"' . $error . '" , "output":"' . str_replace(array("\n", "\t", "\r"), '', $text) . '"}]';
162
+        echo '[{"error":"'.$error.'" , "output":"'.str_replace(array("\n", "\t", "\r"), '', $text).'"}]';
163 163
         break;
164 164
         
165 165
 
@@ -189,21 +189,21 @@  discard block
 block discarded – undo
189 189
             break;
190 190
         }
191 191
 
192
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
192
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
193 193
         $return = '';
194 194
 
195 195
         //Get all tables
196 196
         $tables = array();
197 197
         $result = DB::query('SHOW TABLES');
198 198
         foreach ($result as $row) {
199
-            $tables[] = $row['Tables_in_' . $database];
199
+            $tables[] = $row['Tables_in_'.$database];
200 200
         }
201 201
 
202 202
         //cycle through
203 203
         foreach ($tables as $table) {
204 204
             if (defined('DB_PREFIX') || substr_count($table, DB_PREFIX) > 0) {
205 205
                 // Do query
206
-                $result = DB::queryRaw('SELECT * FROM ' . $table);
206
+                $result = DB::queryRaw('SELECT * FROM '.$table);
207 207
                 DB::queryRaw(
208 208
                     'SELECT *
209 209
                     FROM INFORMATION_SCHEMA.COLUMNS
@@ -215,19 +215,19 @@  discard block
 block discarded – undo
215 215
                 $numFields = DB::count();
216 216
 
217 217
                 // prepare a drop table
218
-                $return .= 'DROP TABLE ' . $table . ';';
219
-                $row2 = DB::queryfirstrow('SHOW CREATE TABLE ' . $table);
220
-                $return .= "\n\n" . $row2['Create Table'] . ";\n\n";
218
+                $return .= 'DROP TABLE '.$table.';';
219
+                $row2 = DB::queryfirstrow('SHOW CREATE TABLE '.$table);
220
+                $return .= "\n\n".$row2['Create Table'].";\n\n";
221 221
 
222 222
                 //prepare all fields and datas
223 223
                 for ($i = 0; $i < $numFields; ++$i) {
224 224
                     while ($row = $result->fetch_row()) {
225
-                        $return .= 'INSERT INTO ' . $table . ' VALUES(';
225
+                        $return .= 'INSERT INTO '.$table.' VALUES(';
226 226
                         for ($j = 0; $j < $numFields; ++$j) {
227 227
                             $row[$j] = addslashes($row[$j]);
228 228
                             $row[$j] = preg_replace("/\n/", '\\n', $row[$j]);
229 229
                             if (isset($row[$j])) {
230
-                                $return .= '"' . $row[$j] . '"';
230
+                                $return .= '"'.$row[$j].'"';
231 231
                             } else {
232 232
                                 $return .= 'NULL';
233 233
                             }
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
             $token = GenerateCryptKey(20, false, true, true, false, true, $SETTINGS);
248 248
 
249 249
             //save file
250
-            $filename = time() . '-' . $token . '.sql';
251
-            $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+');
250
+            $filename = time().'-'.$token.'.sql';
251
+            $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+');
252 252
             if ($handle !== false) {
253 253
                 //write file
254 254
                 fwrite($handle, $return);
@@ -260,17 +260,17 @@  discard block
 block discarded – undo
260 260
                 // Encrypt the file
261 261
                 prepareFileWithDefuse(
262 262
                     'encrypt',
263
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename,
264
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
263
+                    $SETTINGS['path_to_files_folder'].'/'.$filename,
264
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
265 265
                     $SETTINGS,
266 266
                     $post_option
267 267
                 );
268 268
 
269 269
                 // Do clean
270
-                unlink($SETTINGS['path_to_files_folder'] . '/' . $filename);
270
+                unlink($SETTINGS['path_to_files_folder'].'/'.$filename);
271 271
                 rename(
272
-                    $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename,
273
-                    $SETTINGS['path_to_files_folder'] . '/' . $filename
272
+                    $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename,
273
+                    $SETTINGS['path_to_files_folder'].'/'.$filename
274 274
                 );
275 275
             }
276 276
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
             //update LOG
281 281
             logEvents($SETTINGS, 'admin_action', 'dataBase backup', (string) $session->get('user-id'), $session->get('user-login'));
282 282
 
283
-            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name=' . urlencode($filename) . '&sub=files&file=' . $filename . '&type=sql&key=' . $session->get('key') . '&key_tmp=' . $session->get('user-key_tmp') . '&pathIsFiles=1"}]';
283
+            echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name='.urlencode($filename).'&sub=files&file='.$filename.'&type=sql&key='.$session->get('key').'&key_tmp='.$session->get('user-key_tmp').'&pathIsFiles=1"}]';
284 284
         }
285 285
         break;
286 286
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             );
310 310
             break;
311 311
         }
312
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
312
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
313 313
 
314 314
         $dataPost = explode('&', $post_option);
315 315
         $file = htmlspecialchars($dataPost[0]);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
         // Get filename from database
319 319
         $data = DB::queryFirstRow(
320 320
             'SELECT valeur
321
-            FROM ' . prefixTable('misc') . '
321
+            FROM ' . prefixTable('misc').'
322 322
             WHERE increment_id = %i',
323 323
             $file
324 324
         );
@@ -337,22 +337,22 @@  discard block
 block discarded – undo
337 337
             // Decrypt the file
338 338
             $ret = prepareFileWithDefuse(
339 339
                 'decrypt',
340
-                $SETTINGS['path_to_files_folder'] . '/' . $file,
341
-                $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file,
340
+                $SETTINGS['path_to_files_folder'].'/'.$file,
341
+                $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file,
342 342
                 $SETTINGS,
343 343
                 $key
344 344
             );
345 345
 
346 346
             if (empty($ret) === false) {
347
-                echo '[{"result":"db_restore" , "message":"' . $ret . '"}]';
347
+                echo '[{"result":"db_restore" , "message":"'.$ret.'"}]';
348 348
                 break;
349 349
             }
350 350
 
351 351
             // Do clean
352
-            fileDelete($SETTINGS['path_to_files_folder'] . '/' . $file, $SETTINGS);
353
-            $file = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file;
352
+            fileDelete($SETTINGS['path_to_files_folder'].'/'.$file, $SETTINGS);
353
+            $file = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file;
354 354
         } else {
355
-            $file = $SETTINGS['path_to_files_folder'] . '/' . $file;
355
+            $file = $SETTINGS['path_to_files_folder'].'/'.$file;
356 356
         }
357 357
 
358 358
         //read sql file
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
         fclose($handle);
370 370
 
371 371
         //delete file
372
-        unlink($SETTINGS['path_to_files_folder'] . '/' . $file);
372
+        unlink($SETTINGS['path_to_files_folder'].'/'.$file);
373 373
 
374 374
         //Show done
375 375
         echo '[{"result":"db_restore" , "message":""}]';
@@ -407,8 +407,8 @@  discard block
 block discarded – undo
407 407
             foreach ($table as $i => $tablename) {
408 408
                 if (substr_count($tablename, DB_PREFIX) > 0) {
409 409
                     // launch optimization quieries
410
-                    DB::query('ANALYZE TABLE `' . $tablename . '`');
411
-                    DB::query('OPTIMIZE TABLE `' . $tablename . '`');
410
+                    DB::query('ANALYZE TABLE `'.$tablename.'`');
411
+                    DB::query('OPTIMIZE TABLE `'.$tablename.'`');
412 412
                 }
413 413
             }
414 414
         }
@@ -416,12 +416,12 @@  discard block
 block discarded – undo
416 416
         //Clean up LOG_ITEMS table
417 417
         $rows = DB::query(
418 418
             'SELECT id
419
-            FROM ' . prefixTable('items') . '
419
+            FROM ' . prefixTable('items').'
420 420
             ORDER BY id ASC'
421 421
         );
422 422
         foreach ($rows as $item) {
423 423
             DB::query(
424
-                'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s',
424
+                'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s',
425 425
                 $item['id'],
426 426
                 'at_creation'
427 427
             );
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
             if ($counter === 0) {
430 430
                 //Create new at_creation entry
431 431
                 $rowTmp = DB::queryFirstRow(
432
-                    'SELECT date, id_user FROM ' . prefixTable('log_items') . ' WHERE id_item=%i ORDER BY date ASC',
432
+                    'SELECT date, id_user FROM '.prefixTable('log_items').' WHERE id_item=%i ORDER BY date ASC',
433 433
                     $item['id']
434 434
                 );
435 435
                 DB::insert(
@@ -459,8 +459,8 @@  discard block
 block discarded – undo
459 459
         echo prepareExchangedData(
460 460
             array(
461 461
                 'error' => false,
462
-                'message' => $lang->get('last_execution') . ' ' .
463
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
462
+                'message' => $lang->get('last_execution').' '.
463
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
464 464
                     '<i class="fas fa-check text-success ml-2"></i>',
465 465
             ),
466 466
             'encode'
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
             break;
497 497
         }
498 498
 
499
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
499
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
500 500
         updateCacheTable('reload', NULL);
501 501
 
502 502
         // Log
@@ -512,8 +512,8 @@  discard block
 block discarded – undo
512 512
         echo prepareExchangedData(
513 513
             [
514 514
                 'error' => false,
515
-                'message' => $lang->get('last_execution') . ' ' .
516
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
515
+                'message' => $lang->get('last_execution').' '.
516
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
517 517
                     '<i class="fas fa-check text-success mr-2"></i>',
518 518
             ],
519 519
             'encode'
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
         }
549 549
 
550 550
         // Perform
551
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
551
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
552 552
         $ret = handleConfigFile('rebuild', $SETTINGS);
553 553
 
554 554
         // Log
@@ -575,8 +575,8 @@  discard block
 block discarded – undo
575 575
         echo prepareExchangedData(
576 576
             array(
577 577
                 'error' => false,
578
-                'message' => $lang->get('last_execution') . ' ' .
579
-                    date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
578
+                'message' => $lang->get('last_execution').' '.
579
+                    date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
580 580
                     '<i class="fas fa-check text-success ml-2"></i>',
581 581
             ),
582 582
             'encode'
@@ -616,18 +616,18 @@  discard block
 block discarded – undo
616 616
         $filename = $post_option;
617 617
         $tp_settings = [];
618 618
         //get backups infos
619
-        $rows = DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s', 'admin');
619
+        $rows = DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s', 'admin');
620 620
         foreach ($rows as $record) {
621 621
             $tp_settings[$record['intitule']] = $record['valeur'];
622 622
         }
623 623
 
624 624
         // check if backup file is in DB.
625 625
         // If YES then it is encrypted with DEFUSE
626
-        $bck = DB::queryFirstRow('SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'backup', 'filename');
626
+        $bck = DB::queryFirstRow('SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'backup', 'filename');
627 627
 
628 628
         //read file
629 629
         $return = '';
630
-        $Fnm = $tp_settings['bck_script_path'] . '/' . $filename . '.sql';
630
+        $Fnm = $tp_settings['bck_script_path'].'/'.$filename.'.sql';
631 631
         if (file_exists($Fnm)) {
632 632
             if (!empty($bck) && $bck['valeur'] === $filename) {
633 633
                 $err = '';
@@ -635,8 +635,8 @@  discard block
 block discarded – undo
635 635
                 // it means that file is DEFUSE encrypted
636 636
                 try {
637 637
                     File::decryptFileWithPassword(
638
-                        $SETTINGS['bck_script_path'] . '/' . $post_option . '.sql',
639
-                        $SETTINGS['bck_script_path'] . '/' . str_replace('encrypted', 'clear', $filename) . '.sql',
638
+                        $SETTINGS['bck_script_path'].'/'.$post_option.'.sql',
639
+                        $SETTINGS['bck_script_path'].'/'.str_replace('encrypted', 'clear', $filename).'.sql',
640 640
                         base64_decode($SETTINGS['bck_script_key'])
641 641
                     );
642 642
                 } catch (CryptoException\WrongKeyOrModifiedCiphertextException $ex) {
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
                 }
645 645
 
646 646
                 if (!empty($err)) {
647
-                    echo '[{ "result":"backup_decrypt_fails" , "msg":"' . $err . '"}]';
647
+                    echo '[{ "result":"backup_decrypt_fails" , "msg":"'.$err.'"}]';
648 648
                     break;
649 649
                 }
650 650
             } else {
@@ -663,19 +663,19 @@  discard block
 block discarded – undo
663 663
                 );
664 664
 
665 665
                 //save the file
666
-                $handle = fopen($tp_settings['bck_script_path'] . '/' . $filename . '.clear.sql', 'w+');
666
+                $handle = fopen($tp_settings['bck_script_path'].'/'.$filename.'.clear.sql', 'w+');
667 667
                 if ($handle !== false && is_null($return) === false) {
668 668
                     fwrite($handle, /** @scrutinizer ignore-type */ $return);
669 669
                 }
670 670
                 fclose($handle);
671 671
             }
672 672
             $result = 'backup_decrypt_success';
673
-            $msg = $tp_settings['bck_script_path'] . '/' . $filename . '.clear.sql';
673
+            $msg = $tp_settings['bck_script_path'].'/'.$filename.'.clear.sql';
674 674
         } else {
675 675
             $result = 'backup_decrypt_fails';
676
-            $msg = 'File not found: ' . $Fnm;
676
+            $msg = 'File not found: '.$Fnm;
677 677
         }
678
-        echo '[{ "result":"' . $result . '" , "msg":"' . $msg . '"}]';
678
+        echo '[{ "result":"'.$result.'" , "msg":"'.$msg.'"}]';
679 679
         break;
680 680
 
681 681
         /*
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
         $session->set('user-reencrypt_old_salt', file_get_contents(SECUREPATH.'/'.SECUREFILE));
713 713
 
714 714
         // generate new saltkey
715
-        $old_sk_filename = SECUREPATH.'/'.SECUREFILE . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time();
715
+        $old_sk_filename = SECUREPATH.'/'.SECUREFILE.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time();
716 716
         copy(
717 717
             SECUREPATH.'/'.SECUREFILE,
718 718
             $old_sk_filename
@@ -740,13 +740,13 @@  discard block
 block discarded – undo
740 740
         logEvents($SETTINGS, 'system', 'change_salt_key', (string) $session->get('user-id'), $session->get('user-login'));
741 741
 
742 742
         // get number of items to change
743
-        DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', 0);
743
+        DB::query('SELECT id FROM '.prefixTable('items').' WHERE perso = %i', 0);
744 744
         $nb_of_items = DB::count();
745 745
 
746 746
         // create backup table
747
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
747
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
748 748
         DB::query(
749
-            'CREATE TABLE `' . prefixTable('sk_reencrypt_backup') . '` (
749
+            'CREATE TABLE `'.prefixTable('sk_reencrypt_backup').'` (
750 750
             `id` int(12) NOT null AUTO_INCREMENT,
751 751
             `current_table` varchar(100) NOT NULL,
752 752
             `current_field` varchar(500) NOT NULL,
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
         );
775 775
 
776 776
         // delete previous backup files
777
-        $files = glob($SETTINGS['path_to_upload_folder'] . '/*'); // get all file names
777
+        $files = glob($SETTINGS['path_to_upload_folder'].'/*'); // get all file names
778 778
         foreach ($files as $file) { // iterate files
779 779
             if (is_file($file)) {
780 780
                 $file_parts = pathinfo($file);
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
                 echo prepareExchangedData(
857 857
                     array(
858 858
                         'error' => true,
859
-                        'message' => 'Input `' . $objects[0] . '` is not allowed',
859
+                        'message' => 'Input `'.$objects[0].'` is not allowed',
860 860
                         'nbOfItems' => '',
861 861
                         'nextAction' => '',
862 862
                     ),
@@ -869,9 +869,9 @@  discard block
 block discarded – undo
869 869
                 //change all encrypted data in Items (passwords)
870 870
                 $rows = DB::query(
871 871
                     'SELECT id, pw, pw_iv
872
-                    FROM ' . prefixTable('items') . '
872
+                    FROM ' . prefixTable('items').'
873 873
                     WHERE perso = %s
874
-                    LIMIT ' . $post_start . ', ' . $post_length,
874
+                    LIMIT ' . $post_start.', '.$post_length,
875 875
                     '0'
876 876
                 );
877 877
                 foreach ($rows as $record) {
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
                             'current_field' => 'pw',
884 884
                             'value_id' => $record['id'],
885 885
                             'value' => $record['pw'],
886
-                            'current_sql' => 'UPDATE ' . prefixTable('items') . " SET pw = '" . $record['pw'] . "' WHERE id = '" . $record['id'] . "';",
886
+                            'current_sql' => 'UPDATE '.prefixTable('items')." SET pw = '".$record['pw']."' WHERE id = '".$record['id']."';",
887 887
                             'value2' => 'none',
888 888
                             'result' => 'none',
889 889
                         )
@@ -932,9 +932,9 @@  discard block
 block discarded – undo
932 932
                 //change all encrypted data in Logs (passwords)
933 933
                 $rows = DB::query(
934 934
                     'SELECT raison, increment_id
935
-                    FROM ' . prefixTable('log_items') . "
935
+                    FROM ' . prefixTable('log_items')."
936 936
                     WHERE action = %s AND raison LIKE 'at_pw :%'
937
-                    LIMIT " . $post_start . ', ' . $post_length,
937
+                    LIMIT " . $post_start.', '.$post_length,
938 938
                     'at_modification'
939 939
                 );
940 940
                 foreach ($rows as $record) {
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
                             'current_field' => 'raison',
947 947
                             'value_id' => $record['increment_id'],
948 948
                             'value' => $record['raison'],
949
-                            'current_sql' => 'UPDATE ' . prefixTable('log_items') . " SET raison = '" . $record['raison'] . "' WHERE increment_id = '" . $record['increment_id'] . "';",
949
+                            'current_sql' => 'UPDATE '.prefixTable('log_items')." SET raison = '".$record['raison']."' WHERE increment_id = '".$record['increment_id']."';",
950 950
                             'value2' => 'none',
951 951
                             'result' => 'none',
952 952
                         )
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
                         DB::update(
975 975
                             prefixTable('log_items'),
976 976
                             array(
977
-                                'raison' => 'at_pw :' . $encrypt['string'],
977
+                                'raison' => 'at_pw :'.$encrypt['string'],
978 978
                                 'encryption_type' => 'defuse',
979 979
                             ),
980 980
                             'increment_id = %i',
@@ -999,8 +999,8 @@  discard block
 block discarded – undo
999 999
                 //change all encrypted data in CATEGORIES (passwords)
1000 1000
                 $rows = DB::query(
1001 1001
                     'SELECT id, data
1002
-                    FROM ' . prefixTable('categories_items') . '
1003
-                    LIMIT ' . $post_start . ', ' . $post_length
1002
+                    FROM ' . prefixTable('categories_items').'
1003
+                    LIMIT ' . $post_start.', '.$post_length
1004 1004
                 );
1005 1005
                 foreach ($rows as $record) {
1006 1006
                     // backup data
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
                             'current_field' => 'data',
1012 1012
                             'value_id' => $record['id'],
1013 1013
                             'value' => $record['data'],
1014
-                            'current_sql' => 'UPDATE ' . prefixTable('categories_items') . " SET data = '" . $record['data'] . "' WHERE id = '" . $record['id'] . "';",
1014
+                            'current_sql' => 'UPDATE '.prefixTable('categories_items')." SET data = '".$record['data']."' WHERE id = '".$record['id']."';",
1015 1015
                             'value2' => 'none',
1016 1016
                             'result' => 'none',
1017 1017
                         )
@@ -1059,9 +1059,9 @@  discard block
 block discarded – undo
1059 1059
                 // Change all encrypted data in FILES (passwords)
1060 1060
                 $rows = DB::query(
1061 1061
                     'SELECT id, file, status
1062
-                    FROM ' . prefixTable('files') . "
1062
+                    FROM ' . prefixTable('files')."
1063 1063
                     WHERE status = 'encrypted'
1064
-                    LIMIT " . $post_start . ', ' . $post_length
1064
+                    LIMIT " . $post_start.', '.$post_length
1065 1065
                 );
1066 1066
                 foreach ($rows as $record) {
1067 1067
                     // backup data
@@ -1079,20 +1079,20 @@  discard block
 block discarded – undo
1079 1079
                     );
1080 1080
                     $newID = DB::insertId();
1081 1081
 
1082
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
1082
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
1083 1083
                         // make a copy of file
1084 1084
                         if (!copy(
1085
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
1086
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '.copy'
1085
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
1086
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'.copy'
1087 1087
                         )) {
1088 1088
                             $error = 'Copy not possible';
1089 1089
                             exit;
1090 1090
                         } else {
1091 1091
                             // prepare a bck of file (that will not be deleted)
1092
-                            $backup_filename = $record['file'] . '.bck-change-sk.' . time();
1092
+                            $backup_filename = $record['file'].'.bck-change-sk.'.time();
1093 1093
                             copy(
1094
-                                $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
1095
-                                $SETTINGS['path_to_upload_folder'] . '/' . $backup_filename
1094
+                                $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
1095
+                                $SETTINGS['path_to_upload_folder'].'/'.$backup_filename
1096 1096
                             );
1097 1097
                         }
1098 1098
 
@@ -1100,24 +1100,24 @@  discard block
 block discarded – undo
1100 1100
                         // STEP1 - Do decryption
1101 1101
                         prepareFileWithDefuse(
1102 1102
                             'decrypt',
1103
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
1104
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted',
1103
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
1104
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted',
1105 1105
                             $SETTINGS
1106 1106
                         );
1107 1107
 
1108 1108
                         // Do cleanup of files
1109
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file']);
1109
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file']);
1110 1110
 
1111 1111
                         // STEP2 - Do encryption
1112 1112
                         prepareFileWithDefuse(
1113 1113
                             'encryp',
1114
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted',
1115
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['file'],
1114
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted',
1115
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['file'],
1116 1116
                             $SETTINGS
1117 1117
                         );
1118 1118
 
1119 1119
                         // Do cleanup of files
1120
-                        unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted');
1120
+                        unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted');
1121 1121
 
1122 1122
                         // Update backup table
1123 1123
                         DB::update(
@@ -1143,13 +1143,13 @@  discard block
 block discarded – undo
1143 1143
                 // do some things for new object
1144 1144
                 if (isset($objects[0])) {
1145 1145
                     if ($objects[0] === 'logs') {
1146
-                        DB::query('SELECT increment_id FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
1146
+                        DB::query('SELECT increment_id FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
1147 1147
                     } elseif ($objects[0] === 'files') {
1148
-                        DB::query('SELECT id FROM ' . prefixTable('files'));
1148
+                        DB::query('SELECT id FROM '.prefixTable('files'));
1149 1149
                     } elseif ($objects[0] === 'categories') {
1150
-                        DB::query('SELECT id FROM ' . prefixTable('categories_items'));
1150
+                        DB::query('SELECT id FROM '.prefixTable('categories_items'));
1151 1151
                     } elseif ($objects[0] === 'custfields') {
1152
-                        DB::query('SELECT raison FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
1152
+                        DB::query('SELECT raison FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification');
1153 1153
                     }
1154 1154
                     $nb_of_items = DB::count();
1155 1155
                 } else {
@@ -1268,12 +1268,12 @@  discard block
 block discarded – undo
1268 1268
                 );
1269 1269
             } elseif ($record['current_table'] === 'files') {
1270 1270
                 // restore backup file
1271
-                if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value'])) {
1272
-                    unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value']);
1273
-                    if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1271
+                if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value'])) {
1272
+                    unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value']);
1273
+                    if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1274 1274
                         rename(
1275
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value2'],
1276
-                            $SETTINGS['path_to_upload_folder'] . '/' . $record['value']
1275
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value2'],
1276
+                            $SETTINGS['path_to_upload_folder'].'/'.$record['value']
1277 1277
                         );
1278 1278
                     }
1279 1279
                 }
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
         }
1293 1293
 
1294 1294
         // drop table
1295
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1295
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1296 1296
 
1297 1297
         // Send back
1298 1298
         echo prepareExchangedData(
@@ -1335,17 +1335,17 @@  discard block
 block discarded – undo
1335 1335
         // delete files
1336 1336
         $rows = DB::query(
1337 1337
             'SELECT value, value2
1338
-            FROM ' . prefixTable('sk_reencrypt_backup') . "
1338
+            FROM ' . prefixTable('sk_reencrypt_backup')."
1339 1339
             WHERE current_table = 'files'"
1340 1340
         );
1341 1341
         foreach ($rows as $record) {
1342
-            if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) {
1343
-                unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value2']);
1342
+            if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) {
1343
+                unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value2']);
1344 1344
             }
1345 1345
         }
1346 1346
 
1347 1347
         // drop table
1348
-        DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup'));
1348
+        DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup'));
1349 1349
 
1350 1350
         echo '[{"status":"done"}]';
1351 1351
         break;
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
                 'encode'
1377 1377
             );
1378 1378
         } else {
1379
-            require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1379
+            require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1380 1380
 
1381 1381
             //send email
1382 1382
             sendEmail(
@@ -1411,11 +1411,11 @@  discard block
 block discarded – undo
1411 1411
             break;
1412 1412
         }
1413 1413
 
1414
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1414
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1415 1415
 
1416 1416
         $rows = DB::query(
1417 1417
             'SELECT *
1418
-            FROM ' . prefixTable('emails') . '
1418
+            FROM ' . prefixTable('emails').'
1419 1419
             WHERE status = %s OR status = %s',
1420 1420
             'not_sent',
1421 1421
             ''
@@ -1500,9 +1500,9 @@  discard block
 block discarded – undo
1500 1500
             break;
1501 1501
         }
1502 1502
 
1503
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1503
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1504 1504
 
1505
-        $rows = DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', '');
1505
+        $rows = DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', '');
1506 1506
         foreach ($rows as $record) {
1507 1507
             //send email
1508 1508
             $ret = json_decode(
@@ -1570,7 +1570,7 @@  discard block
 block discarded – undo
1570 1570
             break;
1571 1571
         }
1572 1572
 
1573
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1573
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1574 1574
 
1575 1575
         // init
1576 1576
         $filesList = array();
@@ -1583,7 +1583,7 @@  discard block
 block discarded – undo
1583 1583
                 FROM ' . prefixTable('files')
1584 1584
             );
1585 1585
             foreach ($rows as $record) {
1586
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) {
1586
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) {
1587 1587
                     $addFile = false;
1588 1588
                     if (($post_option === 'attachments-decrypt' && $record['status'] === 'encrypted')
1589 1589
                         || ($post_option === 'attachments-encrypt' && $record['status'] === 'clear')
@@ -1648,8 +1648,8 @@  discard block
 block discarded – undo
1648 1648
         $post_list = filter_var_array($post_list, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
1649 1649
         $post_counter = filter_var($post_counter, FILTER_SANITIZE_NUMBER_INT);
1650 1650
 
1651
-        include $SETTINGS['cpassman_dir'] . '/includes/config/settings.php';
1652
-        include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1651
+        include $SETTINGS['cpassman_dir'].'/includes/config/settings.php';
1652
+        include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1653 1653
 
1654 1654
         $cpt = 0;
1655 1655
         $continu = true;
@@ -1662,35 +1662,35 @@  discard block
 block discarded – undo
1662 1662
                 // Get file name
1663 1663
                 $file_info = DB::queryfirstrow(
1664 1664
                     'SELECT file
1665
-                    FROM ' . prefixTable('files') . '
1665
+                    FROM ' . prefixTable('files').'
1666 1666
                     WHERE id = %i',
1667 1667
                     $file
1668 1668
                 );
1669 1669
 
1670 1670
                 // skip file is Coherancey not respected
1671
-                if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'])) {
1671
+                if (is_file($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'])) {
1672 1672
                     // Case where we want to decrypt
1673 1673
                     if ($post_option === 'decrypt') {
1674 1674
                         prepareFileWithDefuse(
1675 1675
                             'decrypt',
1676
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
1677
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1676
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
1677
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1678 1678
                             $SETTINGS
1679 1679
                         );
1680 1680
                         // Case where we want to encrypt
1681 1681
                     } elseif ($post_option === 'encrypt') {
1682 1682
                         prepareFileWithDefuse(
1683 1683
                             'encrypt',
1684
-                            $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'],
1685
-                            $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1684
+                            $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'],
1685
+                            $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1686 1686
                             $SETTINGS
1687 1687
                         );
1688 1688
                     }
1689 1689
                     // Do file cleanup
1690
-                    fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], $SETTINGS);
1690
+                    fileDelete($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], $SETTINGS);
1691 1691
                     rename(
1692
-                        $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'],
1693
-                        $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file']
1692
+                        $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'],
1693
+                        $SETTINGS['path_to_upload_folder'].'/'.$file_info['file']
1694 1694
                     );
1695 1695
 
1696 1696
                     // store in DB
@@ -1725,8 +1725,8 @@  discard block
 block discarded – undo
1725 1725
                 $post_option === 'attachments-decrypt' ? 'clear' : 'encrypted'
1726 1726
             );
1727 1727
 
1728
-            $message = $lang->get('last_execution') . ' ' .
1729
-                date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) .
1728
+            $message = $lang->get('last_execution').' '.
1729
+                date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()).
1730 1730
                 '<i class="fas fa-check text-success ml-2 mr-3"></i>';
1731 1731
         }
1732 1732
 
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_NUMBER_INT);
1821 1821
 
1822 1822
             DB::query(
1823
-                'DELETE FROM ' . prefixTable('api') . ' WHERE increment_id = %i',
1823
+                'DELETE FROM '.prefixTable('api').' WHERE increment_id = %i',
1824 1824
                 $post_id
1825 1825
             );
1826 1826
         }
@@ -1915,7 +1915,7 @@  discard block
 block discarded – undo
1915 1915
             // Delete existing key
1916 1916
         } elseif (null !== $post_action && $post_action === 'delete') {
1917 1917
             $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
1918
-            DB::query('DELETE FROM ' . prefixTable('api') . ' WHERE increment_id=%i', $post_id);
1918
+            DB::query('DELETE FROM '.prefixTable('api').' WHERE increment_id=%i', $post_id);
1919 1919
         }
1920 1920
 
1921 1921
         echo prepareExchangedData(
@@ -1930,7 +1930,7 @@  discard block
 block discarded – undo
1930 1930
 
1931 1931
     case 'save_api_status':
1932 1932
         // Do query
1933
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'api');
1933
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'api');
1934 1934
         $counter = DB::count();
1935 1935
         if ($counter === 0) {
1936 1936
             DB::insert(
@@ -1957,7 +1957,7 @@  discard block
 block discarded – undo
1957 1957
 
1958 1958
     case 'run_duo_config_check':
1959 1959
         //Libraries call
1960
-        require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1960
+        require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1961 1961
         // Check KEY
1962 1962
         if ($post_key !== $session->get('key')) {
1963 1963
             echo prepareExchangedData(
@@ -2000,7 +2000,7 @@  discard block
 block discarded – undo
2000 2000
             echo prepareExchangedData(
2001 2001
                     array(
2002 2002
                         'error' => true,
2003
-                        'message' => $lang->get('duo_config_error') . "<br/>Duo: " . $e->getMessage(),
2003
+                        'message' => $lang->get('duo_config_error')."<br/>Duo: ".$e->getMessage(),
2004 2004
                     ),
2005 2005
                     'encode'
2006 2006
             );
@@ -2020,7 +2020,7 @@  discard block
 block discarded – undo
2020 2020
                 $duo_error = $lang->get('duo_error_secure');
2021 2021
                 $data["duo_check"] = "failed";
2022 2022
             }*/
2023
-            $duo_error = $lang->get('duo_error_check_config') . "<br/>Duo: " . $e->getMessage();
2023
+            $duo_error = $lang->get('duo_error_check_config')."<br/>Duo: ".$e->getMessage();
2024 2024
             echo prepareExchangedData(
2025 2025
                     array(
2026 2026
                         'error' => true,
@@ -2065,7 +2065,7 @@  discard block
 block discarded – undo
2065 2065
         } else {
2066 2066
             $tmp = 1;
2067 2067
         }
2068
-        DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
2068
+        DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication');
2069 2069
         $counter = DB::count();
2070 2070
         if ($counter === 0) {
2071 2071
             DB::insert(
@@ -2091,7 +2091,7 @@  discard block
 block discarded – undo
2091 2091
 
2092 2092
         // ga_website_name
2093 2093
         if (is_null($dataReceived['ga_website_name']) === false) {
2094
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
2094
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name');
2095 2095
             $counter = DB::count();
2096 2096
             if ($counter === 0) {
2097 2097
                 DB::insert(
@@ -2122,7 +2122,7 @@  discard block
 block discarded – undo
2122 2122
         }
2123 2123
 
2124 2124
         // send data
2125
-        echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]';
2125
+        echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]';
2126 2126
         break;
2127 2127
 
2128 2128
     case 'save_agses_options':
@@ -2145,7 +2145,7 @@  discard block
 block discarded – undo
2145 2145
 
2146 2146
         // agses_hosted_url
2147 2147
         if (!is_null($dataReceived['agses_hosted_url'])) {
2148
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
2148
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url');
2149 2149
             $counter = DB::count();
2150 2150
             if ($counter === 0) {
2151 2151
                 DB::insert(
@@ -2174,7 +2174,7 @@  discard block
 block discarded – undo
2174 2174
 
2175 2175
         // agses_hosted_id
2176 2176
         if (!is_null($dataReceived['agses_hosted_id'])) {
2177
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
2177
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id');
2178 2178
             $counter = DB::count();
2179 2179
             if ($counter === 0) {
2180 2180
                 DB::insert(
@@ -2203,7 +2203,7 @@  discard block
 block discarded – undo
2203 2203
 
2204 2204
         // agses_hosted_apikey
2205 2205
         if (!is_null($dataReceived['agses_hosted_apikey'])) {
2206
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2206
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey');
2207 2207
             $counter = DB::count();
2208 2208
             if ($counter === 0) {
2209 2209
                 DB::insert(
@@ -2231,7 +2231,7 @@  discard block
 block discarded – undo
2231 2231
         }
2232 2232
 
2233 2233
         // send data
2234
-        echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]';
2234
+        echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]';
2235 2235
         break;
2236 2236
 
2237 2237
     case 'save_option_change':
@@ -2271,7 +2271,7 @@  discard block
 block discarded – undo
2271 2271
 
2272 2272
         // Check if setting is already in DB. If NO then insert, if YES then update.
2273 2273
         $data = DB::query(
2274
-            'SELECT * FROM ' . prefixTable('misc') . '
2274
+            'SELECT * FROM '.prefixTable('misc').'
2275 2275
             WHERE type = %s AND intitule = %s',
2276 2276
             'admin',
2277 2277
             $post_field
@@ -2293,7 +2293,7 @@  discard block
 block discarded – undo
2293 2293
                     array(
2294 2294
                         'valeur' => time(),
2295 2295
                         'type' => 'admin',
2296
-                        'intitule' => $post_field . '_time',
2296
+                        'intitule' => $post_field.'_time',
2297 2297
                     )
2298 2298
                 );
2299 2299
             }
@@ -2311,10 +2311,10 @@  discard block
 block discarded – undo
2311 2311
             if ($post_field === 'send_stats') {
2312 2312
                 // Check if previous time exists, if not them insert this value in DB
2313 2313
                 DB::query(
2314
-                    'SELECT * FROM ' . prefixTable('misc') . '
2314
+                    'SELECT * FROM '.prefixTable('misc').'
2315 2315
                     WHERE type = %s AND intitule = %s',
2316 2316
                     'admin',
2317
-                    $post_field . '_time'
2317
+                    $post_field.'_time'
2318 2318
                 );
2319 2319
                 $counter = DB::count();
2320 2320
                 if ($counter === 0) {
@@ -2323,7 +2323,7 @@  discard block
 block discarded – undo
2323 2323
                         array(
2324 2324
                             'valeur' => 0,
2325 2325
                             'type' => 'admin',
2326
-                            'intitule' => $post_field . '_time',
2326
+                            'intitule' => $post_field.'_time',
2327 2327
                         )
2328 2328
                     );
2329 2329
                 } else {
@@ -2343,13 +2343,13 @@  discard block
 block discarded – undo
2343 2343
         // special Cases
2344 2344
         if ($post_field === 'cpassman_url') {
2345 2345
             // update also jsUrl for CSFP protection
2346
-            $jsUrl = $post_value . '/includes/libraries/csrfp/js/csrfprotector.js';
2346
+            $jsUrl = $post_value.'/includes/libraries/csrfp/js/csrfprotector.js';
2347 2347
             $csrfp_file = '../includes/libraries/csrfp/libs/csrfp.config.php';
2348 2348
             $data = file_get_contents($csrfp_file);
2349 2349
             $posJsUrl = strpos($data, '"jsUrl" => "');
2350 2350
             $posEndLine = strpos($data, '",', $posJsUrl);
2351 2351
             $line = substr($data, $posJsUrl, ($posEndLine - $posJsUrl + 2));
2352
-            $newdata = str_replace($line, '"jsUrl" => "' . filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS) . '",', $data);
2352
+            $newdata = str_replace($line, '"jsUrl" => "'.filter_var($jsUrl, FILTER_SANITIZE_FULL_SPECIAL_CHARS).'",', $data);
2353 2353
             file_put_contents($csrfp_file, $newdata);
2354 2354
         } elseif ($post_field === 'restricted_to_input' && (int) $post_value === 0) {
2355 2355
             DB::update(
@@ -2378,7 +2378,7 @@  discard block
 block discarded – undo
2378 2378
         echo prepareExchangedData(
2379 2379
             array(
2380 2380
                 'error' => false,
2381
-                'misc' => $counter . ' ; ' . $SETTINGS[$post_field],
2381
+                'misc' => $counter.' ; '.$SETTINGS[$post_field],
2382 2382
                 'message' => empty($post_translate) === false ? $lang->get($post_translate) : '',
2383 2383
             ),
2384 2384
             'encode'
@@ -2421,7 +2421,7 @@  discard block
 block discarded – undo
2421 2421
 
2422 2422
         // send statistics
2423 2423
         if (null !== $post_status) {
2424
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2424
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_stats');
2425 2425
             $counter = DB::count();
2426 2426
             if ($counter === 0) {
2427 2427
                 DB::insert(
@@ -2453,7 +2453,7 @@  discard block
 block discarded – undo
2453 2453
 
2454 2454
         // send statistics items
2455 2455
         if (null !== $post_list) {
2456
-            DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2456
+            DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items');
2457 2457
             $counter = DB::count();
2458 2458
             if ($counter === 0) {
2459 2459
                 DB::insert(
@@ -2500,7 +2500,7 @@  discard block
 block discarded – undo
2500 2500
             break;
2501 2501
         }
2502 2502
 
2503
-        if (DB::query("SHOW TABLES LIKE '" . prefixTable('sk_reencrypt_backup') . "'")) {
2503
+        if (DB::query("SHOW TABLES LIKE '".prefixTable('sk_reencrypt_backup')."'")) {
2504 2504
             if (DB::count() === 1) {
2505 2505
                 echo 1;
2506 2506
             } else {
@@ -2538,7 +2538,7 @@  discard block
 block discarded – undo
2538 2538
 
2539 2539
         $rows = DB::query(
2540 2540
             'SELECT id, title
2541
-                FROM ' . prefixTable('roles_title') . '
2541
+                FROM ' . prefixTable('roles_title').'
2542 2542
                 ORDER BY title ASC'
2543 2543
         );
2544 2544
         foreach ($rows as $record) {
Please login to merge, or discard this patch.
sources/folders.queries.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 ) {
64 64
     // Not allowed page
65 65
     $session->set('system-error_code', ERR_NOT_ALLOWED);
66
-    include $SETTINGS['cpassman_dir'] . '/error.php';
66
+    include $SETTINGS['cpassman_dir'].'/error.php';
67 67
     exit;
68 68
 }
69 69
 
@@ -138,14 +138,14 @@  discard block
 block discarded – undo
138 138
                     && $t->personal_folder == 0
139 139
                 ) {
140 140
                     // get $t->parent_id
141
-                    $data = DB::queryFirstRow('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', $t->parent_id);
141
+                    $data = DB::queryFirstRow('SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', $t->parent_id);
142 142
                     if ($t->nlevel == 1) {
143 143
                         $data['title'] = $lang->get('root');
144 144
                     }
145 145
 
146 146
                     // get rights on this folder
147 147
                     $arrayRights = array();
148
-                    $rows = DB::query('SELECT fonction_id  FROM ' . prefixTable('rights') . ' WHERE authorized=%i AND tree_id = %i', 1, $t->id);
148
+                    $rows = DB::query('SELECT fonction_id  FROM '.prefixTable('rights').' WHERE authorized=%i AND tree_id = %i', 1, $t->id);
149 149
                     foreach ($rows as $record) {
150 150
                         array_push($arrayRights, $record['fonction_id']);
151 151
                     }
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
                         'SELECT m.valeur AS valeur, n.renewal_period AS renewal_period,
164 164
                         n.bloquer_creation AS bloquer_creation, n.bloquer_modification AS bloquer_modification,
165 165
                         n.fa_icon, n.fa_icon_selected
166
-                        FROM ' . prefixTable('misc') . ' AS m,
167
-                        ' . prefixTable('nested_tree') . ' AS n
166
+                        FROM ' . prefixTable('misc').' AS m,
167
+                        ' . prefixTable('nested_tree').' AS n
168 168
                         WHERE m.type=%s AND m.intitule = n.id AND m.intitule = %i',
169 169
                         'complex',
170 170
                         $t->id
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                     //col7
198 198
                     $data7 = DB::queryFirstRow(
199 199
                         'SELECT bloquer_creation,bloquer_modification
200
-                        FROM ' . prefixTable('nested_tree') . '
200
+                        FROM ' . prefixTable('nested_tree').'
201 201
                         WHERE id = %i',
202 202
                         intval($t->id)
203 203
                     );
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
             // Get info about this folder
337 337
             $dataFolder = DB::queryfirstrow(
338 338
                 'SELECT *
339
-                FROM ' . prefixTable('nested_tree') . '
339
+                FROM ' . prefixTable('nested_tree').'
340 340
                 WHERE id = %i',
341 341
                 $post_folder_id
342 342
             );
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
             //check if parent folder is personal
373 373
             $dataParent = DB::queryfirstrow(
374 374
                 'SELECT personal_folder, bloquer_creation, bloquer_modification
375
-                FROM ' . prefixTable('nested_tree') . '
375
+                FROM ' . prefixTable('nested_tree').'
376 376
                 WHERE id = %i',
377 377
                 $post_parent_id
378 378
             );
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                     // get complexity level for this folder
402 402
                     $data = DB::queryfirstrow(
403 403
                         'SELECT valeur
404
-                        FROM ' . prefixTable('misc') . '
404
+                        FROM ' . prefixTable('misc').'
405 405
                         WHERE intitule = %i AND type = %s',
406 406
                         $post_parent_id,
407 407
                         'complex'
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
                             array(
413 413
                                 'error' => true,
414 414
                                 'message' => $lang->get('error_folder_complexity_lower_than_top_folder')
415
-                                    . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]',
415
+                                    . ' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]',
416 416
                             ),
417 417
                             'encode'
418 418
                         );
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
             ) {
566 566
                 DB::query(
567 567
                     'SELECT *
568
-                    FROM ' . prefixTable('nested_tree') . '
568
+                    FROM ' . prefixTable('nested_tree').'
569 569
                     WHERE title = %s',
570 570
                     $post_title
571 571
                 );
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
             //check if parent folder is personal
586 586
             $data = DB::queryfirstrow(
587 587
                 'SELECT personal_folder, bloquer_creation, bloquer_modification
588
-                FROM ' . prefixTable('nested_tree') . '
588
+                FROM ' . prefixTable('nested_tree').'
589 589
                 WHERE id = %i',
590 590
                 $post_parent_id
591 591
             );
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
                     // get complexity level for this folder
615 615
                     $data = DB::queryfirstrow(
616 616
                         'SELECT valeur
617
-                        FROM ' . prefixTable('misc') . '
617
+                        FROM ' . prefixTable('misc').'
618 618
                         WHERE intitule = %i AND type = %s',
619 619
                         $post_parent_id,
620 620
                         'complex'
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
                             array(
625 625
                                 'error' => true,
626 626
                                 'message' => $lang->get('error_folder_complexity_lower_than_top_folder')
627
-                                    . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]',
627
+                                    . ' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]',
628 628
                             ),
629 629
                             'encode'
630 630
                         );
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
                     && (int) $SETTINGS['subfolder_rights_as_parent'] === 1
775 775
                 ) {
776 776
                     //If it is a subfolder, then give access to it for all roles that allows the parent folder
777
-                    $rows = DB::query('SELECT role_id, type FROM ' . prefixTable('roles_values') . ' WHERE folder_id = %i', $post_parent_id);
777
+                    $rows = DB::query('SELECT role_id, type FROM '.prefixTable('roles_values').' WHERE folder_id = %i', $post_parent_id);
778 778
                     foreach ($rows as $record) {
779 779
                         //add access to this subfolder
780 780
                         DB::insert(
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
                 }
805 805
 
806 806
                 // if parent folder has Custom Fields Categories then add to this child one too
807
-                $rows = DB::query('SELECT id_category FROM ' . prefixTable('categories_folders') . ' WHERE id_folder = %i', $post_parent_id);
807
+                $rows = DB::query('SELECT id_category FROM '.prefixTable('categories_folders').' WHERE id_folder = %i', $post_parent_id);
808 808
                 foreach ($rows as $record) {
809 809
                     //add CF Category to this subfolder
810 810
                     DB::insert(
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
                 }
818 818
 
819 819
                 // clear cache cache for each user that have at least one similar role as the current user
820
-                $usersWithSimilarRoles = empty($session->get('user-roles')) === false  ? getUsersWithRoles(
820
+                $usersWithSimilarRoles = empty($session->get('user-roles')) === false ? getUsersWithRoles(
821 821
                     explode(";", $session->get('user-roles'))
822 822
                 ) : [];
823 823
                 foreach ($usersWithSimilarRoles as $user) {
@@ -897,17 +897,17 @@  discard block
 block discarded – undo
897 897
                                 prefixTable('misc'),
898 898
                                 array(
899 899
                                     'type' => 'folder_deleted',
900
-                                    'intitule' => 'f' . $thisSubFolders->id,
901
-                                    'valeur' => $thisSubFolders->id . ', ' . $thisSubFolders->parent_id . ', ' .
902
-                                        $thisSubFolders->title . ', ' . $thisSubFolders->nleft . ', ' . $thisSubFolders->nright . ', ' .
903
-                                        $thisSubFolders->nlevel . ', 0, 0, 0, 0',
900
+                                    'intitule' => 'f'.$thisSubFolders->id,
901
+                                    'valeur' => $thisSubFolders->id.', '.$thisSubFolders->parent_id.', '.
902
+                                        $thisSubFolders->title.', '.$thisSubFolders->nleft.', '.$thisSubFolders->nright.', '.
903
+                                        $thisSubFolders->nlevel.', 0, 0, 0, 0',
904 904
                                 )
905 905
                             );
906 906
                             //array for delete folder
907 907
                             $folderForDel[] = $thisSubFolders->id;
908 908
 
909 909
                             //delete items & logs
910
-                            $itemsInSubFolder = DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE id_tree=%i', $thisSubFolders->id);
910
+                            $itemsInSubFolder = DB::query('SELECT id FROM '.prefixTable('items').' WHERE id_tree=%i', $thisSubFolders->id);
911 911
                             foreach ($itemsInSubFolder as $item) {
912 912
                                 DB::update(
913 913
                                     prefixTable('items'),
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
                                 }
935 935
 
936 936
                                 //Update CACHE table
937
-                                updateCacheTable('delete_value',(int) $item['id']);
937
+                                updateCacheTable('delete_value', (int) $item['id']);
938 938
 
939 939
                                 // --> build json tree  
940 940
                                 // update cache_tree
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
                                     FROM ' . prefixTable('cache_tree').' WHERE user_id = %i',
944 944
                                     (int) $session->get('user-id')
945 945
                                 );
946
-                                if (DB::count()>0) {
946
+                                if (DB::count() > 0) {
947 947
                                     // remove id from folders
948 948
                                     $a_folders = json_decode($cache_tree['folders'], true);
949 949
                                     $key = array_search($item['id'], $a_folders, true);
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
             $tree->rebuild();
990 990
 
991 991
             // reload cache table
992
-            include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
992
+            include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
993 993
             updateCacheTable('reload', null);
994 994
 
995 995
             // Update timestamp
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
                 // get complexity of current node
1085 1085
                 $nodeComplexity = DB::queryfirstrow(
1086 1086
                     'SELECT valeur
1087
-                    FROM ' . prefixTable('misc') . '
1087
+                    FROM ' . prefixTable('misc').'
1088 1088
                     WHERE intitule = %i AND type= %s',
1089 1089
                     $nodeInfo->id,
1090 1090
                     'complex'
@@ -1160,7 +1160,7 @@  discard block
 block discarded – undo
1160 1160
                 // If it is a subfolder, then give access to it for all roles that allows the parent folder
1161 1161
                 $rows = DB::query(
1162 1162
                     'SELECT role_id, type
1163
-                    FROM ' . prefixTable('roles_values') . '
1163
+                    FROM ' . prefixTable('roles_values').'
1164 1164
                     WHERE folder_id = %i',
1165 1165
                     $parentId
1166 1166
                 );
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
                     // Add access to this subfolder after checking that it is not already set
1169 1169
                     DB::query(
1170 1170
                         'SELECT *
1171
-                        FROM ' . prefixTable('roles_values') . '
1171
+                        FROM ' . prefixTable('roles_values').'
1172 1172
                         WHERE folder_id = %i AND role_id = %i',
1173 1173
                         $newFolderId,
1174 1174
                         $record['role_id']
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
                 // if parent folder has Custom Fields Categories then add to this child one too
1189 1189
                 $rows = DB::query(
1190 1190
                     'SELECT id_category
1191
-                    FROM ' . prefixTable('categories_folders') . '
1191
+                    FROM ' . prefixTable('categories_folders').'
1192 1192
                     WHERE id_folder = %i',
1193 1193
                     $nodeInfo->id
1194 1194
                 );
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
 
1208 1208
                 $rows = DB::query(
1209 1209
                     'SELECT *
1210
-                    FROM ' . prefixTable('items') . '
1210
+                    FROM ' . prefixTable('items').'
1211 1211
                     WHERE id_tree = %i',
1212 1212
                     $nodeInfo->id
1213 1213
                 );
@@ -1216,7 +1216,7 @@  discard block
 block discarded – undo
1216 1216
                     // if it is then don't copy it
1217 1217
                     $item_deleted = DB::queryFirstRow(
1218 1218
                         'SELECT *
1219
-                        FROM ' . prefixTable('log_items') . '
1219
+                        FROM ' . prefixTable('log_items').'
1220 1220
                         WHERE id_item = %i AND action = %s
1221 1221
                         ORDER BY date DESC
1222 1222
                         LIMIT 0, 1',
@@ -1227,7 +1227,7 @@  discard block
 block discarded – undo
1227 1227
 
1228 1228
                     $item_restored = DB::queryFirstRow(
1229 1229
                         'SELECT *
1230
-                        FROM ' . prefixTable('log_items') . '
1230
+                        FROM ' . prefixTable('log_items').'
1231 1231
                         WHERE id_item = %i AND action = %s
1232 1232
                         ORDER BY date DESC
1233 1233
                         LIMIT 0, 1',
@@ -1242,7 +1242,7 @@  discard block
 block discarded – undo
1242 1242
                         // Get the ITEM object key for the user
1243 1243
                         $userKey = DB::queryFirstRow(
1244 1244
                             'SELECT share_key
1245
-                            FROM ' . prefixTable('sharekeys_items') . '
1245
+                            FROM ' . prefixTable('sharekeys_items').'
1246 1246
                             WHERE user_id = %i AND object_id = %i',
1247 1247
                             $session->get('user-id'),
1248 1248
                             $record['id']
@@ -1316,7 +1316,7 @@  discard block
 block discarded – undo
1316 1316
                         // Manage Custom Fields
1317 1317
                         $categories = DB::query(
1318 1318
                             'SELECT *
1319
-                            FROM ' . prefixTable('categories_items') . '
1319
+                            FROM ' . prefixTable('categories_items').'
1320 1320
                             WHERE item_id = %i',
1321 1321
                             $record['id']
1322 1322
                         );
@@ -1364,15 +1364,15 @@  discard block
 block discarded – undo
1364 1364
                         $files = DB::query(
1365 1365
                             'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension,
1366 1366
                             f.size AS size, f.type AS type, s.share_key AS share_key
1367
-                            FROM ' . prefixTable('files') . ' AS f
1368
-                            INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id)
1367
+                            FROM ' . prefixTable('files').' AS f
1368
+                            INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id)
1369 1369
                             WHERE s.user_id = %i AND f.id_item = %i',
1370 1370
                             $session->get('user-id'),
1371 1371
                             $record['id']
1372 1372
                         );
1373 1373
                         foreach ($files as $file) {
1374 1374
                             // Check if file still exists
1375
-                            if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($file['file'])) === true) {
1375
+                            if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($file['file'])) === true) {
1376 1376
                                 // Step1 - decrypt the file
1377 1377
                                 $fileContent = decryptFile(
1378 1378
                                     $file['file'],
@@ -1381,9 +1381,9 @@  discard block
 block discarded – undo
1381 1381
                                 );
1382 1382
 
1383 1383
                                 // Step2 - create file
1384
-                                $newFileName = md5(time() . '_' . $file['id']) . '.' . $file['extension'];
1384
+                                $newFileName = md5(time().'_'.$file['id']).'.'.$file['extension'];
1385 1385
 
1386
-                                $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab');
1386
+                                $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab');
1387 1387
                                 if ($outstream === false) {
1388 1388
                                     echo prepareExchangedData(
1389 1389
                                         array(
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
             $tree->rebuild();
1458 1458
 
1459 1459
             // reload cache table
1460
-            include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php';
1460
+            include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php';
1461 1461
             updateCacheTable('reload', NULL);
1462 1462
 
1463 1463
             // Update timestamp
@@ -1532,7 +1532,7 @@  discard block
 block discarded – undo
1532 1532
                     // Get path
1533 1533
                     $text = '';
1534 1534
                     foreach ($tree->getPath($folder->id, false) as $fld) {
1535
-                        $text .= empty($text) === true ? '     [<i>' . $fld->title : ' > ' . $fld->title;
1535
+                        $text .= empty($text) === true ? '     [<i>'.$fld->title : ' > '.$fld->title;
1536 1536
                     }
1537 1537
 
1538 1538
                     // Save array
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
                             'id' => (int) $folder->id,
1543 1543
                             'label' => $folder->title,
1544 1544
                             'level' => $folder->nlevel,
1545
-                            'path' => empty($text) === true ? '' : $text . '</i>]'
1545
+                            'path' => empty($text) === true ? '' : $text.'</i>]'
1546 1546
                         )
1547 1547
                     );
1548 1548
                 }
Please login to merge, or discard this patch.
sources/tasks.queries.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 ) {
69 69
     // Not allowed page
70 70
     $session->set('system-error_code', ERR_NOT_ALLOWED);
71
-    include $SETTINGS['cpassman_dir'] . '/error.php';
71
+    include $SETTINGS['cpassman_dir'].'/error.php';
72 72
     exit;
73 73
 }
74 74
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
     // get exec from processes table
154 154
     $rows = DB::query(
155 155
         'SELECT max(finished_at), process_type
156
-        FROM ' . prefixTable('processes') . '
156
+        FROM ' . prefixTable('processes').'
157 157
         GROUP BY process_type'
158 158
     );
159 159
     foreach ($rows as $row) {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     // get exec from processes_log table
170 170
     $rows = DB::query(
171 171
         'SELECT MAX(finished_at) AS max_finished_at, job AS process_type 
172
-        FROM ' . prefixTable('processes_logs') . '
172
+        FROM ' . prefixTable('processes_logs').'
173 173
         WHERE finished_at >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 7 DAY))
174 174
         GROUP BY process_type'
175 175
     );
Please login to merge, or discard this patch.
sources/fields.queries.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 ) {
68 68
     // Not allowed page
69 69
     $session->set('system-error_code', ERR_NOT_ALLOWED);
70
-    include $SETTINGS['cpassman_dir'] . '/error.php';
70
+    include $SETTINGS['cpassman_dir'].'/error.php';
71 71
     exit;
72 72
 }
73 73
 
@@ -538,8 +538,7 @@  discard block
 block discarded – undo
538 538
             $post_masked = filter_var($dataReceived['masked'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
539 539
             $post_encrypted = filter_var($dataReceived['encrypted'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
540 540
             $post_roles = filter_var_array($dataReceived['roles'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
541
-            $post_fieldId = isset($dataReceived['fieldId']) === false ? '' :
542
-                filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT);
541
+            $post_fieldId = isset($dataReceived['fieldId']) === false ? '' : filter_var($dataReceived['fieldId'], FILTER_SANITIZE_NUMBER_INT);
543 542
 
544 543
             if (empty($post_fieldId) === false) {
545 544
                 // UPDATE FIELD
@@ -555,7 +554,7 @@  discard block
 block discarded – undo
555 554
                         'encrypted_data' => $post_encrypted,
556 555
                         'is_mandatory' => $post_mandatory,
557 556
                         'masked' => $post_masked,
558
-                        'role_visibility' => is_null($post_roles) === true || count($post_roles) ===0 ? '' : implode(',', $post_roles),
557
+                        'role_visibility' => is_null($post_roles) === true || count($post_roles) === 0 ? '' : implode(',', $post_roles),
559 558
                         'order' => calculateOrder($post_fieldId, $post_order),
560 559
                     ),
561 560
                     'id = %i',
Please login to merge, or discard this patch.
sources/import.queries.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 ) {
69 69
     // Not allowed page
70 70
     $session->set('system-error_code', ERR_NOT_ALLOWED);
71
-    include $SETTINGS['cpassman_dir'] . '/error.php';
71
+    include $SETTINGS['cpassman_dir'].'/error.php';
72 72
     exit;
73 73
 }
74 74
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             $lexer = new Lexer($config);
157 157
             $config->setIgnoreHeaderLine('true');
158 158
             $interpreter = new Interpreter();
159
-            $interpreter->addObserver(function (array $row) use (&$valuesToImport) {
159
+            $interpreter->addObserver(function(array $row) use (&$valuesToImport) {
160 160
                 $valuesToImport[] = array(
161 161
                     'Label' => $row[0],
162 162
                     'Login' => $row[1],
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
         {
498 498
             // Manage entries
499 499
             if (isset($array['Entry']) === true) {
500
-                foreach($array['Entry'] as $key => $value) {
500
+                foreach ($array['Entry'] as $key => $value) {
501 501
                     if (isset($value['String']) === true) {
502 502
                         $itemDefinition = [];
503 503
                         $c = count($value['String']);
@@ -532,13 +532,13 @@  discard block
 block discarded – undo
532 532
             }
533 533
 
534 534
             // Manage GROUPS
535
-            if (isset($array['Group']) === true && is_array($array['Group'])=== true) {
535
+            if (isset($array['Group']) === true && is_array($array['Group']) === true) {
536 536
                 $currentFolderId = $previousFolder;
537 537
                 if (isset($array['Group']['UUID']) === true) {
538 538
                     // build expect array format
539 539
                     $array['Group'] = [$array['Group']];
540 540
                 }
541
-                foreach($array['Group'] as $key => $value){
541
+                foreach ($array['Group'] as $key => $value) {
542 542
                     // Add this new folder
543 543
                     array_push(
544 544
                         $newItemsToAdd['folders'],
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
         ];
632 632
         $startPathLevel = 1;
633 633
 
634
-        foreach($post_folders as $folder) {
634
+        foreach ($post_folders as $folder) {
635 635
             // get parent id
636 636
             $parentId = $arrFolders[$folder['parentFolderId']];
637 637
 
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
     ];
937 937
 }
938 938
 
939
-spl_autoload_register(function ($class) {
939
+spl_autoload_register(function($class) {
940 940
     $prefix = 'League\\Csv\\';
941 941
     $base_dir = __DIR__.'/src/';
942 942
     $len = strlen($prefix);
Please login to merge, or discard this patch.
sources/utilities.queries.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 ) {
70 70
     // Not allowed page
71 71
     $session->set('system-error_code', ERR_NOT_ALLOWED);
72
-    include $SETTINGS['cpassman_dir'] . '/error.php';
72
+    include $SETTINGS['cpassman_dir'].'/error.php';
73 73
     exit;
74 74
 }
75 75
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $arrFolders = array();
121 121
             $rows = DB::query(
122 122
                 'SELECT valeur, intitule
123
-                FROM ' . prefixTable('misc') . '
123
+                FROM ' . prefixTable('misc').'
124 124
                 WHERE type  = %s',
125 125
                 'folder_deleted'
126 126
             );
@@ -142,10 +142,10 @@  discard block
 block discarded – undo
142 142
                 'SELECT u.login as login, u.name as name, u.lastname as lastname,
143 143
                 i.id as id, i.label as label,
144 144
                 i.id_tree as id_tree, l.date as date, n.title as folder_title
145
-                FROM ' . prefixTable('log_items') . ' as l
146
-                INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id)
147
-                LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id)
148
-                LEFT JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree=n.id)
145
+                FROM ' . prefixTable('log_items').' as l
146
+                INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id)
147
+                LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id)
148
+                LEFT JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree=n.id)
149 149
                 WHERE i.inactif = %i
150 150
                 AND l.action = %s',
151 151
                 1,
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                             'label' => $record['label'],
168 168
                             'date' => date($SETTINGS['date_format'], (int) $record['date']),
169 169
                             'login' => $record['login'],
170
-                            'name' => $record['name'] . ' ' . $record['lastname'],
170
+                            'name' => $record['name'].' '.$record['lastname'],
171 171
                             'folder_label' => $record['folder_title'],
172 172
                             'folder_deleted' => $thisFolder,
173 173
                         )
@@ -225,10 +225,10 @@  discard block
 block discarded – undo
225 225
             foreach ($post_folders as $folderId) {
226 226
                 $data = DB::queryfirstrow(
227 227
                     'SELECT valeur
228
-                    FROM ' . prefixTable('misc') . "
228
+                    FROM ' . prefixTable('misc')."
229 229
                     WHERE type = 'folder_deleted'
230 230
                     AND intitule = %s",
231
-                    'f' . $folderId
231
+                    'f'.$folderId
232 232
                 );
233 233
                 if ((int) $data['valeur'] !== 0) {
234 234
                     $folderData = explode(', ', $data['valeur']);
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
                         prefixTable('misc'),
256 256
                         'type = %s AND intitule = %s',
257 257
                         'folder_deleted',
258
-                        'f' . $folderId
258
+                        'f'.$folderId
259 259
                     );
260 260
 
261 261
                     // Restore all items in this folder
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                     // Get list of all items in thos folder
272 272
                     $items = DB::query(
273 273
                         'SELECT id
274
-                        FROM ' . prefixTable('items') . '
274
+                        FROM ' . prefixTable('items').'
275 275
                         WHERE id_tree = %i',
276 276
                         $folderId
277 277
                     );
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
             foreach ($post_folders as $folderId) {
361 361
                 $data = DB::queryfirstrow(
362 362
                     'SELECT valeur
363
-                    FROM ' . prefixTable('misc') . "
363
+                    FROM ' . prefixTable('misc')."
364 364
                     WHERE type = 'folder_deleted'
365 365
                     AND intitule = %s",
366
-                    'f' . $folderId
366
+                    'f'.$folderId
367 367
                 );
368 368
                 if ((int) $data['valeur'] !== 0) {
369 369
                     $folderData = explode(', ', $data['valeur']);
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                         prefixTable('misc'),
397 397
                         'type = %s AND intitule = %s',
398 398
                         'folder_deleted',
399
-                        'f' . $folderData[0]
399
+                        'f'.$folderData[0]
400 400
                     );
401 401
 
402 402
                     // Delete all items in this folder
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
                     // Get list of all items in thos folder
411 411
                     $items = DB::query(
412 412
                         'SELECT id
413
-                        FROM ' . prefixTable('items') . '
413
+                        FROM ' . prefixTable('items').'
414 414
                         WHERE id_tree = %i',
415 415
                         $folderData[0]
416 416
                     );
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
             ) {
500 500
                 if ($post_log_type === 'items') {
501 501
                     DB::query(
502
-                        'SELECT * FROM ' . prefixTable('log_items') . '
502
+                        'SELECT * FROM '.prefixTable('log_items').'
503 503
                         WHERE (date BETWEEN %i AND %i)'
504 504
                         . ($post_filter_action === 'all' ? '' : ' AND action = "'.$post_filter_action.'"')
505 505
                         . ((int) $post_filter_user === -1 ? '' : ' AND id_user = '.(int) $post_filter_user),
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
                 } elseif ($post_log_type === 'connections') {
520 520
                     //db::debugmode(true);
521 521
                     DB::query(
522
-                        'SELECT * FROM ' . prefixTable('log_system') . '
522
+                        'SELECT * FROM '.prefixTable('log_system').'
523 523
                         WHERE type=%s '
524 524
                         . 'AND (date BETWEEN %i AND %i)'
525 525
                         . ($post_filter_action === 'all' ? '' : ' AND action = '.$post_filter_action)
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
                     );
543 543
                 } elseif ($post_log_type === 'errors') {
544 544
                     DB::query(
545
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
545
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
546 546
                             'AND (date BETWEEN %i AND %i)',
547 547
                         'error',
548 548
                         $post_date_from,
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
                     );
560 560
                 } elseif ($post_log_type === 'copy') {
561 561
                     DB::query(
562
-                        'SELECT * FROM ' . prefixTable('log_items') . ' WHERE action=%s ' .
562
+                        'SELECT * FROM '.prefixTable('log_items').' WHERE action=%s '.
563 563
                             'AND (date BETWEEN %i AND %i)',
564 564
                         'at_copy',
565 565
                         $post_date_from,
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
                     );
577 577
                 } elseif ($post_log_type === 'admin') {
578 578
                     DB::query(
579
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
579
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
580 580
                             'AND (date BETWEEN %i AND %i)',
581 581
                         'admin_action',
582 582
                         $post_date_from,
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
                     );
594 594
                 } elseif ($post_log_type === 'failed') {
595 595
                     DB::query(
596
-                        'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' .
596
+                        'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '.
597 597
                             'AND (date BETWEEN %i AND %i)',
598 598
                         'failed_auth',
599 599
                         $post_date_from,
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 
664 664
             $tasks = DB::query(
665 665
                 'SELECT *
666
-                FROM ' . prefixTable('processes_tasks') . '
666
+                FROM ' . prefixTable('processes_tasks').'
667 667
                 WHERE process_id = %i',
668 668
                 $post_id
669 669
             );
@@ -671,37 +671,37 @@  discard block
 block discarded – undo
671 671
             // Get some values
672 672
             DB::query(
673 673
                 'SELECT id
674
-                FROM ' . prefixTable('items') . '
674
+                FROM ' . prefixTable('items').'
675 675
                 WHERE perso = 0'
676 676
             );
677 677
             $items_number = DB::count();
678 678
 
679 679
             DB::query(
680 680
                 'SELECT increment_id
681
-                FROM ' . prefixTable('log_items') . '
681
+                FROM ' . prefixTable('log_items').'
682 682
                 WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"'
683 683
             );
684 684
             $logs_number = DB::count();
685 685
 
686 686
             DB::query(
687 687
                 'SELECT id
688
-                FROM ' . prefixTable('categories_items') . '
688
+                FROM ' . prefixTable('categories_items').'
689 689
                 WHERE encryption_type = "teampass_aes"'
690 690
             );
691
-            $items_categories= DB::count();
691
+            $items_categories = DB::count();
692 692
 
693 693
             DB::query(
694 694
                 'SELECT id
695 695
                 FROM ' . prefixTable('suggestion')
696 696
             );
697
-            $items_suggestions= DB::count();
697
+            $items_suggestions = DB::count();
698 698
 
699 699
             DB::query(
700 700
                 'SELECT id
701
-                FROM ' . prefixTable('files') . '
702
-                WHERE status = "' . TP_ENCRYPTION_NAME . '"'
701
+                FROM ' . prefixTable('files').'
702
+                WHERE status = "' . TP_ENCRYPTION_NAME.'"'
703 703
             );
704
-            $items_files= DB::count();
704
+            $items_files = DB::count();
705 705
 
706 706
 
707 707
             // get list
@@ -716,26 +716,26 @@  discard block
 block discarded – undo
716 716
                     if ($detail['step'] === 'step0' || (int) $detail['index'] === 0) {
717 717
                         $task_progress = '0%';
718 718
                     } elseif ($detail['step'] === 'step10') {
719
-                        $task_progress = pourcentage($detail['index'], 1, 100) .'%';
719
+                        $task_progress = pourcentage($detail['index'], 1, 100).'%';
720 720
                     } elseif ($detail['step'] === 'step20') {
721
-                        $task_progress = pourcentage($detail['index'], $items_number, 100) .'%';
721
+                        $task_progress = pourcentage($detail['index'], $items_number, 100).'%';
722 722
                     } elseif ($detail['step'] === 'step30') {
723
-                        $task_progress = pourcentage($detail['index'], $logs_number, 100) .'%';
723
+                        $task_progress = pourcentage($detail['index'], $logs_number, 100).'%';
724 724
                     } elseif ($detail['step'] === 'step40') {
725
-                        $task_progress = pourcentage($detail['index'], $items_categories, 100) .'%';
725
+                        $task_progress = pourcentage($detail['index'], $items_categories, 100).'%';
726 726
                     } elseif ($detail['step'] === 'step50') {
727
-                        $task_progress = pourcentage($detail['index'], $items_suggestions, 100) .'%';
727
+                        $task_progress = pourcentage($detail['index'], $items_suggestions, 100).'%';
728 728
                     } elseif ($detail['step'] === 'step60') {
729
-                        $task_progress = pourcentage($detail['index'], $items_files, 100) .'%';
729
+                        $task_progress = pourcentage($detail['index'], $items_files, 100).'%';
730 730
                     }
731 731
                 }
732 732
 
733 733
                 array_push(
734 734
                     $ret,
735 735
                     [
736
-                        'created_at' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $task['created_at']),
737
-                        'updated_at' => is_null($task['updated_at']) === false ? date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $task['updated_at']) : '',
738
-                        'finished_at' => is_null($task['finished_at']) === false ? date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $task['finished_at']) : '',
736
+                        'created_at' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $task['created_at']),
737
+                        'updated_at' => is_null($task['updated_at']) === false ? date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $task['updated_at']) : '',
738
+                        'finished_at' => is_null($task['finished_at']) === false ? date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $task['finished_at']) : '',
739 739
                         'progress' => $task['finished_at'] !== null ? '100%' : $task_progress,
740 740
                         'is_in_progress' => (int) $task['is_in_progress'],
741 741
                         'step' => 'step'.$i,
@@ -784,19 +784,19 @@  discard block
 block discarded – undo
784 784
             // Get info about task
785 785
             $taskInfo = DB::queryfirstrow(
786 786
                 'SELECT p.process_type as process_type
787
-                FROM ' . prefixTable('processes') . ' as p
787
+                FROM ' . prefixTable('processes').' as p
788 788
                 WHERE p.increment_id = %i',
789 789
                 $post_id
790 790
             );
791 791
             if ($taskInfo !== null) {
792 792
                 // delete task
793 793
                 DB::query(
794
-                    'DELETE FROM ' . prefixTable('processes_tasks') . '
794
+                    'DELETE FROM '.prefixTable('processes_tasks').'
795 795
                     WHERE process_id = %i',
796 796
                     $post_id
797 797
                 );
798 798
                 DB::query(
799
-                    'DELETE FROM ' . prefixTable('processes') . '
799
+                    'DELETE FROM '.prefixTable('processes').'
800 800
                     WHERE increment_id = %i',
801 801
                     $post_id
802 802
                 );
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
                         ->setDayOfMonth('*')
864 864
                         ->setMonths('*')
865 865
                         ->setDayOfWeek('*')
866
-                        ->setTaskCommandLine($phpBinaryPath . ' ' . $SETTINGS['cpassman_dir'] . '/sources/scheduler.php')
866
+                        ->setTaskCommandLine($phpBinaryPath.' '.$SETTINGS['cpassman_dir'].'/sources/scheduler.php')
867 867
                         ->setComments('Teampass scheduler');
868 868
                     
869 869
                     $crontabRepository->addJob($crontabJob);
Please login to merge, or discard this patch.