Test Setup Failed
Branch — wip_sessions (2e0cc8)
by Nils
10:32
created
install--ASUPPRIMER/upgrade_run_3.0.0_suggestions.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
         $database,
80 80
         $port
81 81
     );
82
-	$db_link->set_charset(DB_ENCODING);
82
+    $db_link->set_charset(DB_ENCODING);
83 83
 } else {
84 84
     $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error());
85 85
     echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]';
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         mysqli_query(
155 155
             $db_link,
156 156
             "UPDATE ".$pre."suggestion
157
-            SET pw = '". $cryptedStuff['encrypted'] ."', encryption_type = 'teampass_aes'
157
+            SET pw = '". $cryptedStuff['encrypted']."', encryption_type = 'teampass_aes'
158 158
             WHERE id = ".$data['id']
159 159
         );
160 160
 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         mysqli_query(
163 163
             $db_link,
164 164
             "INSERT INTO `".$pre."sharekeys_suggestions` (`increment_id`, `object_id`, `user_id`, `share_key`) 
165
-            VALUES (NULL, '". $data['id'] ."', '". $userId ."', '". encryptUserObjectKey($cryptedStuff['objectKey'], $userPublicKey) ."');"
165
+            VALUES (NULL, '". $data['id']."', '".$userId."', '".encryptUserObjectKey($cryptedStuff['objectKey'], $userPublicKey)."');"
166 166
         );
167 167
     }
168 168
 }
Please login to merge, or discard this patch.
install--ASUPPRIMER/install.queries.php 1 patch
Spacing   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     $settings_sample = 'includes/config/settings.sample.php';
33 33
     $settings = 'includes/config/settings.php';
34 34
     if (copy('../'.$settings_sample, '../'.$settings) === false) {
35
-        echo '[{"error" : "File <i>' . $settings . '</i> could not be copied from <i>'.$settings_sample.'</i>.<br>Please do it on your own or change folder rights, and click START button!", "index" : "99", "multiple" : "' . $post_multiple . '"}]';
35
+        echo '[{"error" : "File <i>'.$settings.'</i> could not be copied from <i>'.$settings_sample.'</i>.<br>Please do it on your own or change folder rights, and click START button!", "index" : "99", "multiple" : "'.$post_multiple.'"}]';
36 36
         exit();
37 37
     }
38 38
 }
@@ -160,47 +160,47 @@  discard block
 block discarded – undo
160 160
             $session_url_path = $data['url_path'];
161 161
 
162 162
             if (isset($data['activity']) && $data['activity'] === 'folder') {
163
-                $targetPath = $abspath . '/' . $data['task'] . '/';
163
+                $targetPath = $abspath.'/'.$data['task'].'/';
164 164
                 if (is_writable($targetPath) === true) {
165
-                    echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
165
+                    echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
166 166
                 } else {
167
-                    echo '[{"error" : " Path ' . $targetPath . ' is not writable!", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
167
+                    echo '[{"error" : " Path '.$targetPath.' is not writable!", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
168 168
                 }
169 169
                 break;
170 170
             }
171 171
 
172 172
             if (isset($data['activity']) && $data['activity'] === 'extension') {
173 173
                 if (extension_loaded($data['task'])) {
174
-                    echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
174
+                    echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
175 175
                 } else {
176
-                    echo '[{"error" : " Extension ' . $data['task'] . ' is not loaded!", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
176
+                    echo '[{"error" : " Extension '.$data['task'].' is not loaded!", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
177 177
                 }
178 178
                 break;
179 179
             }
180 180
 
181 181
             if (isset($data['activity']) && $data['activity'] === 'function') {
182 182
                 if (function_exists($data['task'])) {
183
-                    echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
183
+                    echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
184 184
                 } else {
185
-                    echo '[{"error" : " Function ' . $data['task'] . ' is not available!", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
185
+                    echo '[{"error" : " Function '.$data['task'].' is not available!", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
186 186
                 }
187 187
                 break;
188 188
             }
189 189
 
190 190
             if (isset($data['activity']) && $data['activity'] === 'version') {
191 191
                 if (version_compare(phpversion(), MIN_PHP_VERSION, '>=')) {
192
-                    echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
192
+                    echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
193 193
                 } else {
194
-                    echo '[{"error" : "PHP version ' . phpversion() . ' is not OK (minimum is '.MIN_PHP_VERSION.')", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
194
+                    echo '[{"error" : "PHP version '.phpversion().' is not OK (minimum is '.MIN_PHP_VERSION.')", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
195 195
                 }
196 196
                 break;
197 197
             }
198 198
 
199 199
             if (isset($data['activity']) && $data['activity'] === 'ini') {
200 200
                 if (ini_get($data['task']) >= 30) {
201
-                    echo '[{"error" : "", "index" : "' . $post_index . '"}]';
201
+                    echo '[{"error" : "", "index" : "'.$post_index.'"}]';
202 202
                 } else {
203
-                    echo '[{"error" : "PHP \"Maximum execution time\" is set to ' . ini_get('max_execution_time') . ' seconds. Please try to set to 30s at least during installation.", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
203
+                    echo '[{"error" : "PHP \"Maximum execution time\" is set to '.ini_get('max_execution_time').' seconds. Please try to set to 30s at least during installation.", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
204 204
                 }
205 205
                 break;
206 206
             }
@@ -243,29 +243,29 @@  discard block
 block discarded – undo
243 243
                 // store values
244 244
                 foreach ($data as $key => $value) {
245 245
                     $superGlobal->put($key, $value, 'SESSION');
246
-                    $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `_install` WHERE `key` = '" . $key . "'"));
246
+                    $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `_install` WHERE `key` = '".$key."'"));
247 247
                     if (intval($tmp) === 0) {
248
-                        mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('" . $key . "', '" . $value . "');");
248
+                        mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('".$key."', '".$value."');");
249 249
                     } else {
250
-                        mysqli_query($dbTmp, "UPDATE `_install` SET `value` = '" . $value . "' WHERE `key` = '" . $key . "';");
250
+                        mysqli_query($dbTmp, "UPDATE `_install` SET `value` = '".$value."' WHERE `key` = '".$key."';");
251 251
                     }
252 252
                 }
253 253
                 $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `_install` WHERE `key` = 'url_path'"));
254 254
                 if (intval($tmp) === 0) {
255
-                    mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('url_path', '" . empty($post_urlpath) ? $db['url_path'] : $post_urlpath . "');");
255
+                    mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('url_path', '".empty($post_urlpath) ? $db['url_path'] : $post_urlpath."');");
256 256
                 }/* else {
257 257
                     mysqli_query($dbTmp, "UPDATE `_install` SET `value` = '". empty($session_url_path) ? $data['url_path'] : $session_url_path. "' WHERE `key` = 'url_path';");
258 258
                 }*/
259 259
                 $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `_install` WHERE `key` = 'absolute_path'"));
260 260
                 if (intval($tmp) === 0) {
261
-                    mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('absolute_path', '" . empty($post_abspath) ? $data['absolute_path'] : $post_abspath . "');");
261
+                    mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('absolute_path', '".empty($post_abspath) ? $data['absolute_path'] : $post_abspath."');");
262 262
                 }/* else {
263 263
                     mysqli_query($dbTmp, "UPDATE `_install` SET `value` = '" . empty($session_abspath) ? $data['absolute_path'] : $session_abspath . "' WHERE `key` = 'absolute_path';");
264 264
                 }*/
265 265
 
266 266
                 echo '[{"error" : "", "result" : "Connection is successful", "multiple" : ""}]';
267 267
             } else {
268
-                echo '[{"error" : "' . addslashes(str_replace(array("'", "\n", "\r"), array('"', '', ''), mysqli_connect_error())) . '", "result" : "Failed", "multiple" : ""}]';
268
+                echo '[{"error" : "'.addslashes(str_replace(array("'", "\n", "\r"), array('"', '', ''), mysqli_connect_error())).'", "result" : "Failed", "multiple" : ""}]';
269 269
             }
270 270
             mysqli_close($dbTmp);
271 271
             break;
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 
288 288
             // check skpath
289 289
             if (empty($data['sk_path'])) {
290
-                $data['sk_path'] = $session_abspath . '/includes';
290
+                $data['sk_path'] = $session_abspath.'/includes';
291 291
             } else {
292 292
                 $data['sk_path'] = str_replace('&#92;', '/', $data['sk_path']);
293 293
             }
@@ -299,11 +299,11 @@  discard block
 block discarded – undo
299 299
                     // store all variables in SESSION
300 300
                     foreach ($data as $key => $value) {
301 301
                         $superGlobal->put($key, $value, 'SESSION');
302
-                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `_install` WHERE `key` = '" . $key . "'"));
302
+                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `_install` WHERE `key` = '".$key."'"));
303 303
                         if (intval($tmp) === 0) {
304
-                            mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('" . $key . "', '" . $value . "');");
304
+                            mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('".$key."', '".$value."');");
305 305
                         } else {
306
-                            mysqli_query($dbTmp, "UPDATE `_install` SET `value` = '" . $value . "' WHERE `key` = '" . $key . "';");
306
+                            mysqli_query($dbTmp, "UPDATE `_install` SET `value` = '".$value."' WHERE `key` = '".$key."';");
307 307
                         }
308 308
                     }
309 309
                     echo '[{"error" : "", "result" : "Information stored", "multiple" : ""}]';
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                     echo '[{"error" : "The Directory must be writable!", "result" : "Information stored", "multiple" : ""}]';
312 312
                 }
313 313
             } else {
314
-                echo '[{"error" : "' . $data['sk_path'] . ' is not a Directory!", "result" : "Information stored", "multiple" : ""}]';
314
+                echo '[{"error" : "'.$data['sk_path'].' is not a Directory!", "result" : "Information stored", "multiple" : ""}]';
315 315
             }
316 316
             mysqli_close($dbTmp);
317 317
             break;
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
                 if ($activity === 'table') {
340 340
                     if ($task === 'utf8') {
341 341
                         //FORCE UTF8 DATABASE
342
-                        mysqli_query($dbTmp, 'ALTER DATABASE `' . $dbBdd . '` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci');
342
+                        mysqli_query($dbTmp, 'ALTER DATABASE `'.$dbBdd.'` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci');
343 343
                     } elseif ($task === 'defuse_passwords') {
344 344
                         $mysqli_result = mysqli_query(
345 345
                             $dbTmp,
346
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'defuse_passwords` (
346
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'defuse_passwords` (
347 347
 								`increment_id` int(12) NOT NULL AUTO_INCREMENT,
348 348
 								`type` varchar(100) NOT NULL,
349 349
 								`object_id` int(12) NOT NULL,
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                     } elseif ($task === 'notification') {
355 355
                         $mysqli_result = mysqli_query(
356 356
                             $dbTmp,
357
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'notification` (
357
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'notification` (
358 358
 								`increment_id` INT(12) NOT NULL AUTO_INCREMENT,
359 359
 								`item_id` INT(12) NOT NULL,
360 360
 								`user_id` INT(12) NOT NULL,
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
                     } elseif ($task === 'sharekeys_items') {
365 365
                         $mysqli_result = mysqli_query(
366 366
                             $dbTmp,
367
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'sharekeys_items` (
367
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'sharekeys_items` (
368 368
 								`increment_id` int(12) NOT NULL AUTO_INCREMENT,
369 369
 								`object_id` int(12) NOT NULL,
370 370
 								`user_id` int(12) NOT NULL,
@@ -374,14 +374,14 @@  discard block
 block discarded – undo
374 374
                         );
375 375
                         $mysqli_result = mysqli_query(
376 376
                             $dbTmp,
377
-                            'ALTER TABLE `' . $var['tbl_prefix'] . 'sharekeys_items`
377
+                            'ALTER TABLE `'.$var['tbl_prefix'].'sharekeys_items`
378 378
                                 ADD KEY `object_id_idx` (`object_id`),
379 379
                                 ADD KEY `user_id_idx` (`user_id`);'
380 380
                         );
381 381
                     } elseif ($task === 'sharekeys_logs') {
382 382
                         $mysqli_result = mysqli_query(
383 383
                             $dbTmp,
384
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'sharekeys_logs` (
384
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'sharekeys_logs` (
385 385
 								`increment_id` int(12) NOT NULL AUTO_INCREMENT,
386 386
 								`object_id` int(12) NOT NULL,
387 387
 								`user_id` int(12) NOT NULL,
@@ -391,14 +391,14 @@  discard block
 block discarded – undo
391 391
                         );
392 392
                         $mysqli_result = mysqli_query(
393 393
                             $dbTmp,
394
-                            'ALTER TABLE `' . $var['tbl_prefix'] . 'sharekeys_logs`
394
+                            'ALTER TABLE `'.$var['tbl_prefix'].'sharekeys_logs`
395 395
                                 ADD KEY `object_id_idx` (`object_id`),
396 396
                                 ADD KEY `user_id_idx` (`user_id`);'
397 397
                         );
398 398
                     } elseif ($task === 'sharekeys_fields') {
399 399
                         $mysqli_result = mysqli_query(
400 400
                             $dbTmp,
401
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'sharekeys_fields` (
401
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'sharekeys_fields` (
402 402
 								`increment_id` int(12) NOT NULL AUTO_INCREMENT,
403 403
 								`object_id` int(12) NOT NULL,
404 404
 								`user_id` int(12) NOT NULL,
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
                     } elseif ($task === 'sharekeys_suggestions') {
410 410
                         $mysqli_result = mysqli_query(
411 411
                             $dbTmp,
412
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'sharekeys_suggestions` (
412
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'sharekeys_suggestions` (
413 413
 								`increment_id` int(12) NOT NULL AUTO_INCREMENT,
414 414
 								`object_id` int(12) NOT NULL,
415 415
 								`user_id` int(12) NOT NULL,
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
                     } elseif ($task === 'sharekeys_files') {
421 421
                         $mysqli_result = mysqli_query(
422 422
                             $dbTmp,
423
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'sharekeys_files` (
423
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'sharekeys_files` (
424 424
 								`increment_id` int(12) NOT NULL AUTO_INCREMENT,
425 425
 								`object_id` int(12) NOT NULL,
426 426
 								`user_id` int(12) NOT NULL,
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
                     } elseif ($task === 'items') {
432 432
                         $mysqli_result = mysqli_query(
433 433
                             $dbTmp,
434
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "items` (
434
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."items` (
435 435
                             `id` int(12) NOT null AUTO_INCREMENT,
436 436
                             `label` varchar(500) NOT NULL,
437 437
                             `description` text DEFAULT NULL,
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
                     } elseif ($task === 'log_items') {
465 465
                         $mysqli_result = mysqli_query(
466 466
                             $dbTmp,
467
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "log_items` (
467
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."log_items` (
468 468
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
469 469
                             `id_item` int(8) NOT NULL,
470 470
                             `date` varchar(50) NOT NULL,
@@ -479,12 +479,12 @@  discard block
 block discarded – undo
479 479
                         // create index
480 480
                         mysqli_query(
481 481
                             $dbTmp,
482
-                            'CREATE INDEX teampass_log_items_id_item_IDX ON ' . $var['tbl_prefix'] . 'log_items (id_item,date);'
482
+                            'CREATE INDEX teampass_log_items_id_item_IDX ON '.$var['tbl_prefix'].'log_items (id_item,date);'
483 483
                         );
484 484
                     } elseif ($task === 'misc') {
485 485
                         $mysqli_result = mysqli_query(
486 486
                             $dbTmp,
487
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'misc` (
487
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'misc` (
488 488
                             `increment_id` int(12) NOT null AUTO_INCREMENT,
489 489
                             `type` varchar(50) NOT NULL,
490 490
                             `intitule` varchar(100) NOT NULL,
@@ -499,8 +499,8 @@  discard block
 block discarded – undo
499 499
                         // prepare config file
500 500
                         $tp_config_file = '../includes/config/tp.config.php';
501 501
                         if (file_exists($tp_config_file)) {
502
-                            if (!copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) {
503
-                                echo '[{"error" : "includes/config/tp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
502
+                            if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) {
503
+                                echo '[{"error" : "includes/config/tp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
504 504
                                 break;
505 505
                             } else {
506 506
                                 unlink($tp_config_file);
@@ -528,10 +528,10 @@  discard block
 block discarded – undo
528 528
                             array('admin', 'manager_edit', '1'),
529 529
                             array('admin', 'cpassman_dir', $var['absolute_path']),
530 530
                             array('admin', 'cpassman_url', $var['url_path']),
531
-                            array('admin', 'favicon', $var['url_path'] . '/favicon.ico'),
532
-                            array('admin', 'path_to_upload_folder', $var['absolute_path'] . '/upload'),
533
-                            array('admin', 'path_to_files_folder', $var['absolute_path'] . '/files'),
534
-                            array('admin', 'url_to_files_folder', $var['url_path'] . '/files'),
531
+                            array('admin', 'favicon', $var['url_path'].'/favicon.ico'),
532
+                            array('admin', 'path_to_upload_folder', $var['absolute_path'].'/upload'),
533
+                            array('admin', 'path_to_files_folder', $var['absolute_path'].'/files'),
534
+                            array('admin', 'url_to_files_folder', $var['url_path'].'/files'),
535 535
                             array('admin', 'activate_expiration', '0'),
536 536
                             array('admin', 'pw_life_duration', '0'),
537 537
                             array('admin', 'maintenance_mode', '1'),
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
                             array('admin', 'duo', '0'),
613 613
                             array('admin', 'enable_server_password_change', '0'),
614 614
                             array('admin', 'ldap_object_class', '0'),
615
-                            array('admin', 'bck_script_path', $var['absolute_path'] . '/backups'),
615
+                            array('admin', 'bck_script_path', $var['absolute_path'].'/backups'),
616 616
                             array('admin', 'bck_script_filename', 'bck_teampass'),
617 617
                             array('admin', 'syslog_enable', '0'),
618 618
                             array('admin', 'syslog_host', 'localhost'),
@@ -692,30 +692,30 @@  discard block
 block discarded – undo
692 692
                             $tmp = mysqli_num_rows(
693 693
                                 mysqli_query(
694 694
                                     $dbTmp,
695
-                                    "SELECT * FROM `" . $var['tbl_prefix'] . "misc`
696
-                                    WHERE type='" . $elem[0] . "' AND intitule='" . $elem[1] . "'"
695
+                                    "SELECT * FROM `".$var['tbl_prefix']."misc`
696
+                                    WHERE type='" . $elem[0]."' AND intitule='".$elem[1]."'"
697 697
                                 )
698 698
                             );
699 699
                             if (intval($tmp) === 0) {
700 700
                                 $queryRes = mysqli_query(
701 701
                                     $dbTmp,
702
-                                    "INSERT INTO `" . $var['tbl_prefix'] . "misc`
702
+                                    "INSERT INTO `".$var['tbl_prefix']."misc`
703 703
                                     (`type`, `intitule`, `valeur`) VALUES
704
-                                    ('" . $elem[0] . "', '" . $elem[1] . "', '" .
705
-                                        str_replace("'", '', $elem[2]) . "');"
704
+                                    ('" . $elem[0]."', '".$elem[1]."', '".
705
+                                        str_replace("'", '', $elem[2])."');"
706 706
                                 ); // or die(mysqli_error($dbTmp))
707 707
                             }
708 708
 
709 709
                             // append new setting in config file
710 710
                             $config_text .= "
711
-    '" . $elem[1] . "' => '" . str_replace("'", '', $elem[2]) . "',";
711
+    '" . $elem[1]."' => '".str_replace("'", '', $elem[2])."',";
712 712
                         }
713 713
 
714 714
                         // write to config file
715 715
                         $result = fwrite(
716 716
                             $file_handler,
717 717
                             utf8_encode(
718
-                                $config_text . '
718
+                                $config_text.'
719 719
 );'
720 720
                             )
721 721
                         );
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
                     } elseif ($task === 'nested_tree') {
726 726
                         $mysqli_result = mysqli_query(
727 727
                             $dbTmp,
728
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "nested_tree` (
728
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."nested_tree` (
729 729
                             `id` bigint(20) unsigned NOT null AUTO_INCREMENT,
730 730
                             `parent_id` int(11) NOT NULL,
731 731
                             `title` varchar(255) NOT NULL,
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
                     } elseif ($task === 'rights') {
754 754
                         $mysqli_result = mysqli_query(
755 755
                             $dbTmp,
756
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "rights` (
756
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."rights` (
757 757
                             `id` int(12) NOT null AUTO_INCREMENT,
758 758
                             `tree_id` int(12) NOT NULL,
759 759
                             `fonction_id` int(12) NOT NULL,
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
                     } elseif ($task === 'users') {
765 765
                         $mysqli_result = mysqli_query(
766 766
                             $dbTmp,
767
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "users` (
767
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."users` (
768 768
                             `id` int(12) NOT null AUTO_INCREMENT,
769 769
                             `login` varchar(500) NOT NULL,
770 770
                             `pw` varchar(400) NOT NULL,
@@ -828,37 +828,37 @@  discard block
 block discarded – undo
828 828
 
829 829
                         require_once '../includes/config/include.php';
830 830
                         // check that admin accounts doesn't exist
831
-                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `" . $var['tbl_prefix'] . "users` WHERE login = 'admin'"));
831
+                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `".$var['tbl_prefix']."users` WHERE login = 'admin'"));
832 832
                         if ($tmp === 0) {
833 833
                             $mysqli_result = mysqli_query(
834 834
                                 $dbTmp,
835
-                                "INSERT INTO `" . $var['tbl_prefix'] . "users` (`id`, `login`, `pw`, `admin`, `gestionnaire`, `personal_folder`, `groupes_visibles`, `email`, `encrypted_psk`, `last_pw_change`, `name`, `lastname`, `can_create_root_folder`, `public_key`, `private_key`, `is_ready_for_usage`, `otp_provided`) VALUES ('1', 'admin', '" . bCrypt($var['admin_pwd'], '13') . "', '1', '0', '0', '0', '" . $var['admin_email'] . "', '', '" . time() . "', 'Change me', 'Change me', '1', 'none', 'none', '1', '1')"
835
+                                "INSERT INTO `".$var['tbl_prefix']."users` (`id`, `login`, `pw`, `admin`, `gestionnaire`, `personal_folder`, `groupes_visibles`, `email`, `encrypted_psk`, `last_pw_change`, `name`, `lastname`, `can_create_root_folder`, `public_key`, `private_key`, `is_ready_for_usage`, `otp_provided`) VALUES ('1', 'admin', '".bCrypt($var['admin_pwd'], '13')."', '1', '0', '0', '0', '".$var['admin_email']."', '', '".time()."', 'Change me', 'Change me', '1', 'none', 'none', '1', '1')"
836 836
                             );
837 837
                         } else {
838
-                            $mysqli_result = mysqli_query($dbTmp, 'UPDATE `' . $var['tbl_prefix'] . "users` SET `pw` = '" . bCrypt($var['admin_pwd'], '13') . "' WHERE login = 'admin' AND id = '1'");
838
+                            $mysqli_result = mysqli_query($dbTmp, 'UPDATE `'.$var['tbl_prefix']."users` SET `pw` = '".bCrypt($var['admin_pwd'], '13')."' WHERE login = 'admin' AND id = '1'");
839 839
                         }
840 840
 
841 841
                         // check that API doesn't exist
842
-                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `" . $var['tbl_prefix'] . "users` WHERE id = '" . API_USER_ID . "'"));
842
+                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `".$var['tbl_prefix']."users` WHERE id = '".API_USER_ID."'"));
843 843
                         if ($tmp === 0) {
844 844
                             $mysqli_result = mysqli_query(
845 845
                                 $dbTmp,
846
-                                "INSERT INTO `" . $var['tbl_prefix'] . "users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`, `is_ready_for_usage`, `otp_provided`) VALUES ('" . API_USER_ID . "', 'API', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0', '0', '1')"
846
+                                "INSERT INTO `".$var['tbl_prefix']."users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`, `is_ready_for_usage`, `otp_provided`) VALUES ('".API_USER_ID."', 'API', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0', '0', '1')"
847 847
                             );
848 848
                         }
849 849
 
850 850
                         // check that OTV doesn't exist
851
-                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `" . $var['tbl_prefix'] . "users` WHERE id = '" . OTV_USER_ID . "'"));
851
+                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `".$var['tbl_prefix']."users` WHERE id = '".OTV_USER_ID."'"));
852 852
                         if ($tmp === 0) {
853 853
                             $mysqli_result = mysqli_query(
854 854
                                 $dbTmp,
855
-                                "INSERT INTO `" . $var['tbl_prefix'] . "users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`, `is_ready_for_usage`, `otp_provided`) VALUES ('" . OTV_USER_ID . "', 'OTV', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0', '0', '1')"
855
+                                "INSERT INTO `".$var['tbl_prefix']."users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`, `is_ready_for_usage`, `otp_provided`) VALUES ('".OTV_USER_ID."', 'OTV', '', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0', '0', '1')"
856 856
                             );
857 857
                         }
858 858
                     } elseif ($task === 'tags') {
859 859
                         $mysqli_result = mysqli_query(
860 860
                             $dbTmp,
861
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'tags` (
861
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'tags` (
862 862
                             `id` int(12) NOT null AUTO_INCREMENT,
863 863
                             `tag` varchar(30) NOT NULL,
864 864
                             `item_id` int(12) NOT NULL,
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
                     } elseif ($task === 'log_system') {
869 869
                         $mysqli_result = mysqli_query(
870 870
                             $dbTmp,
871
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'log_system` (
871
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'log_system` (
872 872
                             `id` int(12) NOT null AUTO_INCREMENT,
873 873
                             `type` varchar(20) NOT NULL,
874 874
                             `date` varchar(30) NOT NULL,
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
                     } elseif ($task === 'files') {
882 882
                         $mysqli_result = mysqli_query(
883 883
                             $dbTmp,
884
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "files` (
884
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."files` (
885 885
                             `id` int(11) NOT null AUTO_INCREMENT,
886 886
                             `id_item` int(11) NOT NULL,
887 887
                             `name` TEXT NOT NULL,
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
                     } elseif ($task === 'cache') {
899 899
                         $mysqli_result = mysqli_query(
900 900
                             $dbTmp,
901
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "cache` (
901
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."cache` (
902 902
                             `increment_id`INT(12) NOT NULL AUTO_INCREMENT,
903 903
                             `id` int(12) NOT NULL,
904 904
                             `label` varchar(500) NOT NULL,
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
                     } elseif ($task === 'roles_title') {
921 921
                         $mysqli_result = mysqli_query(
922 922
                             $dbTmp,
923
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "roles_title` (
923
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."roles_title` (
924 924
                             `id` int(12) NOT null AUTO_INCREMENT,
925 925
                             `title` varchar(50) NOT NULL,
926 926
                             `allow_pw_change` TINYINT(1) NOT null DEFAULT '0',
@@ -931,17 +931,17 @@  discard block
 block discarded – undo
931 931
                         );
932 932
 
933 933
                         // create Default role
934
-                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `" . $var['tbl_prefix'] . "roles_title` WHERE id = '0'"));
934
+                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `".$var['tbl_prefix']."roles_title` WHERE id = '0'"));
935 935
                         if ($tmp === 0) {
936 936
                             $mysqli_result = mysqli_query(
937 937
                                 $dbTmp,
938
-                                "INSERT INTO `" . $var['tbl_prefix'] . "roles_title` (`id`, `title`, `allow_pw_change`, `complexity`, `creator_id`) VALUES (NULL, 'Default', '0', '48', '0')"
938
+                                "INSERT INTO `".$var['tbl_prefix']."roles_title` (`id`, `title`, `allow_pw_change`, `complexity`, `creator_id`) VALUES (NULL, 'Default', '0', '48', '0')"
939 939
                             );
940 940
                         }
941 941
                     } elseif ($task === 'roles_values') {
942 942
                         $mysqli_result = mysqli_query(
943 943
                             $dbTmp,
944
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "roles_values` (
944
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."roles_values` (
945 945
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT PRIMARY KEY,
946 946
                             `role_id` int(12) NOT NULL,
947 947
                             `folder_id` int(12) NOT NULL,
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
                     } elseif ($task === 'kb') {
953 953
                         $mysqli_result = mysqli_query(
954 954
                             $dbTmp,
955
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "kb` (
955
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."kb` (
956 956
                             `id` int(12) NOT null AUTO_INCREMENT,
957 957
                             `category_id` int(12) NOT NULL,
958 958
                             `label` varchar(200) NOT NULL,
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
                     } elseif ($task === 'kb_categories') {
966 966
                         $mysqli_result = mysqli_query(
967 967
                             $dbTmp,
968
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'kb_categories` (
968
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'kb_categories` (
969 969
                             `id` int(12) NOT null AUTO_INCREMENT,
970 970
                             `category` varchar(50) NOT NULL,
971 971
                             PRIMARY KEY (`id`)
@@ -974,7 +974,7 @@  discard block
 block discarded – undo
974 974
                     } elseif ($task === 'kb_items') {
975 975
                         $mysqli_result = mysqli_query(
976 976
                             $dbTmp,
977
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'kb_items` (
977
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'kb_items` (
978 978
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
979 979
                             `kb_id` int(12) NOT NULL,
980 980
                             `item_id` int(12) NOT NULL,
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
                     } elseif ($task == 'restriction_to_roles') {
985 985
                         $mysqli_result = mysqli_query(
986 986
                             $dbTmp,
987
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'restriction_to_roles` (
987
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'restriction_to_roles` (
988 988
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
989 989
                             `role_id` int(12) NOT NULL,
990 990
                             `item_id` int(12) NOT NULL,
@@ -994,7 +994,7 @@  discard block
 block discarded – undo
994 994
                     } elseif ($task === 'languages') {
995 995
                         $mysqli_result = mysqli_query(
996 996
                             $dbTmp,
997
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'languages` (
997
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'languages` (
998 998
                             `id` INT(10) NOT null AUTO_INCREMENT,
999 999
                             `name` VARCHAR(50) NOT null ,
1000 1000
                             `label` VARCHAR(50) NOT null ,
@@ -1006,11 +1006,11 @@  discard block
 block discarded – undo
1006 1006
                         );
1007 1007
 
1008 1008
                         // add lanaguages
1009
-                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `" . $var['tbl_prefix'] . "languages` WHERE name = 'french'"));
1009
+                        $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `".$var['tbl_prefix']."languages` WHERE name = 'french'"));
1010 1010
                         if ($tmp === 0) {
1011 1011
                             $mysql_result = mysqli_query(
1012 1012
                                 $dbTmp,
1013
-                                "INSERT INTO `" . $var['tbl_prefix'] . "languages` (`id`, `name`, `label`, `code`, `flag`, `code_poeditor`) VALUES
1013
+                                "INSERT INTO `".$var['tbl_prefix']."languages` (`id`, `name`, `label`, `code`, `flag`, `code_poeditor`) VALUES
1014 1014
                                 (1, 'french', 'French', 'fr', 'fr.png', 'fr'),
1015 1015
                                 (2, 'english', 'English', 'us', 'us.png', 'en'),
1016 1016
                                 (3, 'spanish', 'Spanish', 'es', 'es.png', 'es'),
@@ -1040,7 +1040,7 @@  discard block
 block discarded – undo
1040 1040
                     } elseif ($task === 'emails') {
1041 1041
                         $mysqli_result = mysqli_query(
1042 1042
                             $dbTmp,
1043
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'emails` (
1043
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'emails` (
1044 1044
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
1045 1045
                             `timestamp` INT(30) NOT null ,
1046 1046
                             `subject` TEXT NOT null ,
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
                     } elseif ($task === 'automatic_del') {
1054 1054
                         $mysqli_result = mysqli_query(
1055 1055
                             $dbTmp,
1056
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'automatic_del` (
1056
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'automatic_del` (
1057 1057
                             `item_id` int(11) NOT NULL,
1058 1058
                             `del_enabled` tinyint(1) NOT NULL,
1059 1059
                             `del_type` tinyint(1) NOT NULL,
@@ -1064,7 +1064,7 @@  discard block
 block discarded – undo
1064 1064
                     } elseif ($task === 'items_edition') {
1065 1065
                         $mysqli_result = mysqli_query(
1066 1066
                             $dbTmp,
1067
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'items_edition` (
1067
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'items_edition` (
1068 1068
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
1069 1069
                             `item_id` int(11) NOT NULL,
1070 1070
                             `user_id` int(12) NOT NULL,
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
                     } elseif ($task === 'categories') {
1077 1077
                         $mysqli_result = mysqli_query(
1078 1078
                             $dbTmp,
1079
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "categories` (
1079
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."categories` (
1080 1080
                             `id` int(12) NOT NULL AUTO_INCREMENT,
1081 1081
                             `parent_id` int(12) NOT NULL,
1082 1082
                             `title` varchar(255) NOT NULL,
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
                     } elseif ($task === 'categories_items') {
1096 1096
                         $mysqli_result = mysqli_query(
1097 1097
                             $dbTmp,
1098
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "categories_items` (
1098
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."categories_items` (
1099 1099
                             `id` int(12) NOT NULL AUTO_INCREMENT,
1100 1100
                             `field_id` int(11) NOT NULL,
1101 1101
                             `item_id` int(11) NOT NULL,
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
                     } elseif ($task === 'categories_folders') {
1110 1110
                         $mysqli_result = mysqli_query(
1111 1111
                             $dbTmp,
1112
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'categories_folders` (
1112
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'categories_folders` (
1113 1113
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
1114 1114
                             `id_category` int(12) NOT NULL,
1115 1115
                             `id_folder` int(12) NOT NULL,
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
                     } elseif ($task === 'api') {
1120 1120
                         $mysqli_result = mysqli_query(
1121 1121
                             $dbTmp,
1122
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'api` (
1122
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'api` (
1123 1123
                             `increment_id` int(20) NOT NULL AUTO_INCREMENT,
1124 1124
                             `type` varchar(15) NOT NULL,
1125 1125
                             `label` varchar(255) DEFAULT NULL,
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
                     } elseif ($task === 'otv') {
1134 1134
                         $mysqli_result = mysqli_query(
1135 1135
                             $dbTmp,
1136
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "otv` (
1136
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."otv` (
1137 1137
                             `id` int(10) NOT NULL AUTO_INCREMENT,
1138 1138
                             `timestamp` text NOT NULL,
1139 1139
                             `code` varchar(100) NOT NULL,
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
                     } elseif ($task === 'suggestion') {
1151 1151
                         $mysqli_result = mysqli_query(
1152 1152
                             $dbTmp,
1153
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "suggestion` (
1153
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."suggestion` (
1154 1154
                             `id` tinyint(12) NOT NULL AUTO_INCREMENT,
1155 1155
                             `label` varchar(255) NOT NULL,
1156 1156
                             `pw` text NOT NULL,
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
 
1169 1169
                         $mysqli_result = mysqli_query(
1170 1170
                             $dbTmp,
1171
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "export` (
1171
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."export` (
1172 1172
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
1173 1173
                             `export_tag` varchar(20) NOT NULL,
1174 1174
                             `item_id` int(12) NOT NULL,
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
                     } elseif ($task === 'tokens') {
1191 1191
                         $mysqli_result = mysqli_query(
1192 1192
                             $dbTmp,
1193
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'tokens` (
1193
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'tokens` (
1194 1194
                             `id` int(12) NOT NULL AUTO_INCREMENT,
1195 1195
                             `user_id` int(12) NOT NULL,
1196 1196
                             `token` varchar(255) NOT NULL,
@@ -1203,7 +1203,7 @@  discard block
 block discarded – undo
1203 1203
                     } elseif ($task === 'items_change') {
1204 1204
                         $mysqli_result = mysqli_query(
1205 1205
                             $dbTmp,
1206
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "items_change` (
1206
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."items_change` (
1207 1207
                             `id` int(12) NOT NULL AUTO_INCREMENT,
1208 1208
                             `item_id` int(12) NOT NULL,
1209 1209
                             `label` varchar(255) NOT NULL DEFAULT 'none',
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
                     } elseif ($task === 'templates') {
1223 1223
                         $mysqli_result = mysqli_query(
1224 1224
                             $dbTmp,
1225
-                            'CREATE TABLE IF NOT EXISTS `' . $var['tbl_prefix'] . 'templates` (
1225
+                            'CREATE TABLE IF NOT EXISTS `'.$var['tbl_prefix'].'templates` (
1226 1226
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
1227 1227
                             `item_id` int(12) NOT NULL,
1228 1228
                             `category_id` int(12) NOT NULL,
@@ -1232,7 +1232,7 @@  discard block
 block discarded – undo
1232 1232
                     } elseif ($task === 'cache_tree') {
1233 1233
                         $mysqli_result = mysqli_query(
1234 1234
                             $dbTmp,
1235
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "cache_tree` (
1235
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."cache_tree` (
1236 1236
                             `increment_id` smallint(32) NOT NULL AUTO_INCREMENT,
1237 1237
                             `data` longtext DEFAULT NULL CHECK (json_valid(`data`)),
1238 1238
                             `visible_folders` longtext NOT NULL,
@@ -1245,7 +1245,7 @@  discard block
 block discarded – undo
1245 1245
                     } else if ($task === 'processes_tasks') {
1246 1246
                         $mysqli_result = mysqli_query(
1247 1247
                             $dbTmp,
1248
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "processes_tasks` (
1248
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."processes_tasks` (
1249 1249
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
1250 1250
                             `process_id` int(12) NOT NULL,
1251 1251
                             `created_at` varchar(50) NOT NULL,
@@ -1260,13 +1260,13 @@  discard block
 block discarded – undo
1260 1260
                         );
1261 1261
                         $mysqli_result = mysqli_query(
1262 1262
                             $dbTmp,
1263
-                            'ALTER TABLE `' . $var['tbl_prefix'] . 'processes_tasks`
1263
+                            'ALTER TABLE `'.$var['tbl_prefix'].'processes_tasks`
1264 1264
                                 ADD KEY `process_id_idx` (`process_id`);'
1265 1265
                         );
1266 1266
                     } else if ($task === 'processes') {
1267 1267
                         $mysqli_result = mysqli_query(
1268 1268
                             $dbTmp,
1269
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "processes` (
1269
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."processes` (
1270 1270
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
1271 1271
                             `created_at` varchar(50) NOT NULL,
1272 1272
                             `started_at` varchar(50) DEFAULT NULL,
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
                     } else if ($task === 'processes_logs') {
1285 1285
                         $mysqli_result = mysqli_query(
1286 1286
                             $dbTmp,
1287
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "processes_logs` (
1287
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."processes_logs` (
1288 1288
                             `increment_id` int(12) NOT NULL AUTO_INCREMENT,
1289 1289
                             `created_at` varchar(20) NOT NULL,
1290 1290
                             `job` varchar(50) NOT NULL,
@@ -1298,7 +1298,7 @@  discard block
 block discarded – undo
1298 1298
                     } else if ($task === 'ldap_groups_roles') {
1299 1299
                         $mysqli_result = mysqli_query(
1300 1300
                             $dbTmp,
1301
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "ldap_groups_roles` (
1301
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."ldap_groups_roles` (
1302 1302
                             `increment_id` INT(12) NOT NULL AUTO_INCREMENT,
1303 1303
                             `role_id` INT(12) NOT NULL,
1304 1304
                             `ldap_group_id` VARCHAR(500) NOT NULL,
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
                     } else if ($task === 'items_otp') {
1311 1311
                         $mysqli_result = mysqli_query(
1312 1312
                             $dbTmp,
1313
-                            "CREATE TABLE IF NOT EXISTS `" . $var['tbl_prefix'] . "items_otp` (
1313
+                            "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."items_otp` (
1314 1314
                             `increment_id` int(12) NOT NULL,
1315 1315
                             `item_id` int(12) NOT NULL,
1316 1316
                             `secret` text NOT NULL,
@@ -1328,12 +1328,12 @@  discard block
 block discarded – undo
1328 1328
                 }
1329 1329
                 // answer back
1330 1330
                 if ($mysqli_result) {
1331
-                    echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '", "task" : "' . $task . '", "activity" : "' . $activity . '"}]';
1331
+                    echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'", "task" : "'.$task.'", "activity" : "'.$activity.'"}]';
1332 1332
                 } else {
1333
-                    echo '[{"error" : "' . addslashes(str_replace(array("'", "\n", "\r"), array('"', '', ''), mysqli_error($dbTmp))) . '", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '", "table" : "' . $task . '"}]';
1333
+                    echo '[{"error" : "'.addslashes(str_replace(array("'", "\n", "\r"), array('"', '', ''), mysqli_error($dbTmp))).'", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'", "table" : "'.$task.'"}]';
1334 1334
                 }
1335 1335
             } else {
1336
-                echo '[{"error" : "' . addslashes(str_replace(array("'", "\n", "\r"), array('"', '', ''), mysqli_connect_error())) . '", "result" : "Failed", "multiple" : ""}]';
1336
+                echo '[{"error" : "'.addslashes(str_replace(array("'", "\n", "\r"), array('"', '', ''), mysqli_connect_error())).'", "result" : "Failed", "multiple" : ""}]';
1337 1337
             }
1338 1338
 
1339 1339
             mysqli_close($dbTmp);
@@ -1383,11 +1383,11 @@  discard block
 block discarded – undo
1383 1383
                     // 0- check if exists
1384 1384
                     $filesecure = generateRandomKey();
1385 1385
                     define('SECUREFILE', $filesecure);
1386
-                    $filename_seckey = $securePath . '/' . $filesecure;
1386
+                    $filename_seckey = $securePath.'/'.$filesecure;
1387 1387
 
1388 1388
                     if (file_exists($filename_seckey)) {
1389
-                        if (!copy($filename_seckey, $filename_seckey . '.' . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) {
1390
-                            echo '[{"error" : "File `'.$filename_seckey.'` already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1389
+                        if (!copy($filename_seckey, $filename_seckey.'.'.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) {
1390
+                            echo '[{"error" : "File `'.$filename_seckey.'` already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1391 1391
                             break;
1392 1392
                         } else {
1393 1393
                             unlink($filename);
@@ -1408,8 +1408,8 @@  discard block
 block discarded – undo
1408 1408
                     $filename = '../includes/config/settings.php';
1409 1409
 
1410 1410
                     if (file_exists($filename)) {
1411
-                        if (!copy($filename, $filename . '.' . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) {
1412
-                            echo '[{"error" : "Setting.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1411
+                        if (!copy($filename, $filename.'.'.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) {
1412
+                            echo '[{"error" : "Setting.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1413 1413
                             break;
1414 1414
                         } else {
1415 1415
                             unlink($filename);
@@ -1429,13 +1429,13 @@  discard block
 block discarded – undo
1429 1429
                         utf8_encode(
1430 1430
                             '<?php
1431 1431
 // DATABASE connexion parameters
1432
-define("DB_HOST", "' . $db['db_host'] . '");
1433
-define("DB_USER", "' . $db['db_login'] . '");
1434
-define("DB_PASSWD", "' . str_replace('$', '\$', $encrypted_text) . '");
1435
-define("DB_NAME", "' . $db['db_bdd'] . '");
1436
-define("DB_PREFIX", "' . $var['tbl_prefix'] . '");
1437
-define("DB_PORT", "' . $db['db_port'] . '");
1438
-define("DB_ENCODING", "' . $session_db_encoding . '");
1432
+define("DB_HOST", "' . $db['db_host'].'");
1433
+define("DB_USER", "' . $db['db_login'].'");
1434
+define("DB_PASSWD", "' . str_replace('$', '\$', $encrypted_text).'");
1435
+define("DB_NAME", "' . $db['db_bdd'].'");
1436
+define("DB_PREFIX", "' . $var['tbl_prefix'].'");
1437
+define("DB_PORT", "' . $db['db_port'].'");
1438
+define("DB_ENCODING", "' . $session_db_encoding.'");
1439 1439
 define("DB_SSL", false); // if DB over SSL then comment this line
1440 1440
 // if DB over SSL then uncomment the following lines
1441 1441
 //define("DB_SSL", array(
@@ -1448,8 +1448,8 @@  discard block
 block discarded – undo
1448 1448
 define("DB_CONNECT_OPTIONS", array(
1449 1449
     MYSQLI_OPT_CONNECT_TIMEOUT => 10
1450 1450
 ));
1451
-define("SECUREPATH", "' . $securePath . '");
1452
-define("SECUREFILE", "' . $filesecure. '");
1451
+define("SECUREPATH", "' . $securePath.'");
1452
+define("SECUREFILE", "' . $filesecure.'");
1453 1453
 
1454 1454
 if (isset($_SESSION[\'settings\'][\'timezone\']) === true) {
1455 1455
     date_default_timezone_set($_SESSION[\'settings\'][\'timezone\']);
@@ -1461,7 +1461,7 @@  discard block
 block discarded – undo
1461 1461
 
1462 1462
                     // Create TP USER
1463 1463
                     require_once '../includes/config/include.php';
1464
-                    $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `" . $var['tbl_prefix'] . "users` WHERE id = '" . TP_USER_ID . "'"));
1464
+                    $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `".$var['tbl_prefix']."users` WHERE id = '".TP_USER_ID."'"));
1465 1465
                     if ($tmp === 0) {
1466 1466
                         // generate key for password
1467 1467
                         $pwd = GenerateCryptKey(25, true, true, true, true);
@@ -1476,14 +1476,14 @@  discard block
 block discarded – undo
1476 1476
 
1477 1477
                         $mysqli_result = mysqli_query(
1478 1478
                             $dbTmp,
1479
-                            "INSERT INTO `" . $var['tbl_prefix'] . "users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`, `public_key`, `private_key`, `is_ready_for_usage`, `otp_provided`) VALUES ('" . TP_USER_ID . "', 'TP', '".$encrypted_pwd."', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0', '".$userKeys['public_key']."', '".$userKeys['private_key']."', '1', '1')"
1479
+                            "INSERT INTO `".$var['tbl_prefix']."users` (`id`, `login`, `pw`, `groupes_visibles`, `derniers`, `key_tempo`, `last_pw_change`, `last_pw`, `admin`, `fonction_id`, `groupes_interdits`, `last_connexion`, `gestionnaire`, `email`, `favourites`, `latest_items`, `personal_folder`, `public_key`, `private_key`, `is_ready_for_usage`, `otp_provided`) VALUES ('".TP_USER_ID."', 'TP', '".$encrypted_pwd."', '', '', '', '', '', '1', '', '', '', '0', '', '', '', '0', '".$userKeys['public_key']."', '".$userKeys['private_key']."', '1', '1')"
1480 1480
                         );
1481 1481
                     }
1482 1482
 
1483 1483
                     if ($result === false) {
1484
-                        echo '[{"error" : "Setting.php file could not be created. Please check the path and the rights", "result":"", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1484
+                        echo '[{"error" : "Setting.php file could not be created. Please check the path and the rights", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1485 1485
                     } else {
1486
-                        echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1486
+                        echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1487 1487
                     }
1488 1488
                 } elseif ($task === 'security') {
1489 1489
                     // Sort out the file permissions
@@ -1494,26 +1494,26 @@  discard block
 block discarded – undo
1494 1494
                         if (is_null($session_abspath) === false) {
1495 1495
                             $result = recursiveChmod($session_abspath, 0770, 0740);
1496 1496
                             if ($result) {
1497
-                                $result = recursiveChmod($session_abspath . '/files', 0770, 0770);
1497
+                                $result = recursiveChmod($session_abspath.'/files', 0770, 0770);
1498 1498
                             }
1499 1499
                             if ($result) {
1500
-                                $result = recursiveChmod($session_abspath . '/upload', 0770, 0770);
1500
+                                $result = recursiveChmod($session_abspath.'/upload', 0770, 0770);
1501 1501
                             }
1502 1502
                         }
1503 1503
                     }
1504 1504
                     $result = true;
1505 1505
                     if ($result === false) {
1506
-                        echo '[{"error" : "Cannot change directory permissions - please fix manually", "result":"", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1506
+                        echo '[{"error" : "Cannot change directory permissions - please fix manually", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1507 1507
                     } else {
1508
-                        echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1508
+                        echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1509 1509
                     }
1510 1510
                 } elseif ($task === 'csrfp-token') {
1511 1511
                     // update CSRFP TOKEN
1512 1512
                     $csrfp_file_sample = '../includes/libraries/csrfp/libs/csrfp.config.sample.php';
1513 1513
                     $csrfp_file = '../includes/libraries/csrfp/libs/csrfp.config.php';
1514 1514
                     if (file_exists($csrfp_file)) {
1515
-                        if (!copy($csrfp_file, $csrfp_file . '.' . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) {
1516
-                            echo '[{"error" : "csrfp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1515
+                        if (!copy($csrfp_file, $csrfp_file.'.'.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) {
1516
+                            echo '[{"error" : "csrfp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1517 1517
                             break;
1518 1518
                         } else {
1519 1519
                             $events .= "The file $csrfp_file already exist. A copy has been created.<br />";
@@ -1522,21 +1522,21 @@  discard block
 block discarded – undo
1522 1522
                     unlink($csrfp_file); // delete existing csrfp.config file
1523 1523
                     copy($csrfp_file_sample, $csrfp_file); // make a copy of csrfp.config.sample file
1524 1524
                     $data = file_get_contents($csrfp_file);
1525
-                    $newdata = str_replace('"CSRFP_TOKEN" => ""', '"CSRFP_TOKEN" => "' . bin2hex(openssl_random_pseudo_bytes(25)) . '"', $data);
1526
-                    $jsUrl = $data_sent['url_path'] . '/includes/libraries/csrfp/js/csrfprotector.js';
1527
-                    $newdata = str_replace('"jsUrl" => ""', '"jsUrl" => "' . $jsUrl . '"', $newdata);
1525
+                    $newdata = str_replace('"CSRFP_TOKEN" => ""', '"CSRFP_TOKEN" => "'.bin2hex(openssl_random_pseudo_bytes(25)).'"', $data);
1526
+                    $jsUrl = $data_sent['url_path'].'/includes/libraries/csrfp/js/csrfprotector.js';
1527
+                    $newdata = str_replace('"jsUrl" => ""', '"jsUrl" => "'.$jsUrl.'"', $newdata);
1528 1528
                     file_put_contents('../includes/libraries/csrfp/libs/csrfp.config.php', $newdata);
1529 1529
 
1530
-                    echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1530
+                    echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1531 1531
                 }
1532 1532
             } elseif ($activity === 'install') {
1533 1533
                 if ($task === 'cleanup') {
1534 1534
                     // Mark a tag to force Install stuff (folders, files and table) to be cleanup while first login
1535
-                    mysqli_query($dbTmp, "INSERT INTO `" . $var['tbl_prefix'] . "misc` (`type`, `intitule`, `valeur`) VALUES ('install', 'clear_install_folder', 'true')");
1535
+                    mysqli_query($dbTmp, "INSERT INTO `".$var['tbl_prefix']."misc` (`type`, `intitule`, `valeur`) VALUES ('install', 'clear_install_folder', 'true')");
1536 1536
 
1537
-                    echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1537
+                    echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1538 1538
                 } elseif ($task === 'init') {
1539
-                    echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1539
+                    echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1540 1540
                 } elseif ($task === 'cronJob') {
1541 1541
                     // Create cronjob
1542 1542
                     // get php location
@@ -1556,7 +1556,7 @@  discard block
 block discarded – undo
1556 1556
                                     ->setDayOfMonth('*')
1557 1557
                                     ->setMonths('*')
1558 1558
                                     ->setDayOfWeek('*')
1559
-                                    ->setTaskCommandLine($phpLocation . ' ' . $SETTINGS['cpassman_dir'] . '/sources/scheduler.php')
1559
+                                    ->setTaskCommandLine($phpLocation.' '.$SETTINGS['cpassman_dir'].'/sources/scheduler.php')
1560 1560
                                     ->setComments('Teampass scheduler');
1561 1561
                                 
1562 1562
                                 $crontabRepository->addJob($crontabJob);
@@ -1566,9 +1566,9 @@  discard block
 block discarded – undo
1566 1566
                             // do nothing
1567 1567
                         }
1568 1568
                     } else {
1569
-                        echo '[{"error" : "Cannot find PHP binary location. Please add a cronjob manually (see documentation).", "result":"", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1569
+                        echo '[{"error" : "Cannot find PHP binary location. Please add a cronjob manually (see documentation).", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1570 1570
                     }
1571
-                    echo '[{"error" : "", "index" : "' . $post_index . '", "multiple" : "' . $post_multiple . '"}]';
1571
+                    echo '[{"error" : "", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]';
1572 1572
                 }
1573 1573
             }
1574 1574
 
Please login to merge, or discard this patch.
error.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     // Update table by deleting ID
59 59
     if (null !== $session->get('user-id')) {
60 60
         DB::update(
61
-            DB_PREFIX . 'users',
61
+            DB_PREFIX.'users',
62 62
             [
63 63
                 'key_tempo' => '',
64 64
             ],
Please login to merge, or discard this patch.
sources/export.queries.php 1 patch
Spacing   +64 added lines, -64 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
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 $antiXss = new AntiXSS();
91 91
 
92 92
 // User's language loading
93
-require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $session->get('user-language') . '.php';
93
+require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$session->get('user-language').'.php';
94 94
 
95 95
 // Prepare POST variables
96 96
 $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT);
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
                         'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso,
142 142
                             i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url,
143 143
                             i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period
144
-                        FROM ' . prefixTable('items') . ' as i
145
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
146
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
144
+                        FROM ' . prefixTable('items').' as i
145
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
146
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
147 147
                         WHERE i.inactif = %i
148 148
                         AND i.id_tree= %i
149 149
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
                                 // Run query
167 167
                                 $dataItem = DB::queryfirstrow(
168 168
                                     'SELECT i.pw AS pw, s.share_key AS share_key
169
-                                    FROM ' . prefixTable('items') . ' AS i
170
-                                    INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
169
+                                    FROM ' . prefixTable('items').' AS i
170
+                                    INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
171 171
                                     WHERE user_id = %i AND i.id = %i',
172 172
                                     $session->get('user-id'),
173 173
                                     $record['id']
@@ -191,8 +191,8 @@  discard block
 block discarded – undo
191 191
                                 $arr_kbs = [];
192 192
                                 $rows_kb = DB::query(
193 193
                                     'SELECT b.label, b.id
194
-                                    FROM ' . prefixTable('kb_items') . ' AS a
195
-                                    INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
194
+                                    FROM ' . prefixTable('kb_items').' AS a
195
+                                    INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
196 196
                                     WHERE a.item_id = %i',
197 197
                                     $record['id']
198 198
                                 );
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                                 $arr_tags = [];
205 205
                                 $rows_tag = DB::query(
206 206
                                     'SELECT tag
207
-                                    FROM ' . prefixTable('tags') . '
207
+                                    FROM ' . prefixTable('tags').'
208 208
                                     WHERE item_id = %i',
209 209
                                     $record['id']
210 210
                                 );
@@ -216,18 +216,18 @@  discard block
 block discarded – undo
216 216
                                 $arr_trees = [];
217 217
                                 $rows_child_tree = DB::query(
218 218
                                     'SELECT t.id, t.title
219
-                                    FROM ' . prefixTable('nested_tree') . ' AS t
220
-                                    INNER JOIN ' . prefixTable('items') . ' AS i ON (t.id = i.id_tree)
219
+                                    FROM ' . prefixTable('nested_tree').' AS t
220
+                                    INNER JOIN ' . prefixTable('items').' AS i ON (t.id = i.id_tree)
221 221
                                     WHERE i.id = %i',
222 222
                                     $record['id']
223 223
                                 );
224 224
                                 foreach ($rows_child_tree as $rec_child_tree) {
225 225
                                     $stack = array();
226 226
                                     $parent = $rec_child_tree['id'];
227
-                                    while($parent != 0){
227
+                                    while ($parent != 0) {
228 228
                                         $rows_parent_tree = DB::query(
229 229
                                             'SELECT parent_id, title
230
-                                            FROM ' . prefixTable('nested_tree') . '
230
+                                            FROM ' . prefixTable('nested_tree').'
231 231
                                             WHERE id = %i',
232 232
                                             $parent
233 233
                                         );
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             // Prepare variables
315 315
             $post_export_tag = filter_var($dataReceived['export_tag'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
316 316
             if (empty($post_export_tag) === false) {
317
-                DB::query('DELETE FROM ' . prefixTable('export') . ' WHERE export_tag = %s', $post_export_tag);
317
+                DB::query('DELETE FROM '.prefixTable('export').' WHERE export_tag = %s', $post_export_tag);
318 318
             }
319 319
             break;
320 320
 
@@ -364,9 +364,9 @@  discard block
 block discarded – undo
364 364
                         l.date as date, i.pw_iv as pw_iv,
365 365
                         n.renewal_period as renewal_period,
366 366
                         i.id_tree as tree_id
367
-                        FROM ' . prefixTable('items') . ' as i
368
-                        INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id)
369
-                        INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item)
367
+                        FROM ' . prefixTable('items').' as i
368
+                        INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id)
369
+                        INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item)
370 370
                         WHERE i.inactif = %i
371 371
                         AND i.id_tree= %i
372 372
                         AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s))
@@ -392,8 +392,8 @@  discard block
 block discarded – undo
392 392
                             // Run query
393 393
                             $dataItem = DB::queryfirstrow(
394 394
                                 'SELECT i.pw AS pw, s.share_key AS share_key
395
-                                FROM ' . prefixTable('items') . ' AS i
396
-                                INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id)
395
+                                FROM ' . prefixTable('items').' AS i
396
+                                INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id)
397 397
                                 WHERE user_id = %i AND i.id = %i',
398 398
                                 $session->get('user-id'),
399 399
                                 $record['id']
@@ -417,8 +417,8 @@  discard block
 block discarded – undo
417 417
                             $arr_kbs = '';
418 418
                             $rows_kb = DB::query(
419 419
                                 'SELECT b.label, b.id
420
-                                FROM ' . prefixTable('kb_items') . ' AS a
421
-                                INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id)
420
+                                FROM ' . prefixTable('kb_items').' AS a
421
+                                INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id)
422 422
                                 WHERE a.item_id = %i',
423 423
                                 $record['id']
424 424
                             );
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                                 if (empty($arr_kbs)) {
427 427
                                     $arr_kbs = $rec_kb['label'];
428 428
                                 } else {
429
-                                    $arr_kbs .= ' | ' . $rec_kb['label'];
429
+                                    $arr_kbs .= ' | '.$rec_kb['label'];
430 430
                                 }
431 431
                             }
432 432
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
                             $arr_tags = '';
435 435
                             $rows_tag = DB::query(
436 436
                                 'SELECT tag
437
-                                FROM ' . prefixTable('tags') . '
437
+                                FROM ' . prefixTable('tags').'
438 438
                                 WHERE item_id = %i',
439 439
                                 $record['id']
440 440
                             );
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
                                 if (empty($arr_tags)) {
443 443
                                     $arr_tags = $rec_tag['tag'];
444 444
                                 } else {
445
-                                    $arr_tags .= ' ' . $rec_tag['tag'];
445
+                                    $arr_tags .= ' '.$rec_tag['tag'];
446 446
                                 }
447 447
                             }
448 448
 
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
             // query
521 521
             $rows = DB::query(
522 522
                 'SELECT * 
523
-                FROM ' . prefixTable('export') . ' 
523
+                FROM ' . prefixTable('export').' 
524 524
                 WHERE export_tag = %s',
525 525
                 $dataReceived['export_tag']
526 526
             );
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
                 $prev_path = '';
533 533
 
534 534
                 //Prepare the PDF file
535
-                include $SETTINGS['cpassman_dir'] . '/vendor/tecnickcom/tcpdf/tcpdf.php';
535
+                include $SETTINGS['cpassman_dir'].'/vendor/tecnickcom/tcpdf/tcpdf.php';
536 536
 
537 537
                 $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
538 538
                 $pdf->SetProtection(array('print'), $dataReceived['pdf_password'], null);
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
 
545 545
                 // set default header data
546 546
                 $pdf->SetHeaderData(
547
-                    $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png',
547
+                    $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png',
548 548
                     PDF_HEADER_LOGO_WIDTH,
549 549
                     'Teampass export',
550 550
                     $session->get('user-lastname')." ".$session->get('user-name').' @ '.date($SETTINGS['date_format']." ".$SETTINGS['time_format'], (int) time())
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
                 logEvents($SETTINGS, 'pdf_export', '', (string) $session->get('user-id'), $session->get('user-login'));
655 655
 
656 656
                 //clean table
657
-                DB::query('TRUNCATE TABLE ' . prefixTable('export'));
657
+                DB::query('TRUNCATE TABLE '.prefixTable('export'));
658 658
 
659 659
                 // Clean any content of the output buffer
660 660
                 ob_end_clean();
@@ -692,13 +692,13 @@  discard block
 block discarded – undo
692 692
             // step 1:
693 693
             // - prepare export file
694 694
             // - get full list of objects id to export
695
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
695
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
696 696
             $idsList = array();
697 697
 
698 698
             // query
699 699
             $rows = DB::query(
700 700
                 'SELECT * 
701
-                FROM ' . prefixTable('export') . ' 
701
+                FROM ' . prefixTable('export').' 
702 702
                 WHERE export_tag = %s',
703 703
                 $inputData['export_tag']
704 704
             );
@@ -735,13 +735,13 @@  discard block
 block discarded – undo
735 735
             }
736 736
             // prepare export file
737 737
             //save the file
738
-            $outstream = fopen($SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'], 'w');
738
+            $outstream = fopen($SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'], 'w');
739 739
             if ($outstream === false) {
740 740
                 echo (string) prepareExchangedData(
741 741
                     [
742 742
                         'error' => true,
743 743
                         'message' => $lang->get('error_while_creating_file'),
744
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
744
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
745 745
                     ],
746 746
                     'encode'
747 747
                 );
@@ -767,12 +767,12 @@  discard block
 block discarded – undo
767 767
     </style>
768 768
     </head>
769 769
     <body>
770
-    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']) . '" />
770
+    <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $inputData['password']).'" />
771 771
     <div id="header">
772
-    ' . TP_TOOL_NAME . ' - Off Line mode
772
+    ' . TP_TOOL_NAME.' - Off Line mode
773 773
     </div>
774 774
     <div style="margin:10px; font-size:9px;">
775
-    <i>This page was generated by <b>' . $session->get('user-name') . ' ' . $session->get('user-lastname') . '</b>, the ' . date('Y/m/d H:i:s') . '.</i>
775
+    <i>This page was generated by <b>' . $session->get('user-name').' '.$session->get('user-lastname').'</b>, the '.date('Y/m/d H:i:s').'.</i>
776 776
     <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span>
777 777
     </div>
778 778
     <div id="information"></div>
@@ -783,11 +783,11 @@  discard block
 block discarded – undo
783 783
     <div>
784 784
     <table id="itemsTable">
785 785
         <thead><tr>
786
-            <th style="width:15%;">' . $lang->get('label') . '</th>
787
-            <th style="width:10%;">' . $lang->get('pw') . '</th>
788
-            <th style="width:30%;">' . $lang->get('description') . '</th>
789
-            <th style="width:5%;">' . $lang->get('user_login') . '</th>
790
-            <th style="width:20%;">' . $lang->get('url') . '</th>
786
+            <th style="width:15%;">' . $lang->get('label').'</th>
787
+            <th style="width:10%;">' . $lang->get('pw').'</th>
788
+            <th style="width:30%;">' . $lang->get('description').'</th>
789
+            <th style="width:5%;">' . $lang->get('user_login').'</th>
790
+            <th style="width:20%;">' . $lang->get('url').'</th>
791 791
         </tr></thead>
792 792
         <tbody id="itemsTable_tbody">'
793 793
             );
@@ -801,8 +801,8 @@  discard block
 block discarded – undo
801 801
                     'loop' => true,
802 802
                     'ids_list' => json_encode($idsList),
803 803
                     'ids_count' => count($idsList),
804
-                    'file_path' => $SETTINGS['path_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'],
805
-                    'file_link' => $SETTINGS['url_to_files_folder'] . (substr($SETTINGS['path_to_files_folder'] , -1) === '/' ? '' : '/') . $inputData['filename'],
804
+                    'file_path' => $SETTINGS['path_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'],
805
+                    'file_link' => $SETTINGS['url_to_files_folder'].(substr($SETTINGS['path_to_files_folder'], -1) === '/' ? '' : '/').$inputData['filename'],
806 806
                     'export_tag' => $inputData['export_tag'],
807 807
                 ],
808 808
                 'encode'
@@ -842,12 +842,12 @@  discard block
 block discarded – undo
842 842
 
843 843
             $full_listing = array();
844 844
             $items_id_list = array();
845
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
845
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
846 846
 
847 847
             // query
848 848
             $rows = DB::query(
849 849
                 'SELECT * 
850
-                FROM ' . prefixTable('export') . ' 
850
+                FROM ' . prefixTable('export').' 
851 851
                 WHERE export_tag = %s AND item_id IN %ls',
852 852
                 $inputData['export_tag'],
853 853
                 $inputData['idsList']
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
                         [
862 862
                             'error' => true,
863 863
                             'message' => $lang->get('error_while_creating_file'),
864
-                            'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
864
+                            'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
865 865
                         ],
866 866
                         'encode'
867 867
                     );
@@ -903,13 +903,13 @@  discard block
 block discarded – undo
903 903
                         if (empty($arboHtml)) {
904 904
                             $arboHtml = $arboHtml_tmp;
905 905
                         } else {
906
-                            $arboHtml .= ' » ' . $arboHtml_tmp;
906
+                            $arboHtml .= ' » '.$arboHtml_tmp;
907 907
                         }
908 908
                     }
909 909
                     fputs(
910 910
                         $outstream,
911 911
                         '
912
-        <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>'
912
+        <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>'
913 913
                     );
914 914
                     $idTree = $record['folder_id'];
915 915
 
@@ -917,12 +917,12 @@  discard block
 block discarded – undo
917 917
                     fputs(
918 918
                         $outstream,
919 919
                         '
920
-        <tr class="' . $lineType . '">
921
-            <td>' . addslashes($record['label']) . '</td>
922
-            <td align="center"><span class="span_pw" id="span_' . $record['item_id'] . '"><a href="#" onclick="decryptme(' . $record['item_id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $record['item_id'] . '" value="' . $encPw . '" /></td>
923
-            <td>' . (empty($record['description']) === true ? '&nbsp;' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))) . '</td>
924
-            <td align="center">' . (empty($record['login']) === true ? '&nbsp;' : addslashes($record['login'])) . '</td>
925
-            <td align="center">' . (empty($record['url']) === true ? '&nbsp;' : addslashes($record['url'])) . '</td>
920
+        <tr class="' . $lineType.'">
921
+            <td>' . addslashes($record['label']).'</td>
922
+            <td align="center"><span class="span_pw" id="span_' . $record['item_id'].'"><a href="#" onclick="decryptme('.$record['item_id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$record['item_id'].'" value="'.$encPw.'" /></td>
923
+            <td>' . (empty($record['description']) === true ? '&nbsp;' : addslashes(str_replace(array(';', '<br />'), array('|', "\n\r"), stripslashes(mb_convert_encoding($record['description'], 'ISO-8859-1', 'UTF-8'))))).'</td>
924
+            <td align="center">' . (empty($record['login']) === true ? '&nbsp;' : addslashes($record['login'])).'</td>
925
+            <td align="center">' . (empty($record['url']) === true ? '&nbsp;' : addslashes($record['url'])).'</td>
926 926
         </tr>'
927 927
                     );
928 928
                 }
@@ -971,7 +971,7 @@  discard block
 block discarded – undo
971 971
             $inputData['password'] = (string) filter_var($dataReceived['password'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
972 972
             
973 973
             // Load includes
974
-            include $SETTINGS['cpassman_dir'] . '/includes/config/include.php';
974
+            include $SETTINGS['cpassman_dir'].'/includes/config/include.php';
975 975
 
976 976
             // read the content of the temporary file
977 977
             $handle = fopen($inputData['filename'].'.txt', 'r');
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
                     [
981 981
                         'error' => true,
982 982
                         'message' => $lang->get('error_while_creating_file'),
983
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
983
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
984 984
                     ],
985 985
                     'encode'
986 986
                 );
@@ -992,7 +992,7 @@  discard block
 block discarded – undo
992 992
                     [
993 993
                         'error' => true,
994 994
                         'message' => $lang->get('error_while_creating_file'),
995
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
995
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
996 996
                     ],
997 997
                     'encode'
998 998
                 );
@@ -1008,9 +1008,9 @@  discard block
 block discarded – undo
1008 1008
             $chunks = explode('|#|#|', chunk_split($contents, 10000, '|#|#|'));
1009 1009
             foreach ($chunks as $chunk) {
1010 1010
                 if (empty($encrypted_text) === true) {
1011
-                    $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] );
1011
+                    $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']);
1012 1012
                 } else {
1013
-                    $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password'] );
1013
+                    $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $inputData['password']);
1014 1014
                 }
1015 1015
             }
1016 1016
 
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
                     [
1022 1022
                         'error' => true,
1023 1023
                         'message' => $lang->get('error_while_creating_file'),
1024
-                        'detail' => $SETTINGS['path_to_files_folder'] . $inputData['filename'],
1024
+                        'detail' => $SETTINGS['path_to_files_folder'].$inputData['filename'],
1025 1025
                     ],
1026 1026
                     'encode'
1027 1027
                 );
@@ -1034,9 +1034,9 @@  discard block
 block discarded – undo
1034 1034
         </table></div>
1035 1035
         <input type="button" value="Hide all" onclick="hideAll()" />
1036 1036
         <div id="footer" style="text-align:center;">
1037
-            <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME . '&nbsp;' . TP_VERSION . '&nbsp;' . TP_COPYRIGHT . '</a>
1037
+            <a href="https://teampass.net/about/" target="_blank">' . TP_TOOL_NAME.'&nbsp;'.TP_VERSION.'&nbsp;'.TP_COPYRIGHT.'</a>
1038 1038
         </div>
1039
-        <div id="enc_html" style="display:none;">' . $encrypted_text . '</div>
1039
+        <div id="enc_html" style="display:none;">' . $encrypted_text.'</div>
1040 1040
         </body>
1041 1041
     </html>
1042 1042
     <script type="text/javascript">
@@ -1139,12 +1139,12 @@  discard block
 block discarded – undo
1139 1139
             fclose($outstream);
1140 1140
 
1141 1141
             //clean table
1142
-            DB::query('TRUNCATE TABLE ' . prefixTable('export'));
1142
+            DB::query('TRUNCATE TABLE '.prefixTable('export'));
1143 1143
 
1144 1144
             echo (string) prepareExchangedData(
1145 1145
                 [
1146 1146
                     'error' => false,
1147
-                    'filelink' => $inputData['file_link'] ,
1147
+                    'filelink' => $inputData['file_link'],
1148 1148
                 ],
1149 1149
                 'encode'
1150 1150
             );
Please login to merge, or discard this patch.
sources/utils.queries.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 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
 
Please login to merge, or discard this patch.
sources/favourites.queries.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 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
 
Please login to merge, or discard this patch.
sources/items.logs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 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
 
Please login to merge, or discard this patch.
sources/user.logs.datatables.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 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
 
Please login to merge, or discard this patch.
install--ASUPPRIMER/upgrade_run_3.0.0_logs.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
         $database,
79 79
         $port
80 80
     );
81
-	$db_link->set_charset(DB_ENCODING);
81
+    $db_link->set_charset(DB_ENCODING);
82 82
 } else {
83 83
     $res = 'Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error());
84 84
     echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]';
Please login to merge, or discard this patch.