@@ -44,23 +44,23 @@ discard block |
||
44 | 44 | throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
45 | 45 | } |
46 | 46 | |
47 | -if (! isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') { |
|
47 | +if (!isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') { |
|
48 | 48 | $SETTINGS = []; |
49 | 49 | $SETTINGS['cpassman_dir'] = '..'; |
50 | 50 | } |
51 | 51 | |
52 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
53 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
54 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
52 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
53 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
54 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
55 | 55 | |
56 | 56 | // If Debug then clean the files |
57 | 57 | if (DEBUGLDAP === true) { |
58 | - define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'] . '/ldap.debug.txt'); |
|
58 | + define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'].'/ldap.debug.txt'); |
|
59 | 59 | $fp = fopen(DEBUGLDAPFILE, 'w'); |
60 | 60 | fclose($fp); |
61 | 61 | } |
62 | 62 | if (DEBUGDUO === true) { |
63 | - define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'] . '/duo.debug.txt'); |
|
63 | + define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'].'/duo.debug.txt'); |
|
64 | 64 | $fp = fopen(DEBUGDUOFILE, 'w'); |
65 | 65 | fclose($fp); |
66 | 66 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | if (defined('DB_PASSWD_CLEAR') === false) { |
77 | 77 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
78 | 78 | } |
79 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
79 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
80 | 80 | if (defined('DB_PASSWD_CLEAR') === false) { |
81 | 81 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
82 | 82 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | // This step creates the DUO request encrypted key |
94 | 94 | |
95 | 95 | // load library |
96 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
96 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
97 | 97 | $sig_request = Duo::signRequest( |
98 | 98 | $SETTINGS['IKEY'], |
99 | 99 | $SETTINGS['SKEY'], |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | debugIdentify( |
105 | 105 | DEBUGDUO, |
106 | 106 | DEBUGDUOFILE, |
107 | - "\n\n-----\n\n" . |
|
108 | - 'sig request : ' . $post_login . "\n" . |
|
109 | - 'resp : ' . $sig_request . "\n" |
|
107 | + "\n\n-----\n\n". |
|
108 | + 'sig request : '.$post_login."\n". |
|
109 | + 'resp : '.$sig_request."\n" |
|
110 | 110 | ); |
111 | 111 | } |
112 | 112 | |
113 | 113 | // load csrfprotector |
114 | - $csrfp_config = include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/csrfp/libs/csrfp.config.php'; |
|
114 | + $csrfp_config = include_once $SETTINGS['cpassman_dir'].'/includes/libraries/csrfp/libs/csrfp.config.php'; |
|
115 | 115 | // return result |
116 | - echo '[{"sig_request" : "' . $sig_request . '" , "csrfp_token" : "' . $csrfp_config['CSRFP_TOKEN'] . '" , "csrfp_key" : "' . filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING) . '"}]'; |
|
116 | + echo '[{"sig_request" : "'.$sig_request.'" , "csrfp_token" : "'.$csrfp_config['CSRFP_TOKEN'].'" , "csrfp_key" : "'.filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING).'"}]'; |
|
117 | 117 | // --- |
118 | 118 | // --- |
119 | 119 | } elseif ($post_type === 'identify_duo_user_check') { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | //-------- |
124 | 124 | |
125 | 125 | // load library |
126 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
126 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
127 | 127 | $authenticated_username = Duo::verifyResponse( |
128 | 128 | $SETTINGS['duo_ikey'], |
129 | 129 | $SETTINGS['duo_skey'], |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | // is user in Teampass? |
139 | 139 | DB::queryfirstrow( |
140 | 140 | 'SELECT id |
141 | - FROM ' . prefixTable('users') . ' |
|
141 | + FROM ' . prefixTable('users').' |
|
142 | 142 | WHERE login = %s', |
143 | 143 | $post_login |
144 | 144 | ); |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
151 | - echo '[{"authenticated_username" : "' . $authenticated_username . '"}]'; |
|
151 | + echo '[{"authenticated_username" : "'.$authenticated_username.'"}]'; |
|
152 | 152 | } else { |
153 | - echo '[{"authenticated_username" : "' . $authenticated_username . '"}]'; |
|
153 | + echo '[{"authenticated_username" : "'.$authenticated_username.'"}]'; |
|
154 | 154 | } |
155 | 155 | // --- |
156 | 156 | // --- |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | } |
177 | 177 | |
178 | 178 | // Load superGlobals |
179 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
179 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
180 | 180 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
181 | 181 | // Prepare GET variables |
182 | 182 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
@@ -264,19 +264,19 @@ discard block |
||
264 | 264 | } else { |
265 | 265 | throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
266 | 266 | } |
267 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
268 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
269 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
267 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
268 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
269 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
270 | 270 | |
271 | 271 | header('Content-type: text/html; charset=utf-8'); |
272 | 272 | error_reporting(E_ERROR); |
273 | 273 | |
274 | 274 | // Load AntiXSS |
275 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
275 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
276 | 276 | $antiXss = new voku\helper\AntiXSS(); |
277 | 277 | |
278 | 278 | // Load superGlobals |
279 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
279 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
280 | 280 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
281 | 281 | |
282 | 282 | // Prepare GET variables |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | $server['PHP_AUTH_PW'] = $superGlobal->get('PHP_AUTH_PW', 'SERVER'); |
291 | 291 | |
292 | 292 | // connect to the server |
293 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
293 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
294 | 294 | DB::$host = DB_HOST; |
295 | 295 | DB::$user = DB_USER; |
296 | 296 | DB::$password = defined('DB_PASSWD_CLEAR') === false ? defuseReturnDecrypted(DB_PASSWD, $SETTINGS) : DB_PASSWD_CLEAR; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | DB::$port = DB_PORT; |
299 | 299 | DB::$encoding = DB_ENCODING; |
300 | 300 | // User's language loading |
301 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $sessionUserLanguage . '.php'; |
|
301 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$sessionUserLanguage.'.php'; |
|
302 | 302 | |
303 | 303 | // decrypt and retreive data in JSON format |
304 | 304 | if (empty($sessionKey) === true) { |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | //$arrAttempts = array(); |
451 | 451 | $rows = DB::query( |
452 | 452 | 'SELECT date |
453 | - FROM ' . prefixTable('log_system') . " |
|
453 | + FROM ' . prefixTable('log_system')." |
|
454 | 454 | WHERE field_1 = %s |
455 | 455 | AND type = 'failed_auth' |
456 | 456 | AND label = 'password_is_not_correct' |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | foreach ($rows as $record) { |
467 | 467 | array_push( |
468 | 468 | $arrAttempts, |
469 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) |
|
469 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']) |
|
470 | 470 | ); |
471 | 471 | } |
472 | 472 | } |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | foreach ($superGlobal->get('user_roles', 'SESSION') as $role) { |
605 | 605 | $resRoles = DB::queryFirstRow( |
606 | 606 | 'SELECT title, complexity |
607 | - FROM ' . prefixTable('roles_title') . ' |
|
607 | + FROM ' . prefixTable('roles_title').' |
|
608 | 608 | WHERE id=%i', |
609 | 609 | $role |
610 | 610 | ); |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | |
626 | 626 | // build complete array of roles |
627 | 627 | $superGlobal->put('arr_roles_full', [], 'SESSION'); |
628 | - $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC'); |
|
628 | + $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC'); |
|
629 | 629 | foreach ($rows as $record) { |
630 | 630 | $superGlobal->put( |
631 | 631 | $record['id'], |
@@ -722,10 +722,10 @@ discard block |
||
722 | 722 | $superGlobal->put('latest_items_tab', [], 'SESSION'); |
723 | 723 | $superGlobal->put('nb_roles', 0, 'SESSION'); |
724 | 724 | foreach ($superGlobal->get('latest_items', 'SESSION') as $item) { |
725 | - if (! empty($item)) { |
|
725 | + if (!empty($item)) { |
|
726 | 726 | $dataLastItems = DB::queryFirstRow( |
727 | 727 | 'SELECT id,label,id_tree |
728 | - FROM ' . prefixTable('items') . ' |
|
728 | + FROM ' . prefixTable('items').' |
|
729 | 729 | WHERE id=%i', |
730 | 730 | $item |
731 | 731 | ); |
@@ -734,7 +734,7 @@ discard block |
||
734 | 734 | [ |
735 | 735 | 'id' => $item, |
736 | 736 | 'label' => $dataLastItems['label'], |
737 | - 'url' => 'index.php?page=items&group=' . $dataLastItems['id_tree'] . '&id=' . $item, |
|
737 | + 'url' => 'index.php?page=items&group='.$dataLastItems['id_tree'].'&id='.$item, |
|
738 | 738 | ], |
739 | 739 | 'SESSION', |
740 | 740 | 'latest_items_tab' |
@@ -751,12 +751,12 @@ discard block |
||
751 | 751 | ) { |
752 | 752 | // get all Admin users |
753 | 753 | $receivers = ''; |
754 | - $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1); |
|
754 | + $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1); |
|
755 | 755 | foreach ($rows as $record) { |
756 | 756 | if (empty($receivers)) { |
757 | 757 | $receivers = $record['email']; |
758 | 758 | } else { |
759 | - $receivers = ',' . $record['email']; |
|
759 | + $receivers = ','.$record['email']; |
|
760 | 760 | } |
761 | 761 | } |
762 | 762 | // Add email to table |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | '#tp_time#', |
773 | 773 | ], |
774 | 774 | [ |
775 | - ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')', |
|
775 | + ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')', |
|
776 | 776 | date($SETTINGS['date_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
777 | 777 | date($SETTINGS['time_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
778 | 778 | ], |
@@ -990,45 +990,45 @@ discard block |
||
990 | 990 | } |
991 | 991 | |
992 | 992 | // Load expected libraries |
993 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
994 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
995 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
996 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
997 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
998 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
999 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
1000 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
1001 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
1002 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
1003 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php'; |
|
1004 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php'; |
|
1005 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
1006 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php'; |
|
1007 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
1008 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php'; |
|
1009 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
1010 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php'; |
|
1011 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php'; |
|
1012 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php'; |
|
1013 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php'; |
|
1014 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php'; |
|
1015 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
1016 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php'; |
|
1017 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php'; |
|
1018 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php'; |
|
1019 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php'; |
|
1020 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php'; |
|
1021 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php'; |
|
1022 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
1023 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php'; |
|
1024 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php'; |
|
1025 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php'; |
|
1026 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
1027 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php'; |
|
1028 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php'; |
|
1029 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php'; |
|
1030 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/HandlesConnection.php'; |
|
1031 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php'; |
|
993 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
994 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
995 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
996 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
997 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
998 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
999 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
1000 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
1001 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
1002 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
1003 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php'; |
|
1004 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php'; |
|
1005 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
1006 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php'; |
|
1007 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
1008 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php'; |
|
1009 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
1010 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php'; |
|
1011 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php'; |
|
1012 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php'; |
|
1013 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php'; |
|
1014 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php'; |
|
1015 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
1016 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php'; |
|
1017 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php'; |
|
1018 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php'; |
|
1019 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php'; |
|
1020 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php'; |
|
1021 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php'; |
|
1022 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
1023 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php'; |
|
1024 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php'; |
|
1025 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php'; |
|
1026 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
1027 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php'; |
|
1028 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php'; |
|
1029 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php'; |
|
1030 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/HandlesConnection.php'; |
|
1031 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php'; |
|
1032 | 1032 | $ad = new SplClassLoader('LdapRecord', '../includes/libraries'); |
1033 | 1033 | $ad->register(); |
1034 | 1034 | $connection = new Connection($config); |
@@ -1040,7 +1040,7 @@ discard block |
||
1040 | 1040 | $error = $e->getDetailedError(); |
1041 | 1041 | return [ |
1042 | 1042 | 'error' => true, |
1043 | - 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage().' '.$config['username'], |
|
1043 | + 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage().' '.$config['username'], |
|
1044 | 1044 | |
1045 | 1045 | ]; |
1046 | 1046 | } |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | } |
1069 | 1069 | |
1070 | 1070 | // load passwordLib library |
1071 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
1071 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
1072 | 1072 | $pwdlib->register(); |
1073 | 1073 | $pwdlib = new PasswordLib\PasswordLib(); |
1074 | 1074 | $hashedPassword = $pwdlib->createPasswordHash($passwordClear); |
@@ -1127,7 +1127,7 @@ discard block |
||
1127 | 1127 | function yubicoMFACheck($dataReceived, string $userInfo, array $SETTINGS): array |
1128 | 1128 | { |
1129 | 1129 | // Load superGlobals |
1130 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1130 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1131 | 1131 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
1132 | 1132 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
1133 | 1133 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | } |
1167 | 1167 | |
1168 | 1168 | // Now check yubico validity |
1169 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
1169 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
1170 | 1170 | $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key); |
1171 | 1171 | $auth = $yubi->verify($yubico_key); |
1172 | 1172 | //, null, null, null, 60 |
@@ -1218,7 +1218,7 @@ discard block |
||
1218 | 1218 | 'gestionnaire' => '0', |
1219 | 1219 | 'can_manage_all_users' => '0', |
1220 | 1220 | 'personal_folder' => $SETTINGS['enable_pf_feature'] === '1' ? '1' : '0', |
1221 | - 'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'] . ';' : '') . (isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'), |
|
1221 | + 'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'].';' : '').(isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'), |
|
1222 | 1222 | 'groupes_interdits' => '', |
1223 | 1223 | 'groupes_visibles' => '', |
1224 | 1224 | 'last_pw_change' => (int) time(), |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | ] |
1244 | 1244 | ); |
1245 | 1245 | // Rebuild tree |
1246 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
1246 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
1247 | 1247 | $tree->register(); |
1248 | 1248 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
1249 | 1249 | $tree->rebuild(); |
@@ -1274,13 +1274,13 @@ discard block |
||
1274 | 1274 | && empty($dataReceived['GACode']) === false |
1275 | 1275 | ) { |
1276 | 1276 | // Load superGlobals |
1277 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1277 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1278 | 1278 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
1279 | 1279 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
1280 | 1280 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
1281 | 1281 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
1282 | 1282 | // load library |
1283 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
1283 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
1284 | 1284 | // create new instance |
1285 | 1285 | $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']); |
1286 | 1286 | // Init |
@@ -1302,7 +1302,7 @@ discard block |
||
1302 | 1302 | $mfaMessage = langHdl('ga_flash_qr_and_login'); |
1303 | 1303 | // generate new QR |
1304 | 1304 | $new_2fa_qr = $tfa->getQRCodeImageAsDataUri( |
1305 | - 'Teampass - ' . $username, |
|
1305 | + 'Teampass - '.$username, |
|
1306 | 1306 | $userInfo['ga'] |
1307 | 1307 | ); |
1308 | 1308 | // clear temporary code from DB |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | $userInfo['id'] |
1316 | 1316 | ); |
1317 | 1317 | $firstTime = [ |
1318 | - 'value' => '<img src="' . $new_2fa_qr . '">', |
|
1318 | + 'value' => '<img src="'.$new_2fa_qr.'">', |
|
1319 | 1319 | 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '', |
1320 | 1320 | 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '', |
1321 | 1321 | 'pwd_attempts' => (int) $sessionPwdAttempts, |
@@ -1366,8 +1366,8 @@ discard block |
||
1366 | 1366 | // Set to false |
1367 | 1367 | $userPasswordVerified = false; |
1368 | 1368 | // load passwordLib library |
1369 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
1370 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
1369 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
1370 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
1371 | 1371 | $pwdlib->register(); |
1372 | 1372 | $pwdlib = new PasswordLib\PasswordLib(); |
1373 | 1373 | // Check if old encryption used |
@@ -1498,7 +1498,7 @@ discard block |
||
1498 | 1498 | // Brute force management |
1499 | 1499 | if ($sessionPwdAttempts > 3) { |
1500 | 1500 | // Load superGlobals |
1501 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1501 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1502 | 1502 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
1503 | 1503 | $superGlobal->put('next_possible_pwd_attempts', time() + 10, 'SESSION'); |
1504 | 1504 | $superGlobal->put('pwd_attempts', 0, 'SESSION'); |
@@ -1540,7 +1540,7 @@ discard block |
||
1540 | 1540 | // Check if user exists |
1541 | 1541 | $userInfo = DB::queryFirstRow( |
1542 | 1542 | 'SELECT * |
1543 | - FROM ' . prefixTable('users') . ' WHERE login=%s', |
|
1543 | + FROM ' . prefixTable('users').' WHERE login=%s', |
|
1544 | 1544 | $username |
1545 | 1545 | ); |
1546 | 1546 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | require $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoUniversal/Client.php'; |
54 | 54 | |
55 | 55 | // Load superGlobals |
56 | -include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
56 | +include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
57 | 57 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
58 | 58 | |
59 | 59 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $SETTINGS['cpassman_url'].'/duo-callback' |
67 | 67 | ); |
68 | 68 | } catch (DuoException $e) { |
69 | - throw new ErrorException("*** Duo config error. Verify the values in duo.conf are correct ***\n" . $e->getMessage()); |
|
69 | + throw new ErrorException("*** Duo config error. Verify the values in duo.conf are correct ***\n".$e->getMessage()); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $state = $duo_client->generateState(); |
@@ -43,11 +43,11 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | /* do checks */ |
46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'folders', $SETTINGS) === false) { |
48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
49 | 49 | //not allowed page |
50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
51 | 51 | exit; |
52 | 52 | } |
53 | 53 | ?> |
@@ -275,8 +275,8 @@ discard block |
||
275 | 275 | if (store.get('teampassApplication').formUserAction === "add_new_user") { |
276 | 276 | var data = { |
277 | 277 | 'receipt': $('#form-email').val(), |
278 | - 'subject': 'TEAMPASS - <?php echo langHdl('temporary_encryption_code');?>', |
|
279 | - 'body': '<?php echo langHdl('email_body_new_user');?>', |
|
278 | + 'subject': 'TEAMPASS - <?php echo langHdl('temporary_encryption_code'); ?>', |
|
279 | + 'body': '<?php echo langHdl('email_body_new_user'); ?>', |
|
280 | 280 | 'pre_replace' : { |
281 | 281 | '#code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code, |
282 | 282 | '#login#' : store.get('teampassUser').admin_new_user_login, |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | } else { |
287 | 287 | var data = { |
288 | 288 | 'receipt': $('#form-email').val(), |
289 | - 'subject': 'TEAMPASS - <?php echo langHdl('temporary_encryption_code');?>', |
|
290 | - 'body': '<?php echo langHdl('email_body_temporary_encryption_code');?>', |
|
289 | + 'subject': 'TEAMPASS - <?php echo langHdl('temporary_encryption_code'); ?>', |
|
290 | + 'body': '<?php echo langHdl('email_body_temporary_encryption_code'); ?>', |
|
291 | 291 | 'pre_replace' : { |
292 | 292 | '#enc_code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code, |
293 | 293 | } |
@@ -464,13 +464,13 @@ discard block |
||
464 | 464 | } |
465 | 465 | // Inform user |
466 | 466 | $("#warningModalBody").html('<b><?php echo langHdl('encryption_keys'); ?> - ' + |
467 | - stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' + |
|
467 | + stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' + |
|
468 | 468 | '... <?php echo langHdl('please_wait'); ?><i class="fas fa-spinner fa-pulse ml-3 text-primary"></i>'); |
469 | 469 | |
470 | 470 | var data = { |
471 | 471 | action: step, |
472 | 472 | start: start, |
473 | - length: <?php echo NUMBER_ITEMS_IN_BATCH;?>, |
|
473 | + length: <?php echo NUMBER_ITEMS_IN_BATCH; ?>, |
|
474 | 474 | user_id: userId, |
475 | 475 | } |
476 | 476 | console.info("Envoi des données :") |
@@ -1236,7 +1236,7 @@ discard block |
||
1236 | 1236 | } else { |
1237 | 1237 | // Show icon or not |
1238 | 1238 | if ($('#user-disabled').prop('checked') === true) { |
1239 | - $('#user-login-'+userID).before('<i class="fas fa-user-slash infotip text-danger mr-2" title="<?php echo langHdl('account_is_locked');?>" id="user-disable-'+userID+'"></i>'); |
|
1239 | + $('#user-login-'+userID).before('<i class="fas fa-user-slash infotip text-danger mr-2" title="<?php echo langHdl('account_is_locked'); ?>" id="user-disable-'+userID+'"></i>'); |
|
1240 | 1240 | } else { |
1241 | 1241 | $('#user-disable-'+userID).remove(); |
1242 | 1242 | } |
@@ -2081,12 +2081,12 @@ discard block |
||
2081 | 2081 | if (step !== 'finished') { |
2082 | 2082 | // Inform user |
2083 | 2083 | $("#warningModal-progress").html('<b><?php echo langHdl('encryption_keys'); ?> - ' + |
2084 | - stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + ']'); |
|
2084 | + stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + ']'); |
|
2085 | 2085 | |
2086 | 2086 | var data = { |
2087 | 2087 | 'action': step, |
2088 | 2088 | 'start': start, |
2089 | - 'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>, |
|
2089 | + 'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>, |
|
2090 | 2090 | 'user_id': userId, |
2091 | 2091 | 'self_change': false, |
2092 | 2092 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | require_once 'SecureHandler.php'; |
29 | 29 | session_name('teampass_session'); |
30 | 30 | session_start(); |
31 | -if (! isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || ! isset($_SESSION['key']) || empty($_SESSION['key'])) { |
|
31 | +if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || !isset($_SESSION['key']) || empty($_SESSION['key'])) { |
|
32 | 32 | die('Hacking attempt...'); |
33 | 33 | } |
34 | 34 | |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | // Do checks |
45 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
45 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) { |
48 | 48 | // Not allowed page |
49 | 49 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
51 | 51 | exit; |
52 | 52 | } |
53 | 53 | |
54 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
55 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
54 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
55 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
56 | 56 | header('Content-type: text/html; charset=utf-8'); |
57 | 57 | header('Cache-Control: no-cache, must-revalidate'); |
58 | 58 | require_once 'main.functions.php'; |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | if (isset($_SESSION['groupes_visibles']) === false |
61 | 61 | || empty($_SESSION['groupes_visibles']) === true |
62 | 62 | ) { |
63 | - echo '{"sEcho": ' . intval($_GET['sEcho']) . ' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }'; |
|
63 | + echo '{"sEcho": '.intval($_GET['sEcho']).' ,"iTotalRecords": "0", "iTotalDisplayRecords": "0", "aaData": [] }'; |
|
64 | 64 | exit; |
65 | 65 | } |
66 | 66 | |
67 | 67 | //Connect to DB |
68 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
68 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
69 | 69 | if (defined('DB_PASSWD_CLEAR') === false) { |
70 | 70 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
71 | 71 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $folders = $_SESSION['groupes_visibles']; |
90 | 90 | } else { |
91 | 91 | // Build tree |
92 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
92 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
93 | 93 | $tree->register(); |
94 | 94 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
95 | 95 | $folders = $tree->getDescendants(filter_var($_GET['limited'], FILTER_SANITIZE_NUMBER_INT), true); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | //Get current user "personal folder" ID |
100 | 100 | $row = DB::query( |
101 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %i', |
|
101 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %i', |
|
102 | 102 | intval($_SESSION['user_id']) |
103 | 103 | ); |
104 | 104 | //get list of personal folders |
@@ -107,20 +107,20 @@ discard block |
||
107 | 107 | $listPf = ''; |
108 | 108 | if (empty($row['id']) === false) { |
109 | 109 | $rows = DB::query( |
110 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' |
|
110 | + 'SELECT id FROM '.prefixTable('nested_tree').' |
|
111 | 111 | WHERE personal_folder = 1 AND NOT parent_id = %i AND NOT title = %i', |
112 | 112 | filter_var($row['id'], FILTER_SANITIZE_NUMBER_INT), |
113 | 113 | filter_var($_SESSION['user_id'], FILTER_SANITIZE_NUMBER_INT) |
114 | 114 | ); |
115 | 115 | foreach ($rows as $record) { |
116 | - if (! in_array($record['id'], $arrayPf)) { |
|
116 | + if (!in_array($record['id'], $arrayPf)) { |
|
117 | 117 | //build an array of personal folders ids |
118 | 118 | array_push($arrayPf, $record['id']); |
119 | 119 | //build also a string with those ids |
120 | 120 | if (empty($listPf)) { |
121 | 121 | $listPf = $record['id']; |
122 | 122 | } else { |
123 | - $listPf .= ', ' . $record['id']; |
|
123 | + $listPf .= ', '.$record['id']; |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | //Paging |
131 | 131 | $sLimit = ''; |
132 | 132 | if (isset($_GET['start']) === true && $_GET['length'] !== '-1') { |
133 | - $sLimit = 'LIMIT ' . filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT) . ', ' . filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT) . ''; |
|
133 | + $sLimit = 'LIMIT '.filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT).', '.filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT).''; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | //Ordering |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | } |
144 | 144 | $sOrder = 'ORDER BY '; |
145 | 145 | if ($_GET['order'][0]['column'] >= 0) { |
146 | - $sOrder .= '' . $aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)] . ' ' |
|
147 | - . filter_var($_GET['order'][0]['dir'], FILTER_SANITIZE_STRING) . ', '; |
|
146 | + $sOrder .= ''.$aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)].' ' |
|
147 | + . filter_var($_GET['order'][0]['dir'], FILTER_SANITIZE_STRING).', '; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | $sOrder = substr_replace($sOrder, '', -2); |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $sOrder = ''; |
153 | 153 | } |
154 | 154 | } else { |
155 | - $sOrder = 'ORDER BY ' . $aColumns[1] . ' ASC'; |
|
155 | + $sOrder = 'ORDER BY '.$aColumns[1].' ASC'; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | // Define criteria |
@@ -174,9 +174,9 @@ discard block |
||
174 | 174 | if (empty($search_criteria) === false) { |
175 | 175 | $sWhere .= ' AND ('; |
176 | 176 | for ($i = 0; $i < count($aColumns); ++$i) { |
177 | - $sWhere .= $aColumns[$i] . ' LIKE %ss_' . $i . ' OR '; |
|
177 | + $sWhere .= $aColumns[$i].' LIKE %ss_'.$i.' OR '; |
|
178 | 178 | } |
179 | - $sWhere = substr_replace((string) $sWhere, '', -3) . ') '; |
|
179 | + $sWhere = substr_replace((string) $sWhere, '', -3).') '; |
|
180 | 180 | $crit = [ |
181 | 181 | 'idtree' => array_unique($folders), |
182 | 182 | '0' => $search_criteria, |
@@ -214,13 +214,13 @@ discard block |
||
214 | 214 | if (empty($sWhere) === false) { |
215 | 215 | $sWhere .= ' AND '; |
216 | 216 | } |
217 | - $sWhere = 'WHERE ' . $sWhere . 'id_tree NOT IN %ls_pf '; |
|
217 | + $sWhere = 'WHERE '.$sWhere.'id_tree NOT IN %ls_pf '; |
|
218 | 218 | } else { |
219 | - $sWhere = 'WHERE ' . $sWhere; |
|
219 | + $sWhere = 'WHERE '.$sWhere; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | DB::query( |
223 | - 'SELECT id FROM ' . prefixTable('cache') . " |
|
223 | + 'SELECT id FROM '.prefixTable('cache')." |
|
224 | 224 | ${sWhere} |
225 | 225 | ${sOrder}", |
226 | 226 | $crit |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $iTotal = DB::count(); |
229 | 229 | $rows = DB::query( |
230 | 230 | 'SELECT id, label, description, tags, id_tree, perso, restricted_to, login, folder, author, renewal_period, url, timestamp |
231 | - FROM ' . prefixTable('cache') . " |
|
231 | + FROM ' . prefixTable('cache')." |
|
232 | 232 | ${sWhere} |
233 | 233 | ${sOrder} |
234 | 234 | ${sLimit}", |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | if (isset($_GET['type']) === false) { |
242 | 242 | $sOutput = '{'; |
243 | 243 | if (isset($_GET['draw']) === true) { |
244 | - $sOutput .= '"draw": ' . intval($_GET['draw']) . ', '; |
|
244 | + $sOutput .= '"draw": '.intval($_GET['draw']).', '; |
|
245 | 245 | } |
246 | 246 | $sOutput .= '"data": ['; |
247 | 247 | $sOutputConst = ''; |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | foreach (explode(';', $_SESSION['fonction_id']) as $role) { |
259 | 259 | //db::debugmode(true); |
260 | 260 | $access = DB::queryFirstRow( |
261 | - 'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i', |
|
261 | + 'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i', |
|
262 | 262 | $role, |
263 | 263 | $record['id_tree'] |
264 | 264 | ); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | } |
279 | 279 | $accessLevel = count($arrTmp) > 0 ? min($arrTmp) : $accessLevel; |
280 | 280 | if ($accessLevel === 0) { |
281 | - $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"' . $record['id'] . '\">'; |
|
281 | + $checkbox = '<input type=\"checkbox\" value=\"0\" class=\"mass_op_cb\" data-id=\"'.$record['id'].'\">'; |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | if ((int) $accessLevel === 0) { |
@@ -318,22 +318,22 @@ discard block |
||
318 | 318 | if (empty($restrictedTo)) { |
319 | 319 | $restrictedTo = $_SESSION['user_id']; |
320 | 320 | } else { |
321 | - $restrictedTo .= ',' . $_SESSION['user_id']; |
|
321 | + $restrictedTo .= ','.$_SESSION['user_id']; |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
325 | 325 | //col1 |
326 | - $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"' . langHdl('open_url_link') . '\" onClick=\"window.location.href='index.php?page=items&group=' . $record['id_tree'] . '&id=' . $record['id'] . ''\" style=\"cursor:pointer;\"></i>' . |
|
327 | - '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"' . langHdl('see_item_title') . '\" data-id=\"' . $record['id'] . '\" data-perso=\"' . $record['perso'] . '\" data-tree-id=\"' . $record['id_tree'] . '\" data-expired=\"' . $expired . '\" data-restricted-to=\"' . $restrictedTo . '\" data-rights=\"' . $right . '\" style=\"cursor:pointer;\"></i>' . $checkbox . '", '; |
|
326 | + $sOutputItem .= '"<i class=\"fa fa-external-link-alt infotip mr-2\" title=\"'.langHdl('open_url_link').'\" onClick=\"window.location.href='index.php?page=items&group='.$record['id_tree'].'&id='.$record['id'].''\" style=\"cursor:pointer;\"></i>'. |
|
327 | + '<i class=\"fa fa-eye infotip mr-2 item-detail\" title=\"'.langHdl('see_item_title').'\" data-id=\"'.$record['id'].'\" data-perso=\"'.$record['perso'].'\" data-tree-id=\"'.$record['id_tree'].'\" data-expired=\"'.$expired.'\" data-restricted-to=\"'.$restrictedTo.'\" data-rights=\"'.$right.'\" style=\"cursor:pointer;\"></i>'.$checkbox.'", '; |
|
328 | 328 | //col2 |
329 | - $sOutputItem .= '"<span id=\"item_label-' . $record['id'] . '\">' . stripslashes($record['label']) . '</span>", '; |
|
329 | + $sOutputItem .= '"<span id=\"item_label-'.$record['id'].'\">'.stripslashes($record['label']).'</span>", '; |
|
330 | 330 | //col3 |
331 | - $sOutputItem .= '"' . str_replace('&', '&', htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)) . '", '; |
|
331 | + $sOutputItem .= '"'.str_replace('&', '&', htmlspecialchars(stripslashes($record['login']), ENT_QUOTES)).'", '; |
|
332 | 332 | //col4 |
333 | 333 | //get restriction from ROles |
334 | 334 | $restrictedToRole = false; |
335 | 335 | $rTmp = DB::queryFirstColumn( |
336 | - 'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i', |
|
336 | + 'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i', |
|
337 | 337 | $record['id'] |
338 | 338 | ); |
339 | 339 | // We considere here that if user has at least one group similar to the object ones |
@@ -351,14 +351,14 @@ discard block |
||
351 | 351 | } else { |
352 | 352 | $txt = str_replace(['\n', '<br />', '\\'], [' ', ' ', '', ' '], strip_tags($record['description'])); |
353 | 353 | if (strlen($txt) > 50) { |
354 | - $sOutputItem .= '"' . substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50) . '", '; |
|
354 | + $sOutputItem .= '"'.substr(stripslashes(preg_replace('~/<[\/]{0,1}[^>]*>\//|[ \t]/~', '', $txt)), 0, 50).'", '; |
|
355 | 355 | } else { |
356 | - $sOutputItem .= '"' . stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)) . '", '; |
|
356 | + $sOutputItem .= '"'.stripslashes(preg_replace('~/<[^>]*>|[ \t]/~', '', $txt)).'", '; |
|
357 | 357 | } |
358 | 358 | } |
359 | 359 | |
360 | 360 | //col5 - TAGS |
361 | - $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES) . '", '; |
|
361 | + $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['tags']), ENT_QUOTES).'", '; |
|
362 | 362 | // col6 - URL |
363 | 363 | if ($record['url'] !== '0') { |
364 | 364 | $sOutputItem .= '"'.filter_var($record['url'], FILTER_SANITIZE_URL).'", '; |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | } |
368 | 368 | |
369 | 369 | //col7 - Prepare the Treegrid |
370 | - $sOutputItem .= '"' . htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES) . '"'; |
|
370 | + $sOutputItem .= '"'.htmlspecialchars(stripslashes($record['folder']), ENT_QUOTES).'"'; |
|
371 | 371 | //Finish the line |
372 | 372 | $sOutputItem .= '], '; |
373 | 373 | if ($getItemInList === true) { |
@@ -376,16 +376,16 @@ discard block |
||
376 | 376 | --$iTotal; |
377 | 377 | } |
378 | 378 | } |
379 | - if (! empty($sOutputConst)) { |
|
379 | + if (!empty($sOutputConst)) { |
|
380 | 380 | $sOutput .= substr_replace($sOutputConst, '', -2); |
381 | 381 | } |
382 | 382 | $sOutput .= '], '; |
383 | - $sOutput .= '"recordsTotal": ' . $iTotal . ', '; |
|
384 | - $sOutput .= '"recordsFiltered": ' . $iTotal . ' }'; |
|
383 | + $sOutput .= '"recordsTotal": '.$iTotal.', '; |
|
384 | + $sOutput .= '"recordsFiltered": '.$iTotal.' }'; |
|
385 | 385 | echo $sOutput; |
386 | 386 | } elseif (isset($_GET['type']) && ($_GET['type'] === 'search_for_items' || $_GET['type'] === 'search_for_items_with_tags')) { |
387 | 387 | include_once 'main.functions.php'; |
388 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
388 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
389 | 389 | |
390 | 390 | $arr_data = []; |
391 | 391 | foreach ($rows as $record) { |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | |
406 | 406 | // Anyone can modify? |
407 | 407 | $tmp = DB::queryfirstrow( |
408 | - 'SELECT anyone_can_modify FROM ' . prefixTable('items') . ' WHERE id = %i', |
|
408 | + 'SELECT anyone_can_modify FROM '.prefixTable('items').' WHERE id = %i', |
|
409 | 409 | $record['id'] |
410 | 410 | ); |
411 | 411 | if (count($tmp) > 0) { |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | // => récupérer un tableau contenant les roles associés à cet ID (a partir table restriction_to_roles) |
437 | 437 | $user_is_included_in_role = 0; |
438 | 438 | $roles = DB::query( |
439 | - 'SELECT role_id FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id=%i', |
|
439 | + 'SELECT role_id FROM '.prefixTable('restriction_to_roles').' WHERE item_id=%i', |
|
440 | 440 | $record['id'] |
441 | 441 | ); |
442 | 442 | if (count($roles) > 0) { |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | if (empty($restrictedTo)) { |
460 | 460 | $restrictedTo = $_SESSION['user_id']; |
461 | 461 | } else { |
462 | - $restrictedTo .= ',' . $_SESSION['user_id']; |
|
462 | + $restrictedTo .= ','.$_SESSION['user_id']; |
|
463 | 463 | } |
464 | 464 | } |
465 | 465 | |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | $arrTmp = []; |
558 | 558 | foreach (explode(';', $_SESSION['fonction_id']) as $role) { |
559 | 559 | $access = DB::queryFirstRow( |
560 | - 'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i', |
|
560 | + 'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i', |
|
561 | 561 | $role, |
562 | 562 | $record['id_tree'] |
563 | 563 | ); |
@@ -606,8 +606,8 @@ discard block |
||
606 | 606 | ) { |
607 | 607 | $data_item = DB::queryFirstRow( |
608 | 608 | 'SELECT i.pw AS pw, s.share_key AS share_key |
609 | - FROM ' . prefixTable('items') . ' AS i |
|
610 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
609 | + FROM ' . prefixTable('items').' AS i |
|
610 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
611 | 611 | WHERE i.id = %i AND s.user_id = %i', |
612 | 612 | $record['id'], |
613 | 613 | $_SESSION['user_id'] |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | } |
38 | 38 | |
39 | 39 | // Do checks |
40 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
41 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
40 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
41 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
42 | 42 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'utilities.database', $SETTINGS) === false) { |
43 | 43 | // Not allowed page |
44 | 44 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
45 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
45 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
46 | 46 | exit(); |
47 | 47 | } |
48 | 48 | |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | date_default_timezone_set('UTC'); |
56 | 56 | } |
57 | 57 | |
58 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
59 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
58 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
59 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
60 | 60 | header('Content-type: text/html; charset=utf-8'); |
61 | 61 | header('Cache-Control: no-cache, must-revalidate'); |
62 | 62 | require_once 'main.functions.php'; |
63 | 63 | |
64 | 64 | //Connect to DB |
65 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
65 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
66 | 66 | if (defined('DB_PASSWD_CLEAR') === false) { |
67 | 67 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
68 | 68 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $arrFolders = array(); |
103 | 103 | $rows = DB::query( |
104 | 104 | 'SELECT valeur, intitule |
105 | - FROM ' . prefixTable('misc') . ' |
|
105 | + FROM ' . prefixTable('misc').' |
|
106 | 106 | WHERE type = %s', |
107 | 107 | 'folder_deleted' |
108 | 108 | ); |
@@ -123,10 +123,10 @@ discard block |
||
123 | 123 | 'SELECT u.login as login, u.name as name, u.lastname as lastname, |
124 | 124 | i.id as id, i.label as label, |
125 | 125 | i.id_tree as id_tree, l.date as date, n.title as folder_title |
126 | - FROM ' . prefixTable('log_items') . ' as l |
|
127 | - INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id) |
|
128 | - INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
129 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree=n.id) |
|
126 | + FROM ' . prefixTable('log_items').' as l |
|
127 | + INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id) |
|
128 | + INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
129 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree=n.id) |
|
130 | 130 | WHERE i.inactif = %i |
131 | 131 | AND l.action = %s', |
132 | 132 | 1, |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | 'label' => $record['label'], |
149 | 149 | 'date' => date($SETTINGS['date_format'], (int) $record['date']), |
150 | 150 | 'login' => $record['login'], |
151 | - 'name' => $record['name'] . ' ' . $record['lastname'], |
|
151 | + 'name' => $record['name'].' '.$record['lastname'], |
|
152 | 152 | 'folder_label' => $record['folder_title'], |
153 | 153 | 'folder_deleted' => $thisFolder, |
154 | 154 | ) |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | foreach ($post_folders as $folderId) { |
204 | 204 | $data = DB::queryfirstrow( |
205 | 205 | 'SELECT valeur |
206 | - FROM ' . prefixTable('misc') . " |
|
206 | + FROM ' . prefixTable('misc')." |
|
207 | 207 | WHERE type = 'folder_deleted' |
208 | 208 | AND intitule = %s", |
209 | - 'f' . $folderId |
|
209 | + 'f'.$folderId |
|
210 | 210 | ); |
211 | 211 | if ((int) $data['valeur'] !== 0) { |
212 | 212 | $folderData = explode(', ', $data['valeur']); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | prefixTable('misc'), |
233 | 233 | 'type = %s AND intitule = %s', |
234 | 234 | 'folder_deleted', |
235 | - 'f' . $folderId |
|
235 | + 'f'.$folderId |
|
236 | 236 | ); |
237 | 237 | |
238 | 238 | // Restore all items in this folder |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | // Get list of all items in thos folder |
249 | 249 | $items = DB::query( |
250 | 250 | 'SELECT id |
251 | - FROM ' . prefixTable('items') . ' |
|
251 | + FROM ' . prefixTable('items').' |
|
252 | 252 | WHERE id_tree = %i', |
253 | 253 | $folderId |
254 | 254 | ); |
@@ -333,10 +333,10 @@ discard block |
||
333 | 333 | foreach ($post_folders as $folderId) { |
334 | 334 | $data = DB::queryfirstrow( |
335 | 335 | 'SELECT valeur |
336 | - FROM ' . prefixTable('misc') . " |
|
336 | + FROM ' . prefixTable('misc')." |
|
337 | 337 | WHERE type = 'folder_deleted' |
338 | 338 | AND intitule = %s", |
339 | - 'f' . $folderId |
|
339 | + 'f'.$folderId |
|
340 | 340 | ); |
341 | 341 | if ((int) $data['valeur'] !== 0) { |
342 | 342 | $folderData = explode(', ', $data['valeur']); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | prefixTable('misc'), |
369 | 369 | 'type = %s AND intitule = %s', |
370 | 370 | 'folder_deleted', |
371 | - 'f' . $folderData[0] |
|
371 | + 'f'.$folderData[0] |
|
372 | 372 | ); |
373 | 373 | |
374 | 374 | // Delete all items in this folder |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | // Get list of all items in thos folder |
383 | 383 | $items = DB::query( |
384 | 384 | 'SELECT id |
385 | - FROM ' . prefixTable('items') . ' |
|
385 | + FROM ' . prefixTable('items').' |
|
386 | 386 | WHERE id_tree = %i', |
387 | 387 | $folderData[0] |
388 | 388 | ); |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | ) { |
479 | 479 | if ($post_log_type === 'items') { |
480 | 480 | DB::query( |
481 | - 'SELECT * FROM ' . prefixTable('log_items') . ' |
|
481 | + 'SELECT * FROM '.prefixTable('log_items').' |
|
482 | 482 | WHERE (date BETWEEN %i AND %i)' |
483 | 483 | . ($post_filter_action === 'all' ? '' : ' AND action = "'.$post_filter_action.'"') |
484 | 484 | . ((int) $post_filter_user === -1 ? '' : ' AND id_user = '.(int) $post_filter_user), |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | } elseif ($post_log_type === 'connections') { |
499 | 499 | //db::debugmode(true); |
500 | 500 | DB::query( |
501 | - 'SELECT * FROM ' . prefixTable('log_system') . ' |
|
501 | + 'SELECT * FROM '.prefixTable('log_system').' |
|
502 | 502 | WHERE type=%s ' |
503 | 503 | . 'AND (date BETWEEN %i AND %i)' |
504 | 504 | . ($post_filter_action === 'all' ? '' : ' AND action = '.$post_filter_action) |
@@ -521,12 +521,12 @@ discard block |
||
521 | 521 | ); |
522 | 522 | } elseif ($post_log_type === 'errors') { |
523 | 523 | //db::debugmode(true); |
524 | - echo 'SELECT * FROM ' . prefixTable('log_items') . ' |
|
524 | + echo 'SELECT * FROM '.prefixTable('log_items').' |
|
525 | 525 | WHERE (date BETWEEN '.$post_date_from.' AND '.$post_date_to.')' |
526 | 526 | . ($post_filter_action === 'all' ? '' : ' AND action = '.$post_filter_action) |
527 | 527 | . ((int) $post_filter_user === -1 ? '' : ' AND id_user = '.(int) $post_filter_user); |
528 | 528 | DB::query( |
529 | - 'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' . |
|
529 | + 'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '. |
|
530 | 530 | 'AND (date BETWEEN %i AND %i)', |
531 | 531 | 'error', |
532 | 532 | $post_date_from, |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | ); |
544 | 544 | } elseif ($post_log_type === 'copy') { |
545 | 545 | DB::query( |
546 | - 'SELECT * FROM ' . prefixTable('log_items') . ' WHERE action=%s ' . |
|
546 | + 'SELECT * FROM '.prefixTable('log_items').' WHERE action=%s '. |
|
547 | 547 | 'AND (date BETWEEN %i AND %i)', |
548 | 548 | 'at_copy', |
549 | 549 | $post_date_from, |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | ); |
561 | 561 | } elseif ($post_log_type === 'admin') { |
562 | 562 | DB::query( |
563 | - 'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' . |
|
563 | + 'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '. |
|
564 | 564 | 'AND (date BETWEEN %i AND %i)', |
565 | 565 | 'admin_action', |
566 | 566 | $post_date_from, |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | ); |
578 | 578 | } elseif ($post_log_type === 'failed') { |
579 | 579 | DB::query( |
580 | - 'SELECT * FROM ' . prefixTable('log_system') . ' WHERE type=%s ' . |
|
580 | + 'SELECT * FROM '.prefixTable('log_system').' WHERE type=%s '. |
|
581 | 581 | 'AND (date BETWEEN %i AND %i)', |
582 | 582 | 'failed_auth', |
583 | 583 | $post_date_from, |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | /* do checks */ |
46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'admin', $SETTINGS) === false) { |
48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
49 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
49 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
50 | 50 | exit; |
51 | 51 | } |
52 | 52 | |
53 | 53 | // Load template |
54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
54 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
55 | 55 | // Generates zones |
56 | 56 | $zones = timezone_list(); |
57 | 57 | ?> |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | // get list of all timezones |
261 | 261 | foreach ($zones as $key => $zone) { |
262 | 262 | echo ' |
263 | - <option value="' . $key . '"', isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : '', '>' . $zone . '</option>'; |
|
263 | + <option value="' . $key.'"', isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : '', '>'.$zone.'</option>'; |
|
264 | 264 | } |
265 | 265 | ?> |
266 | 266 | </select> |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | <?php |
312 | 312 | foreach ($languagesList as $lang) { |
313 | 313 | echo ' |
314 | - <option value="' . $lang . '"', isset($SETTINGS['default_language']) === true && $SETTINGS['default_language'] === $lang ? ' selected' : '', '>' . $lang . '</option>'; |
|
314 | + <option value="' . $lang.'"', isset($SETTINGS['default_language']) === true && $SETTINGS['default_language'] === $lang ? ' selected' : '', '>'.$lang.'</option>'; |
|
315 | 315 | } |
316 | 316 | ?> |
317 | 317 | </select> |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | <?php |
409 | 409 | foreach (TP_PW_COMPLEXITY as $complex) { |
410 | 410 | echo ' |
411 | - <option value="' . $complex[0] . '"', isset($SETTINGS['personal_saltkey_security_level']) === true && $SETTINGS['personal_saltkey_security_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>'; |
|
411 | + <option value="' . $complex[0].'"', isset($SETTINGS['personal_saltkey_security_level']) === true && $SETTINGS['personal_saltkey_security_level'] === $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>'; |
|
412 | 412 | } |
413 | 413 | ?> |
414 | 414 | </select> |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | ); |
722 | 722 | foreach ($roles as $role) { |
723 | 723 | echo ' |
724 | - <option value="' . $role['id'] . '"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>' . addslashes($role['title']) . '</option>'; |
|
724 | + <option value="' . $role['id'].'"', in_array($role['id'], $arrRolesToPrint) === true ? ' selected' : '', '>'.addslashes($role['title']).'</option>'; |
|
725 | 725 | } |
726 | 726 | } |
727 | 727 | ?> |
@@ -894,7 +894,7 @@ discard block |
||
894 | 894 | <?php |
895 | 895 | foreach (TP_PW_COMPLEXITY as $complex) { |
896 | 896 | echo ' |
897 | - <option value="' . $complex[0] . '"', isset($SETTINGS['offline_key_level']) === true && $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>' . $complex[1] . '</option>'; |
|
897 | + <option value="' . $complex[0].'"', isset($SETTINGS['offline_key_level']) === true && $SETTINGS['offline_key_level'] === $complex[0] ? ' selected' : '', '>'.$complex[1].'</option>'; |
|
898 | 898 | } |
899 | 899 | ?> |
900 | 900 | </select> |