@@ -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 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | // Get DUO keys |
| 96 | 96 | $duoData = DB::query( |
| 97 | 97 | 'SELECT intitule, valeur |
| 98 | - FROM ' . prefixTable('misc') . ' |
|
| 98 | + FROM ' . prefixTable('misc').' |
|
| 99 | 99 | WHERE type = %s', |
| 100 | 100 | 'duoSecurity' |
| 101 | 101 | ); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // load library |
| 108 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 108 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 109 | 109 | $sig_request = Duo::signRequest( |
| 110 | 110 | $_GLOBALS['IKEY'], |
| 111 | 111 | $_GLOBALS['SKEY'], |
@@ -116,16 +116,16 @@ discard block |
||
| 116 | 116 | debugIdentify( |
| 117 | 117 | DEBUGDUO, |
| 118 | 118 | DEBUGDUOFILE, |
| 119 | - "\n\n-----\n\n" . |
|
| 120 | - 'sig request : ' . $post_login . "\n" . |
|
| 121 | - 'resp : ' . $sig_request . "\n" |
|
| 119 | + "\n\n-----\n\n". |
|
| 120 | + 'sig request : '.$post_login."\n". |
|
| 121 | + 'resp : '.$sig_request."\n" |
|
| 122 | 122 | ); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | // load csrfprotector |
| 126 | - $csrfp_config = include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/csrfp/libs/csrfp.config.php'; |
|
| 126 | + $csrfp_config = include_once $SETTINGS['cpassman_dir'].'/includes/libraries/csrfp/libs/csrfp.config.php'; |
|
| 127 | 127 | // return result |
| 128 | - echo '[{"sig_request" : "' . $sig_request . '" , "csrfp_token" : "' . $csrfp_config['CSRFP_TOKEN'] . '" , "csrfp_key" : "' . filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING) . '"}]'; |
|
| 128 | + echo '[{"sig_request" : "'.$sig_request.'" , "csrfp_token" : "'.$csrfp_config['CSRFP_TOKEN'].'" , "csrfp_key" : "'.filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING).'"}]'; |
|
| 129 | 129 | // --- |
| 130 | 130 | // --- |
| 131 | 131 | } elseif ($post_type === 'identify_duo_user_check') { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | //-------- |
| 136 | 136 | |
| 137 | 137 | // load library |
| 138 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 138 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 139 | 139 | $authenticated_username = Duo::verifyResponse( |
| 140 | 140 | $SETTINGS['duo_ikey'], |
| 141 | 141 | $SETTINGS['duo_skey'], |
@@ -146,9 +146,9 @@ discard block |
||
| 146 | 146 | debugIdentify( |
| 147 | 147 | DEBUGDUO, |
| 148 | 148 | DEBUGDUOFILE, |
| 149 | - "\n\n-----\n\n" . |
|
| 150 | - 'sig response : ' . $post_sig_response . "\n" . |
|
| 151 | - 'resp : ' . $authenticated_username . "\n" |
|
| 149 | + "\n\n-----\n\n". |
|
| 150 | + 'sig response : '.$post_sig_response."\n". |
|
| 151 | + 'resp : '.$authenticated_username."\n" |
|
| 152 | 152 | ); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | // is user in Teampass? |
| 160 | 160 | DB::queryfirstrow( |
| 161 | 161 | 'SELECT id |
| 162 | - FROM ' . prefixTable('users') . ' |
|
| 162 | + FROM ' . prefixTable('users').' |
|
| 163 | 163 | WHERE login = %s', |
| 164 | 164 | $post_login |
| 165 | 165 | ); |
@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - echo '[{"authenticated_username" : "' . $authenticated_username . '"}]'; |
|
| 172 | + echo '[{"authenticated_username" : "'.$authenticated_username.'"}]'; |
|
| 173 | 173 | } else { |
| 174 | - echo '[{"authenticated_username" : "' . $authenticated_username . '"}]'; |
|
| 174 | + echo '[{"authenticated_username" : "'.$authenticated_username.'"}]'; |
|
| 175 | 175 | } |
| 176 | 176 | // --- |
| 177 | 177 | // --- |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | //-------- |
| 182 | 182 | |
| 183 | 183 | // Load superGlobals |
| 184 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 184 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 185 | 185 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 186 | 186 | // Prepare GET variables |
| 187 | 187 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
@@ -268,19 +268,19 @@ discard block |
||
| 268 | 268 | } else { |
| 269 | 269 | throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
| 270 | 270 | } |
| 271 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 272 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 273 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 271 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 272 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 273 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 274 | 274 | |
| 275 | 275 | header('Content-type: text/html; charset=utf-8'); |
| 276 | 276 | error_reporting(E_ERROR); |
| 277 | 277 | |
| 278 | 278 | // Load AntiXSS |
| 279 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 279 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 280 | 280 | $antiXss = new voku\helper\AntiXSS(); |
| 281 | 281 | |
| 282 | 282 | // Load superGlobals |
| 283 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 283 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 284 | 284 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 285 | 285 | |
| 286 | 286 | // Prepare GET variables |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | $server['PHP_AUTH_PW'] = $superGlobal->get('PHP_AUTH_PW', 'SERVER'); |
| 295 | 295 | |
| 296 | 296 | // connect to the server |
| 297 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 297 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 298 | 298 | DB::$host = DB_HOST; |
| 299 | 299 | DB::$user = DB_USER; |
| 300 | 300 | DB::$password = defined('DB_PASSWD_CLEAR') === false ? defuseReturnDecrypted(DB_PASSWD, $SETTINGS) : DB_PASSWD_CLEAR; |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | DB::$port = DB_PORT; |
| 303 | 303 | DB::$encoding = DB_ENCODING; |
| 304 | 304 | // User's language loading |
| 305 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $sessionUserLanguage . '.php'; |
|
| 305 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$sessionUserLanguage.'.php'; |
|
| 306 | 306 | |
| 307 | 307 | // decrypt and retreive data in JSON format |
| 308 | 308 | if (empty($sessionKey) === true) { |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | //$arrAttempts = array(); |
| 497 | 497 | $rows = DB::query( |
| 498 | 498 | 'SELECT date |
| 499 | - FROM ' . prefixTable('log_system') . " |
|
| 499 | + FROM ' . prefixTable('log_system')." |
|
| 500 | 500 | WHERE field_1 = %s |
| 501 | 501 | AND type = 'failed_auth' |
| 502 | 502 | AND label = 'user_password_not_correct' |
@@ -512,7 +512,7 @@ discard block |
||
| 512 | 512 | foreach ($rows as $record) { |
| 513 | 513 | array_push( |
| 514 | 514 | $arrAttempts, |
| 515 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) |
|
| 515 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']) |
|
| 516 | 516 | ); |
| 517 | 517 | } |
| 518 | 518 | } |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | $superGlobal->put('user_upgrade_needed', $userInfo['upgrade_needed'], 'SESSION'); |
| 549 | 549 | $superGlobal->put('user_force_relog', $userInfo['force-relog'], 'SESSION'); |
| 550 | 550 | // get personal settings |
| 551 | - if (! isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) { |
|
| 551 | + if (!isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) { |
|
| 552 | 552 | $userInfo['treeloadstrategy'] = 'full'; |
| 553 | 553 | } |
| 554 | 554 | $superGlobal->put('treeloadstrategy', $userInfo['treeloadstrategy'], 'SESSION', 'user'); |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | foreach ($superGlobal->get('user_roles', 'SESSION') as $role) { |
| 651 | 651 | $resRoles = DB::queryFirstRow( |
| 652 | 652 | 'SELECT title, complexity |
| 653 | - FROM ' . prefixTable('roles_title') . ' |
|
| 653 | + FROM ' . prefixTable('roles_title').' |
|
| 654 | 654 | WHERE id=%i', |
| 655 | 655 | $role |
| 656 | 656 | ); |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | |
| 672 | 672 | // build complete array of roles |
| 673 | 673 | $superGlobal->put('arr_roles_full', [], 'SESSION'); |
| 674 | - $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC'); |
|
| 674 | + $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC'); |
|
| 675 | 675 | foreach ($rows as $record) { |
| 676 | 676 | $superGlobal->put( |
| 677 | 677 | $record['id'], |
@@ -761,10 +761,10 @@ discard block |
||
| 761 | 761 | $superGlobal->put('latest_items_tab', [], 'SESSION'); |
| 762 | 762 | $superGlobal->put('nb_roles', 0, 'SESSION'); |
| 763 | 763 | foreach ($superGlobal->get('latest_items', 'SESSION') as $item) { |
| 764 | - if (! empty($item)) { |
|
| 764 | + if (!empty($item)) { |
|
| 765 | 765 | $dataLastItems = DB::queryFirstRow( |
| 766 | 766 | 'SELECT id,label,id_tree |
| 767 | - FROM ' . prefixTable('items') . ' |
|
| 767 | + FROM ' . prefixTable('items').' |
|
| 768 | 768 | WHERE id=%i', |
| 769 | 769 | $item |
| 770 | 770 | ); |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | [ |
| 774 | 774 | 'id' => $item, |
| 775 | 775 | 'label' => $dataLastItems['label'], |
| 776 | - 'url' => 'index.php?page=items&group=' . $dataLastItems['id_tree'] . '&id=' . $item, |
|
| 776 | + 'url' => 'index.php?page=items&group='.$dataLastItems['id_tree'].'&id='.$item, |
|
| 777 | 777 | ], |
| 778 | 778 | 'SESSION', |
| 779 | 779 | 'latest_items_tab' |
@@ -790,12 +790,12 @@ discard block |
||
| 790 | 790 | ) { |
| 791 | 791 | // get all Admin users |
| 792 | 792 | $receivers = ''; |
| 793 | - $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1); |
|
| 793 | + $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1); |
|
| 794 | 794 | foreach ($rows as $record) { |
| 795 | 795 | if (empty($receivers)) { |
| 796 | 796 | $receivers = $record['email']; |
| 797 | 797 | } else { |
| 798 | - $receivers = ',' . $record['email']; |
|
| 798 | + $receivers = ','.$record['email']; |
|
| 799 | 799 | } |
| 800 | 800 | } |
| 801 | 801 | // Add email to table |
@@ -811,7 +811,7 @@ discard block |
||
| 811 | 811 | '#tp_time#', |
| 812 | 812 | ], |
| 813 | 813 | [ |
| 814 | - ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')', |
|
| 814 | + ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')', |
|
| 815 | 815 | date($SETTINGS['date_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
| 816 | 816 | date($SETTINGS['time_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
| 817 | 817 | ], |
@@ -956,8 +956,8 @@ discard block |
||
| 956 | 956 | debugIdentify( |
| 957 | 957 | DEBUGDUO, |
| 958 | 958 | DEBUGDUOFILE, |
| 959 | - "\n\n----\n" . |
|
| 960 | - 'Identified : ' . filter_var($return, FILTER_SANITIZE_STRING) . "\n\n" |
|
| 959 | + "\n\n----\n". |
|
| 960 | + 'Identified : '.filter_var($return, FILTER_SANITIZE_STRING)."\n\n" |
|
| 961 | 961 | ); |
| 962 | 962 | echo prepareExchangedData( |
| 963 | 963 | [ |
@@ -1023,44 +1023,44 @@ discard block |
||
| 1023 | 1023 | ], |
| 1024 | 1024 | ]; |
| 1025 | 1025 | // Load expected libraries |
| 1026 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
| 1027 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
| 1028 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 1029 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
| 1030 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 1031 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
| 1032 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
| 1033 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
| 1034 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
| 1035 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 1036 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php'; |
|
| 1037 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php'; |
|
| 1038 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 1039 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php'; |
|
| 1040 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 1041 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 1042 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 1043 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 1044 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 1045 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php'; |
|
| 1046 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 1047 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 1048 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 1049 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 1050 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 1051 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 1052 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 1053 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 1054 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 1055 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 1056 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php'; |
|
| 1057 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 1058 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php'; |
|
| 1059 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 1060 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php'; |
|
| 1061 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 1062 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 1063 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php'; |
|
| 1026 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
| 1027 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
| 1028 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 1029 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
| 1030 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 1031 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
| 1032 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
| 1033 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
| 1034 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
| 1035 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 1036 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php'; |
|
| 1037 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php'; |
|
| 1038 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 1039 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php'; |
|
| 1040 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 1041 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 1042 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 1043 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 1044 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 1045 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php'; |
|
| 1046 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 1047 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 1048 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 1049 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 1050 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 1051 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 1052 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 1053 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 1054 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 1055 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 1056 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php'; |
|
| 1057 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 1058 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php'; |
|
| 1059 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 1060 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php'; |
|
| 1061 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 1062 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 1063 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php'; |
|
| 1064 | 1064 | $ad = new SplClassLoader('LdapRecord', '../includes/libraries'); |
| 1065 | 1065 | $ad->register(); |
| 1066 | 1066 | $connection = new Connection($config); |
@@ -1072,7 +1072,7 @@ discard block |
||
| 1072 | 1072 | $error = $e->getDetailedError(); |
| 1073 | 1073 | return [ |
| 1074 | 1074 | 'error' => true, |
| 1075 | - 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage().' '.$config['username'], |
|
| 1075 | + 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage().' '.$config['username'], |
|
| 1076 | 1076 | |
| 1077 | 1077 | ]; |
| 1078 | 1078 | } |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | // load passwordLib library |
| 1103 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1103 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1104 | 1104 | $pwdlib->register(); |
| 1105 | 1105 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1106 | 1106 | $hashedPassword = $pwdlib->createPasswordHash($passwordClear); |
@@ -1165,7 +1165,7 @@ discard block |
||
| 1165 | 1165 | function yubicoMFACheck($dataReceived, string $userInfo, array $SETTINGS): array |
| 1166 | 1166 | { |
| 1167 | 1167 | // Load superGlobals |
| 1168 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1168 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1169 | 1169 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1170 | 1170 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
| 1171 | 1171 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
@@ -1204,7 +1204,7 @@ discard block |
||
| 1204 | 1204 | } |
| 1205 | 1205 | |
| 1206 | 1206 | // Now check yubico validity |
| 1207 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 1207 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 1208 | 1208 | $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key); |
| 1209 | 1209 | $auth = $yubi->verify($yubico_key); |
| 1210 | 1210 | //, null, null, null, 60 |
@@ -1256,7 +1256,7 @@ discard block |
||
| 1256 | 1256 | 'gestionnaire' => '0', |
| 1257 | 1257 | 'can_manage_all_users' => '0', |
| 1258 | 1258 | 'personal_folder' => $SETTINGS['enable_pf_feature'] === '1' ? '1' : '0', |
| 1259 | - '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'), |
|
| 1259 | + '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'), |
|
| 1260 | 1260 | 'groupes_interdits' => '', |
| 1261 | 1261 | 'groupes_visibles' => '', |
| 1262 | 1262 | 'last_pw_change' => (int) time(), |
@@ -1281,7 +1281,7 @@ discard block |
||
| 1281 | 1281 | ] |
| 1282 | 1282 | ); |
| 1283 | 1283 | // Rebuild tree |
| 1284 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1284 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1285 | 1285 | $tree->register(); |
| 1286 | 1286 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1287 | 1287 | $tree->rebuild(); |
@@ -1312,13 +1312,13 @@ discard block |
||
| 1312 | 1312 | && empty($dataReceived['GACode']) === false |
| 1313 | 1313 | ) { |
| 1314 | 1314 | // Load superGlobals |
| 1315 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1315 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1316 | 1316 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1317 | 1317 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
| 1318 | 1318 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
| 1319 | 1319 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
| 1320 | 1320 | // load library |
| 1321 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 1321 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 1322 | 1322 | // create new instance |
| 1323 | 1323 | $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']); |
| 1324 | 1324 | // Init |
@@ -1340,7 +1340,7 @@ discard block |
||
| 1340 | 1340 | $mfaMessage = langHdl('ga_flash_qr_and_login'); |
| 1341 | 1341 | // generate new QR |
| 1342 | 1342 | $new_2fa_qr = $tfa->getQRCodeImageAsDataUri( |
| 1343 | - 'Teampass - ' . $username, |
|
| 1343 | + 'Teampass - '.$username, |
|
| 1344 | 1344 | $userInfo['ga'] |
| 1345 | 1345 | ); |
| 1346 | 1346 | // clear temporary code from DB |
@@ -1353,7 +1353,7 @@ discard block |
||
| 1353 | 1353 | $userInfo['id'] |
| 1354 | 1354 | ); |
| 1355 | 1355 | $firstTime = [ |
| 1356 | - 'value' => '<img src="' . $new_2fa_qr . '">', |
|
| 1356 | + 'value' => '<img src="'.$new_2fa_qr.'">', |
|
| 1357 | 1357 | 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '', |
| 1358 | 1358 | 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '', |
| 1359 | 1359 | 'pwd_attempts' => (int) $sessionPwdAttempts, |
@@ -1405,8 +1405,8 @@ discard block |
||
| 1405 | 1405 | // Set to false |
| 1406 | 1406 | $userPasswordVerified = false; |
| 1407 | 1407 | // load passwordLib library |
| 1408 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1409 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1408 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1409 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1410 | 1410 | $pwdlib->register(); |
| 1411 | 1411 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1412 | 1412 | // Check if old encryption used |
@@ -1537,7 +1537,7 @@ discard block |
||
| 1537 | 1537 | // Brute force management |
| 1538 | 1538 | if ($sessionPwdAttempts > 3) { |
| 1539 | 1539 | // Load superGlobals |
| 1540 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1540 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1541 | 1541 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1542 | 1542 | $superGlobal->put('next_possible_pwd_attempts', time() + 10, 'SESSION'); |
| 1543 | 1543 | $superGlobal->put('pwd_attempts', 0, 'SESSION'); |
@@ -1579,7 +1579,7 @@ discard block |
||
| 1579 | 1579 | // Check if user exists |
| 1580 | 1580 | $userInfo = DB::queryFirstRow( |
| 1581 | 1581 | 'SELECT * |
| 1582 | - FROM ' . prefixTable('users') . ' WHERE login=%s', |
|
| 1582 | + FROM ' . prefixTable('users').' WHERE login=%s', |
|
| 1583 | 1583 | $username |
| 1584 | 1584 | ); |
| 1585 | 1585 | $counter = DB::count(); |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | date_default_timezone_set(isset($SETTINGS['timezone']) === true ? $SETTINGS['timezone'] : 'UTC'); |
| 46 | 46 | |
| 47 | 47 | // DO CHECKS |
| 48 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 49 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 48 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 49 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 50 | 50 | $post_type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING); |
| 51 | 51 | if ( |
| 52 | 52 | isset($post_type) === true |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | && checkUser($_SESSION['user_id'], $_SESSION['key'], 'home', $SETTINGS) === false |
| 63 | 63 | ) { |
| 64 | 64 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page |
| 65 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 65 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 66 | 66 | exit(); |
| 67 | 67 | } elseif ((isset($_SESSION['user_id']) === true |
| 68 | 68 | && isset($_SESSION['key'])) === true |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | mainQuery($SETTINGS); |
| 75 | 75 | } else { |
| 76 | 76 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page |
| 77 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 77 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 78 | 78 | exit(); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | // Includes |
| 92 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 93 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 94 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 95 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 92 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 93 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 94 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 95 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 96 | 96 | |
| 97 | 97 | // Connect to mysql server |
| 98 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 98 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 99 | 99 | |
| 100 | 100 | DB::$host = DB_HOST; |
| 101 | 101 | DB::$user = DB_USER; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | DB::$encoding = DB_ENCODING; |
| 106 | 106 | |
| 107 | 107 | // User's language loading |
| 108 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 108 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 109 | 109 | |
| 110 | 110 | // Prepare post variables |
| 111 | 111 | $post_key = filter_input(INPUT_POST, 'key', FILTER_SANITIZE_STRING); |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $pwdlib = new PasswordLib\PasswordLib(); |
| 250 | 250 | // generate key |
| 251 | 251 | $key = $pwdlib->getRandomToken(filter_input(INPUT_POST, 'size', FILTER_SANITIZE_NUMBER_INT)); |
| 252 | - echo '[{"key" : "' . htmlentities($key, ENT_QUOTES) . '"}]'; |
|
| 252 | + echo '[{"key" : "'.htmlentities($key, ENT_QUOTES).'"}]'; |
|
| 253 | 253 | break; |
| 254 | 254 | |
| 255 | 255 | /* |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | ) |
| 279 | 279 | ); |
| 280 | 280 | |
| 281 | - echo '[{"token" : "' . $token . '"}]'; |
|
| 281 | + echo '[{"token" : "'.$token.'"}]'; |
|
| 282 | 282 | break; |
| 283 | 283 | |
| 284 | 284 | |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | // check if expected security level is reached |
| 579 | 579 | $dataUser = DB::queryfirstrow( |
| 580 | 580 | 'SELECT * |
| 581 | - FROM ' . prefixTable('users') . ' WHERE id = %i', |
|
| 581 | + FROM ' . prefixTable('users').' WHERE id = %i', |
|
| 582 | 582 | $post_user_id |
| 583 | 583 | ); |
| 584 | 584 | |
@@ -599,8 +599,8 @@ discard block |
||
| 599 | 599 | if (empty($dataUser['fonction_id']) === false) { |
| 600 | 600 | $data = DB::queryFirstRow( |
| 601 | 601 | 'SELECT complexity |
| 602 | - FROM ' . prefixTable('roles_title') . ' |
|
| 603 | - WHERE id IN (' . $dataUser['fonction_id'] . ') |
|
| 602 | + FROM ' . prefixTable('roles_title').' |
|
| 603 | + WHERE id IN (' . $dataUser['fonction_id'].') |
|
| 604 | 604 | ORDER BY complexity DESC' |
| 605 | 605 | ); |
| 606 | 606 | } else { |
@@ -613,8 +613,8 @@ discard block |
||
| 613 | 613 | return prepareExchangedData( |
| 614 | 614 | array( |
| 615 | 615 | 'error' => true, |
| 616 | - 'message' => '<div style="margin:10px 0 10px 15px;">' . langHdl('complexity_level_not_reached') . '.<br>' . |
|
| 617 | - langHdl('expected_complexity_level') . ': <b>' . TP_PW_COMPLEXITY[$data['complexity']][1] . '</b></div>', |
|
| 616 | + 'message' => '<div style="margin:10px 0 10px 15px;">'.langHdl('complexity_level_not_reached').'.<br>'. |
|
| 617 | + langHdl('expected_complexity_level').': <b>'.TP_PW_COMPLEXITY[$data['complexity']][1].'</b></div>', |
|
| 618 | 618 | ), |
| 619 | 619 | 'encode' |
| 620 | 620 | ); |
@@ -715,14 +715,14 @@ discard block |
||
| 715 | 715 | // Get data about user |
| 716 | 716 | $data = DB::queryfirstrow( |
| 717 | 717 | 'SELECT id, email, pw |
| 718 | - FROM ' . prefixTable('users') . ' |
|
| 718 | + FROM ' . prefixTable('users').' |
|
| 719 | 719 | WHERE login = %s', |
| 720 | 720 | $post_login |
| 721 | 721 | ); |
| 722 | 722 | } else { |
| 723 | 723 | $data = DB::queryfirstrow( |
| 724 | 724 | 'SELECT id, login, email, pw |
| 725 | - FROM ' . prefixTable('users') . ' |
|
| 725 | + FROM ' . prefixTable('users').' |
|
| 726 | 726 | WHERE id = %i', |
| 727 | 727 | $post_id |
| 728 | 728 | ); |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | $counter = DB::count(); |
| 733 | 733 | |
| 734 | 734 | // load passwordLib library |
| 735 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 735 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 736 | 736 | $pwdlib->register(); |
| 737 | 737 | $pwdlib = new PasswordLib\PasswordLib(); |
| 738 | 738 | |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | } |
| 780 | 780 | |
| 781 | 781 | // generate new GA user code |
| 782 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 782 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 783 | 783 | $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']); |
| 784 | 784 | $gaSecretKey = $tfa->createSecret(); |
| 785 | 785 | $gaTemporaryCode = GenerateCryptKey(12, false, true, true, false, true, $SETTINGS); |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | 'email' => $data['email'], |
| 822 | 822 | 'email_result' => str_replace( |
| 823 | 823 | '#email#', |
| 824 | - '<b>' . obfuscateEmail($data['email']) . '</b>', |
|
| 824 | + '<b>'.obfuscateEmail($data['email']).'</b>', |
|
| 825 | 825 | addslashes(langHdl('admin_email_result_ok')) |
| 826 | 826 | ), |
| 827 | 827 | ), |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | 'email' => $data['email'], |
| 838 | 838 | 'email_result' => str_replace( |
| 839 | 839 | '#email#', |
| 840 | - '<b>' . obfuscateEmail($data['email']) . '</b>', |
|
| 840 | + '<b>'.obfuscateEmail($data['email']).'</b>', |
|
| 841 | 841 | addslashes(langHdl('admin_email_result_ok')) |
| 842 | 842 | ), |
| 843 | 843 | ), |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | && (int) $SETTINGS['enable_send_email_on_user_login'] === 1 |
| 854 | 854 | ) { |
| 855 | 855 | $row = DB::queryFirstRow( |
| 856 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', |
|
| 856 | + 'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', |
|
| 857 | 857 | 'cron', |
| 858 | 858 | 'sending_emails' |
| 859 | 859 | ); |
@@ -861,12 +861,12 @@ discard block |
||
| 861 | 861 | if ((int) (time() - $row['valeur']) >= 300 || (int) $row['valeur'] === 0) { |
| 862 | 862 | $rows = DB::query( |
| 863 | 863 | 'SELECT * |
| 864 | - FROM ' . prefixTable('emails') . |
|
| 864 | + FROM ' . prefixTable('emails'). |
|
| 865 | 865 | ' WHERE status != %s', |
| 866 | 866 | 'sent' |
| 867 | 867 | ); |
| 868 | 868 | foreach ($rows as $record) { |
| 869 | - echo $record['increment_id'] . " >> "; |
|
| 869 | + echo $record['increment_id']." >> "; |
|
| 870 | 870 | // Send email |
| 871 | 871 | $ret = json_decode( |
| 872 | 872 | sendEmail( |
@@ -965,8 +965,8 @@ discard block |
||
| 965 | 965 | $arr_html = array(); |
| 966 | 966 | $rows = DB::query( |
| 967 | 967 | 'SELECT i.id AS id, i.label AS label, i.id_tree AS id_tree, l.date, i.perso AS perso, i.restricted_to AS restricted |
| 968 | - FROM ' . prefixTable('log_items') . ' AS l |
|
| 969 | - RIGHT JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id) |
|
| 968 | + FROM ' . prefixTable('log_items').' AS l |
|
| 969 | + RIGHT JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id) |
|
| 970 | 970 | WHERE l.action = %s AND l.id_user = %i |
| 971 | 971 | ORDER BY l.date DESC |
| 972 | 972 | LIMIT 0, 100', |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1 |
| 1000 | 1000 | && ((int) $_SESSION['user_admin'] === 1 || (int) $_SESSION['user_manager'] === 1) |
| 1001 | 1001 | ) { |
| 1002 | - DB::query('SELECT * FROM ' . prefixTable('suggestion')); |
|
| 1002 | + DB::query('SELECT * FROM '.prefixTable('suggestion')); |
|
| 1003 | 1003 | $nb_suggestions_waiting = DB::count(); |
| 1004 | 1004 | } |
| 1005 | 1005 | |
@@ -1035,13 +1035,13 @@ discard block |
||
| 1035 | 1035 | if ($data === 'stat_languages') { |
| 1036 | 1036 | $tmp = ''; |
| 1037 | 1037 | foreach ($stats_data[$data] as $key => $value) { |
| 1038 | - $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value; |
|
| 1038 | + $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value; |
|
| 1039 | 1039 | } |
| 1040 | 1040 | $statsToSend[$data] = $tmp; |
| 1041 | 1041 | } elseif ($data === 'stat_country') { |
| 1042 | 1042 | $tmp = ''; |
| 1043 | 1043 | foreach ($stats_data[$data] as $key => $value) { |
| 1044 | - $tmp .= $tmp === '' ? $key . '-' . $value : ',' . $key . '-' . $value; |
|
| 1044 | + $tmp .= $tmp === '' ? $key.'-'.$value : ','.$key.'-'.$value; |
|
| 1045 | 1045 | } |
| 1046 | 1046 | $statsToSend[$data] = $tmp; |
| 1047 | 1047 | } else { |
@@ -1115,8 +1115,8 @@ discard block |
||
| 1115 | 1115 | if (strpos($line, 'cpassman_url') > 0 && empty($url_found) === true) { |
| 1116 | 1116 | $url_found = substr($line, 19, strlen($line) - 22); |
| 1117 | 1117 | $tmp = parse_url($url_found); |
| 1118 | - $anonym_url = $tmp['scheme'] . '://<anonym_url>' . $tmp['path']; |
|
| 1119 | - $line = "'cpassman_url' => '" . $anonym_url . "\n"; |
|
| 1118 | + $anonym_url = $tmp['scheme'].'://<anonym_url>'.$tmp['path']; |
|
| 1119 | + $line = "'cpassman_url' => '".$anonym_url."\n"; |
|
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | 1122 | // Anonymize all urls |
@@ -1143,7 +1143,7 @@ discard block |
||
| 1143 | 1143 | $teampass_errors = ''; |
| 1144 | 1144 | $rows = DB::query( |
| 1145 | 1145 | 'SELECT label, date AS error_date |
| 1146 | - FROM ' . prefixTable('log_system') . " |
|
| 1146 | + FROM ' . prefixTable('log_system')." |
|
| 1147 | 1147 | WHERE `type` LIKE 'error' |
| 1148 | 1148 | ORDER BY `date` DESC |
| 1149 | 1149 | LIMIT 0, 10" |
@@ -1151,9 +1151,9 @@ discard block |
||
| 1151 | 1151 | if (DB::count() > 0) { |
| 1152 | 1152 | foreach ($rows as $record) { |
| 1153 | 1153 | if (empty($teampass_errors) === true) { |
| 1154 | - $teampass_errors = ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label']; |
|
| 1154 | + $teampass_errors = ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label']; |
|
| 1155 | 1155 | } else { |
| 1156 | - $teampass_errors .= ' * ' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['error_date']) . ' - ' . $record['label']; |
|
| 1156 | + $teampass_errors .= ' * '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['error_date']).' - '.$record['label']; |
|
| 1157 | 1157 | } |
| 1158 | 1158 | } |
| 1159 | 1159 | } |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | |
| 1163 | 1163 | // Now prepare text |
| 1164 | 1164 | $txt = '### Page on which it happened |
| 1165 | -' . $post_data['current_page'] . ' |
|
| 1165 | +' . $post_data['current_page'].' |
|
| 1166 | 1166 | |
| 1167 | 1167 | ### Steps to reproduce |
| 1168 | 1168 | 1. |
@@ -1177,39 +1177,39 @@ discard block |
||
| 1177 | 1177 | Tell us what happens instead |
| 1178 | 1178 | |
| 1179 | 1179 | ### Server configuration |
| 1180 | -**Operating system**: ' . php_uname() . ' |
|
| 1180 | +**Operating system**: ' . php_uname().' |
|
| 1181 | 1181 | |
| 1182 | -**Web server:** ' . $_SERVER['SERVER_SOFTWARE'] . ' |
|
| 1182 | +**Web server:** ' . $_SERVER['SERVER_SOFTWARE'].' |
|
| 1183 | 1183 | |
| 1184 | -**Database:** ' . ($link === false ? langHdl('undefined') : mysqli_get_server_info($link)) . ' |
|
| 1184 | +**Database:** ' . ($link === false ? langHdl('undefined') : mysqli_get_server_info($link)).' |
|
| 1185 | 1185 | |
| 1186 | -**PHP version:** ' . PHP_VERSION . ' |
|
| 1186 | +**PHP version:** ' . PHP_VERSION.' |
|
| 1187 | 1187 | |
| 1188 | -**Teampass version:** ' . TP_VERSION_FULL . ' |
|
| 1188 | +**Teampass version:** ' . TP_VERSION_FULL.' |
|
| 1189 | 1189 | |
| 1190 | 1190 | **Teampass configuration file:** |
| 1191 | 1191 | ``` |
| 1192 | -' . $list_of_options . ' |
|
| 1192 | +' . $list_of_options.' |
|
| 1193 | 1193 | ``` |
| 1194 | 1194 | |
| 1195 | 1195 | **Updated from an older Teampass or fresh install:** |
| 1196 | 1196 | |
| 1197 | 1197 | ### Client configuration |
| 1198 | 1198 | |
| 1199 | -**Browser:** ' . $post_data['browser_name'] . ' - ' . $post_data['browser_version'] . ' |
|
| 1199 | +**Browser:** ' . $post_data['browser_name'].' - '.$post_data['browser_version'].' |
|
| 1200 | 1200 | |
| 1201 | -**Operating system:** ' . $post_data['os'] . ' - ' . $post_data['os_archi'] . 'bits |
|
| 1201 | +**Operating system:** ' . $post_data['os'].' - '.$post_data['os_archi'].'bits |
|
| 1202 | 1202 | |
| 1203 | 1203 | ### Logs |
| 1204 | 1204 | |
| 1205 | 1205 | #### Web server error log |
| 1206 | 1206 | ``` |
| 1207 | -' . $err['message'] . ' - ' . $err['file'] . ' (' . $err['line'] . ') |
|
| 1207 | +' . $err['message'].' - '.$err['file'].' ('.$err['line'].') |
|
| 1208 | 1208 | ``` |
| 1209 | 1209 | |
| 1210 | 1210 | #### Teampass 10 last system errors |
| 1211 | 1211 | ``` |
| 1212 | -' . $teampass_errors . ' |
|
| 1212 | +' . $teampass_errors.' |
|
| 1213 | 1213 | ``` |
| 1214 | 1214 | |
| 1215 | 1215 | #### Log from the web-browser developer console (CTRL + SHIFT + i) |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | // Check if user exists |
| 1238 | 1238 | $userInfo = DB::queryFirstRow( |
| 1239 | 1239 | 'SELECT public_key, private_key, pw |
| 1240 | - FROM ' . prefixTable('users') . ' |
|
| 1240 | + FROM ' . prefixTable('users').' |
|
| 1241 | 1241 | WHERE id = %i', |
| 1242 | 1242 | $post_user_id |
| 1243 | 1243 | ); |
@@ -1245,14 +1245,14 @@ discard block |
||
| 1245 | 1245 | // Get one item |
| 1246 | 1246 | $record = DB::queryFirstRow( |
| 1247 | 1247 | 'SELECT id, pw |
| 1248 | - FROM ' . prefixTable('items') . ' |
|
| 1248 | + FROM ' . prefixTable('items').' |
|
| 1249 | 1249 | WHERE perso = 0' |
| 1250 | 1250 | ); |
| 1251 | 1251 | |
| 1252 | 1252 | // Get itemKey from current user |
| 1253 | 1253 | $currentUserKey = DB::queryFirstRow( |
| 1254 | 1254 | 'SELECT share_key, increment_id |
| 1255 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1255 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1256 | 1256 | WHERE object_id = %i AND user_id = %i', |
| 1257 | 1257 | $record['id'], |
| 1258 | 1258 | $post_user_id |
@@ -1280,7 +1280,7 @@ discard block |
||
| 1280 | 1280 | |
| 1281 | 1281 | // Use the password check |
| 1282 | 1282 | // load passwordLib library |
| 1283 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1283 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1284 | 1284 | $pwdlib->register(); |
| 1285 | 1285 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1286 | 1286 | |
@@ -1324,7 +1324,7 @@ discard block |
||
| 1324 | 1324 | // Get user info |
| 1325 | 1325 | $userData = DB::queryFirstRow( |
| 1326 | 1326 | 'SELECT private_key |
| 1327 | - FROM ' . prefixTable('users') . ' |
|
| 1327 | + FROM ' . prefixTable('users').' |
|
| 1328 | 1328 | WHERE id = %i', |
| 1329 | 1329 | $post_user_id |
| 1330 | 1330 | ); |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | ); |
| 1352 | 1352 | |
| 1353 | 1353 | // Load superGlobals |
| 1354 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1354 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1355 | 1355 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1356 | 1356 | |
| 1357 | 1357 | $superGlobal->put('private_key', $privateKey, 'SESSION', 'user'); |
@@ -1389,7 +1389,7 @@ discard block |
||
| 1389 | 1389 | // Get user info |
| 1390 | 1390 | $userData = DB::queryFirstRow( |
| 1391 | 1391 | 'SELECT email, auth_type, login |
| 1392 | - FROM ' . prefixTable('users') . ' |
|
| 1392 | + FROM ' . prefixTable('users').' |
|
| 1393 | 1393 | WHERE id = %i', |
| 1394 | 1394 | $post_user_id |
| 1395 | 1395 | ); |
@@ -1523,7 +1523,7 @@ discard block |
||
| 1523 | 1523 | // Get user info |
| 1524 | 1524 | $userData = DB::queryFirstRow( |
| 1525 | 1525 | 'SELECT email, auth_type, login |
| 1526 | - FROM ' . prefixTable('users') . ' |
|
| 1526 | + FROM ' . prefixTable('users').' |
|
| 1527 | 1527 | WHERE id = %i', |
| 1528 | 1528 | $post_user_id |
| 1529 | 1529 | ); |
@@ -1586,13 +1586,13 @@ discard block |
||
| 1586 | 1586 | // Check if user exists |
| 1587 | 1587 | DB::queryFirstRow( |
| 1588 | 1588 | 'SELECT * |
| 1589 | - FROM ' . prefixTable('users') . ' |
|
| 1589 | + FROM ' . prefixTable('users').' |
|
| 1590 | 1590 | WHERE id = %i', |
| 1591 | 1591 | $post_user_id |
| 1592 | 1592 | ); |
| 1593 | 1593 | if (DB::count() > 0) { |
| 1594 | 1594 | // Include libraries |
| 1595 | - include_once $SETTINGS['cpassman_dir'] . '/sources/aes.functions.php'; |
|
| 1595 | + include_once $SETTINGS['cpassman_dir'].'/sources/aes.functions.php'; |
|
| 1596 | 1596 | |
| 1597 | 1597 | // CLear old sharekeys |
| 1598 | 1598 | if ($post_self_change === false) { |
@@ -1644,13 +1644,13 @@ discard block |
||
| 1644 | 1644 | // Check if user exists |
| 1645 | 1645 | $userInfo = DB::queryFirstRow( |
| 1646 | 1646 | 'SELECT public_key |
| 1647 | - FROM ' . prefixTable('users') . ' |
|
| 1647 | + FROM ' . prefixTable('users').' |
|
| 1648 | 1648 | WHERE id = %i', |
| 1649 | 1649 | $post_user_id |
| 1650 | 1650 | ); |
| 1651 | 1651 | if (DB::count() > 0) { |
| 1652 | 1652 | // Include libraries |
| 1653 | - include_once $SETTINGS['cpassman_dir'] . '/sources/aes.functions.php'; |
|
| 1653 | + include_once $SETTINGS['cpassman_dir'].'/sources/aes.functions.php'; |
|
| 1654 | 1654 | |
| 1655 | 1655 | // WHAT STEP TO PERFORM? |
| 1656 | 1656 | if ($post_action === 'step0') { |
@@ -1809,15 +1809,15 @@ discard block |
||
| 1809 | 1809 | // Loop on items |
| 1810 | 1810 | $rows = DB::query( |
| 1811 | 1811 | 'SELECT id, pw |
| 1812 | - FROM ' . prefixTable('items') . ' |
|
| 1812 | + FROM ' . prefixTable('items').' |
|
| 1813 | 1813 | WHERE perso = 0 |
| 1814 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 1814 | + LIMIT ' . $post_start.', '.$post_length |
|
| 1815 | 1815 | ); |
| 1816 | 1816 | foreach ($rows as $record) { |
| 1817 | 1817 | // Get itemKey from current user |
| 1818 | 1818 | $currentUserKey = DB::queryFirstRow( |
| 1819 | 1819 | 'SELECT share_key, increment_id |
| 1820 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1820 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1821 | 1821 | WHERE object_id = %i AND user_id = %i', |
| 1822 | 1822 | $record['id'], |
| 1823 | 1823 | $_SESSION['user_id'] |
@@ -1845,7 +1845,7 @@ discard block |
||
| 1845 | 1845 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 1846 | 1846 | $currentUserKey = DB::queryFirstRow( |
| 1847 | 1847 | 'SELECT increment_id |
| 1848 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1848 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1849 | 1849 | WHERE object_id = %i AND user_id = %i', |
| 1850 | 1850 | $record['id'], |
| 1851 | 1851 | $post_user_id |
@@ -1878,7 +1878,7 @@ discard block |
||
| 1878 | 1878 | // SHould we change step? |
| 1879 | 1879 | DB::query( |
| 1880 | 1880 | 'SELECT * |
| 1881 | - FROM ' . prefixTable('items') . ' |
|
| 1881 | + FROM ' . prefixTable('items').' |
|
| 1882 | 1882 | WHERE perso = 0' |
| 1883 | 1883 | ); |
| 1884 | 1884 | |
@@ -1902,15 +1902,15 @@ discard block |
||
| 1902 | 1902 | // Loop on logs |
| 1903 | 1903 | $rows = DB::query( |
| 1904 | 1904 | 'SELECT increment_id |
| 1905 | - FROM ' . prefixTable('log_items') . ' |
|
| 1905 | + FROM ' . prefixTable('log_items').' |
|
| 1906 | 1906 | WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes" |
| 1907 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 1907 | + LIMIT ' . $post_start.', '.$post_length |
|
| 1908 | 1908 | ); |
| 1909 | 1909 | foreach ($rows as $record) { |
| 1910 | 1910 | // Get itemKey from current user |
| 1911 | 1911 | $currentUserKey = DB::queryFirstRow( |
| 1912 | 1912 | 'SELECT share_key |
| 1913 | - FROM ' . prefixTable('sharekeys_logs') . ' |
|
| 1913 | + FROM ' . prefixTable('sharekeys_logs').' |
|
| 1914 | 1914 | WHERE object_id = %i AND user_id = %i', |
| 1915 | 1915 | $record['increment_id'], |
| 1916 | 1916 | $_SESSION['user_id'] |
@@ -1937,7 +1937,7 @@ discard block |
||
| 1937 | 1937 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 1938 | 1938 | $currentUserKey = DB::queryFirstRow( |
| 1939 | 1939 | 'SELECT increment_id |
| 1940 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1940 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1941 | 1941 | WHERE object_id = %i AND user_id = %i', |
| 1942 | 1942 | $record['id'], |
| 1943 | 1943 | $post_user_id |
@@ -1959,7 +1959,7 @@ discard block |
||
| 1959 | 1959 | // SHould we change step? |
| 1960 | 1960 | DB::query( |
| 1961 | 1961 | 'SELECT increment_id |
| 1962 | - FROM ' . prefixTable('log_items') . ' |
|
| 1962 | + FROM ' . prefixTable('log_items').' |
|
| 1963 | 1963 | WHERE raison LIKE "at_pw :%" AND encryption_type = "teampass_aes"' |
| 1964 | 1964 | ); |
| 1965 | 1965 | |
@@ -1983,15 +1983,15 @@ discard block |
||
| 1983 | 1983 | // Loop on fields |
| 1984 | 1984 | $rows = DB::query( |
| 1985 | 1985 | 'SELECT id |
| 1986 | - FROM ' . prefixTable('categories_items') . ' |
|
| 1986 | + FROM ' . prefixTable('categories_items').' |
|
| 1987 | 1987 | WHERE encryption_type = "teampass_aes" |
| 1988 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 1988 | + LIMIT ' . $post_start.', '.$post_length |
|
| 1989 | 1989 | ); |
| 1990 | 1990 | foreach ($rows as $record) { |
| 1991 | 1991 | // Get itemKey from current user |
| 1992 | 1992 | $currentUserKey = DB::queryFirstRow( |
| 1993 | 1993 | 'SELECT share_key |
| 1994 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 1994 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 1995 | 1995 | WHERE object_id = %i AND user_id = %i', |
| 1996 | 1996 | $record['id'], |
| 1997 | 1997 | $_SESSION['user_id'] |
@@ -2018,7 +2018,7 @@ discard block |
||
| 2018 | 2018 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2019 | 2019 | $currentUserKey = DB::queryFirstRow( |
| 2020 | 2020 | 'SELECT increment_id |
| 2021 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2021 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2022 | 2022 | WHERE object_id = %i AND user_id = %i', |
| 2023 | 2023 | $record['id'], |
| 2024 | 2024 | $post_user_id |
@@ -2040,7 +2040,7 @@ discard block |
||
| 2040 | 2040 | // SHould we change step? |
| 2041 | 2041 | DB::query( |
| 2042 | 2042 | 'SELECT * |
| 2043 | - FROM ' . prefixTable('categories_items') . ' |
|
| 2043 | + FROM ' . prefixTable('categories_items').' |
|
| 2044 | 2044 | WHERE encryption_type = "teampass_aes"' |
| 2045 | 2045 | ); |
| 2046 | 2046 | |
@@ -2064,14 +2064,14 @@ discard block |
||
| 2064 | 2064 | // Loop on suggestions |
| 2065 | 2065 | $rows = DB::query( |
| 2066 | 2066 | 'SELECT id |
| 2067 | - FROM ' . prefixTable('suggestion') . ' |
|
| 2068 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2067 | + FROM ' . prefixTable('suggestion').' |
|
| 2068 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2069 | 2069 | ); |
| 2070 | 2070 | foreach ($rows as $record) { |
| 2071 | 2071 | // Get itemKey from current user |
| 2072 | 2072 | $currentUserKey = DB::queryFirstRow( |
| 2073 | 2073 | 'SELECT share_key |
| 2074 | - FROM ' . prefixTable('sharekeys_suggestions') . ' |
|
| 2074 | + FROM ' . prefixTable('sharekeys_suggestions').' |
|
| 2075 | 2075 | WHERE object_id = %i AND user_id = %i', |
| 2076 | 2076 | $record['id'], |
| 2077 | 2077 | $_SESSION['user_id'] |
@@ -2098,7 +2098,7 @@ discard block |
||
| 2098 | 2098 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2099 | 2099 | $currentUserKey = DB::queryFirstRow( |
| 2100 | 2100 | 'SELECT increment_id |
| 2101 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2101 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2102 | 2102 | WHERE object_id = %i AND user_id = %i', |
| 2103 | 2103 | $record['id'], |
| 2104 | 2104 | $post_user_id |
@@ -2143,15 +2143,15 @@ discard block |
||
| 2143 | 2143 | // Loop on files |
| 2144 | 2144 | $rows = DB::query( |
| 2145 | 2145 | 'SELECT id |
| 2146 | - FROM ' . prefixTable('files') . ' |
|
| 2147 | - WHERE status = "' . TP_ENCRYPTION_NAME . '" |
|
| 2148 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 2146 | + FROM ' . prefixTable('files').' |
|
| 2147 | + WHERE status = "' . TP_ENCRYPTION_NAME.'" |
|
| 2148 | + LIMIT ' . $post_start.', '.$post_length |
|
| 2149 | 2149 | ); //aes_encryption |
| 2150 | 2150 | foreach ($rows as $record) { |
| 2151 | 2151 | // Get itemKey from current user |
| 2152 | 2152 | $currentUserKey = DB::queryFirstRow( |
| 2153 | 2153 | 'SELECT share_key |
| 2154 | - FROM ' . prefixTable('sharekeys_files') . ' |
|
| 2154 | + FROM ' . prefixTable('sharekeys_files').' |
|
| 2155 | 2155 | WHERE object_id = %i AND user_id = %i', |
| 2156 | 2156 | $record['id'], |
| 2157 | 2157 | $_SESSION['user_id'] |
@@ -2178,7 +2178,7 @@ discard block |
||
| 2178 | 2178 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2179 | 2179 | $currentUserKey = DB::queryFirstRow( |
| 2180 | 2180 | 'SELECT increment_id |
| 2181 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2181 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2182 | 2182 | WHERE object_id = %i AND user_id = %i', |
| 2183 | 2183 | $record['id'], |
| 2184 | 2184 | $post_user_id |
@@ -2200,8 +2200,8 @@ discard block |
||
| 2200 | 2200 | // SHould we change step? |
| 2201 | 2201 | DB::query( |
| 2202 | 2202 | 'SELECT * |
| 2203 | - FROM ' . prefixTable('files') . ' |
|
| 2204 | - WHERE status = "' . TP_ENCRYPTION_NAME . '"' |
|
| 2203 | + FROM ' . prefixTable('files').' |
|
| 2204 | + WHERE status = "' . TP_ENCRYPTION_NAME.'"' |
|
| 2205 | 2205 | ); |
| 2206 | 2206 | |
| 2207 | 2207 | $next_start = (int) $post_start + (int) $post_length; |
@@ -2233,16 +2233,16 @@ discard block |
||
| 2233 | 2233 | if (count($_SESSION['personal_folders']) > 0) { |
| 2234 | 2234 | $rows = DB::query( |
| 2235 | 2235 | 'SELECT id, pw |
| 2236 | - FROM ' . prefixTable('items') . ' |
|
| 2236 | + FROM ' . prefixTable('items').' |
|
| 2237 | 2237 | WHERE perso = 1 AND id_tree IN %ls |
| 2238 | - LIMIT ' . $post_start . ', ' . $post_length, |
|
| 2238 | + LIMIT ' . $post_start.', '.$post_length, |
|
| 2239 | 2239 | $_SESSION['personal_folders'] |
| 2240 | 2240 | ); |
| 2241 | 2241 | foreach ($rows as $record) { |
| 2242 | 2242 | // Get itemKey from current user |
| 2243 | 2243 | $currentUserKey = DB::queryFirstRow( |
| 2244 | 2244 | 'SELECT share_key, increment_id |
| 2245 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2245 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2246 | 2246 | WHERE object_id = %i AND user_id = %i', |
| 2247 | 2247 | $record['id'], |
| 2248 | 2248 | $_SESSION['user_id'] |
@@ -2269,7 +2269,7 @@ discard block |
||
| 2269 | 2269 | if ((int) $post_user_id !== (int) $_SESSION['user_id']) { |
| 2270 | 2270 | $currentUserKey = DB::queryFirstRow( |
| 2271 | 2271 | 'SELECT increment_id |
| 2272 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2272 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2273 | 2273 | WHERE object_id = %i AND user_id = %i', |
| 2274 | 2274 | $record['id'], |
| 2275 | 2275 | $post_user_id |
@@ -2292,7 +2292,7 @@ discard block |
||
| 2292 | 2292 | // SHould we change step? |
| 2293 | 2293 | DB::query( |
| 2294 | 2294 | 'SELECT * |
| 2295 | - FROM ' . prefixTable('items') . ' |
|
| 2295 | + FROM ' . prefixTable('items').' |
|
| 2296 | 2296 | WHERE perso = 0' |
| 2297 | 2297 | ); |
| 2298 | 2298 | |
@@ -2316,7 +2316,7 @@ discard block |
||
| 2316 | 2316 | // Check if user exists |
| 2317 | 2317 | $userInfo = DB::queryFirstRow( |
| 2318 | 2318 | 'SELECT public_key, encrypted_psk |
| 2319 | - FROM ' . prefixTable('users') . ' |
|
| 2319 | + FROM ' . prefixTable('users').' |
|
| 2320 | 2320 | WHERE id = %i', |
| 2321 | 2321 | $post_user_id |
| 2322 | 2322 | ); |
@@ -2341,9 +2341,9 @@ discard block |
||
| 2341 | 2341 | // Loop on persoanl items |
| 2342 | 2342 | $rows = DB::query( |
| 2343 | 2343 | 'SELECT id, pw |
| 2344 | - FROM ' . prefixTable('items') . ' |
|
| 2344 | + FROM ' . prefixTable('items').' |
|
| 2345 | 2345 | WHERE perso = 1 AND id_tree IN %ls |
| 2346 | - LIMIT ' . $post_start . ', ' . $post_length, |
|
| 2346 | + LIMIT ' . $post_start.', '.$post_length, |
|
| 2347 | 2347 | $_SESSION['personal_folders'] |
| 2348 | 2348 | ); |
| 2349 | 2349 | $countUserPersonalItems = DB::count(); |
@@ -2386,7 +2386,7 @@ discard block |
||
| 2386 | 2386 | // Loop on files |
| 2387 | 2387 | $rows = DB::query( |
| 2388 | 2388 | 'SELECT id, file |
| 2389 | - FROM ' . prefixTable('files') . ' |
|
| 2389 | + FROM ' . prefixTable('files').' |
|
| 2390 | 2390 | WHERE status != %s |
| 2391 | 2391 | AND id_item = %i', |
| 2392 | 2392 | TP_ENCRYPTION_NAME, |
@@ -2397,14 +2397,14 @@ discard block |
||
| 2397 | 2397 | // Now decrypt the file |
| 2398 | 2398 | prepareFileWithDefuse( |
| 2399 | 2399 | 'decrypt', |
| 2400 | - $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'], |
|
| 2401 | - $SETTINGS['path_to_upload_folder'] . '/' . $record2['file'] . '.delete', |
|
| 2400 | + $SETTINGS['path_to_upload_folder'].'/'.$record2['file'], |
|
| 2401 | + $SETTINGS['path_to_upload_folder'].'/'.$record2['file'].'.delete', |
|
| 2402 | 2402 | $SETTINGS, |
| 2403 | 2403 | $post_user_psk |
| 2404 | 2404 | ); |
| 2405 | 2405 | |
| 2406 | 2406 | // Encrypt the file |
| 2407 | - $encryptedFile = encryptFile($record2['file'] . '.delete', $SETTINGS['path_to_upload_folder']); |
|
| 2407 | + $encryptedFile = encryptFile($record2['file'].'.delete', $SETTINGS['path_to_upload_folder']); |
|
| 2408 | 2408 | |
| 2409 | 2409 | DB::update( |
| 2410 | 2410 | prefixTable('files'), |
@@ -2427,7 +2427,7 @@ discard block |
||
| 2427 | 2427 | ); |
| 2428 | 2428 | |
| 2429 | 2429 | // Unlink original file |
| 2430 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record2['file']); |
|
| 2430 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record2['file']); |
|
| 2431 | 2431 | } |
| 2432 | 2432 | } |
| 2433 | 2433 | } |
@@ -2496,7 +2496,7 @@ discard block |
||
| 2496 | 2496 | // Get user info |
| 2497 | 2497 | $userData = DB::queryFirstRow( |
| 2498 | 2498 | 'SELECT '.$post_fields.' |
| 2499 | - FROM ' . prefixTable('users') . ' |
|
| 2499 | + FROM ' . prefixTable('users').' |
|
| 2500 | 2500 | WHERE id = %i', |
| 2501 | 2501 | $post_user_id |
| 2502 | 2502 | ); |
@@ -2531,7 +2531,7 @@ discard block |
||
| 2531 | 2531 | // Get user info |
| 2532 | 2532 | $userData = DB::queryFirstRow( |
| 2533 | 2533 | 'SELECT auth_type, login, private_key |
| 2534 | - FROM ' . prefixTable('users') . ' |
|
| 2534 | + FROM ' . prefixTable('users').' |
|
| 2535 | 2535 | WHERE id = %i', |
| 2536 | 2536 | $post_user_id |
| 2537 | 2537 | ); |
@@ -2542,7 +2542,7 @@ discard block |
||
| 2542 | 2542 | $privateKey = decryptPrivateKey($post_current_pwd, $userData['private_key']); |
| 2543 | 2543 | |
| 2544 | 2544 | // Load superGlobals |
| 2545 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2545 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2546 | 2546 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2547 | 2547 | |
| 2548 | 2548 | if ($superGlobal->get('private_key', 'SESSION', 'user') === $privateKey) { |
@@ -2575,7 +2575,7 @@ discard block |
||
| 2575 | 2575 | return prepareExchangedData( |
| 2576 | 2576 | array( |
| 2577 | 2577 | 'error' => false, |
| 2578 | - 'message' => langHdl('done'),'', |
|
| 2578 | + 'message' => langHdl('done'), '', |
|
| 2579 | 2579 | ), |
| 2580 | 2580 | 'encode' |
| 2581 | 2581 | ); |
@@ -2613,7 +2613,7 @@ discard block |
||
| 2613 | 2613 | // Get user info |
| 2614 | 2614 | $userData = DB::queryFirstRow( |
| 2615 | 2615 | 'SELECT auth_type, login, private_key, special |
| 2616 | - FROM ' . prefixTable('users') . ' |
|
| 2616 | + FROM ' . prefixTable('users').' |
|
| 2617 | 2617 | WHERE id = %i', |
| 2618 | 2618 | $post_user_id |
| 2619 | 2619 | ); |
@@ -2643,14 +2643,14 @@ discard block |
||
| 2643 | 2643 | ); |
| 2644 | 2644 | |
| 2645 | 2645 | // Load superGlobals |
| 2646 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2646 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2647 | 2647 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2648 | 2648 | $superGlobal->put('private_key', $privateKey, 'SESSION', 'user'); |
| 2649 | 2649 | |
| 2650 | 2650 | return prepareExchangedData( |
| 2651 | 2651 | array( |
| 2652 | 2652 | 'error' => false, |
| 2653 | - 'message' => langHdl('done'),'', |
|
| 2653 | + 'message' => langHdl('done'), '', |
|
| 2654 | 2654 | ), |
| 2655 | 2655 | 'encode' |
| 2656 | 2656 | ); |
@@ -2674,14 +2674,14 @@ discard block |
||
| 2674 | 2674 | // Get one item |
| 2675 | 2675 | $record = DB::queryFirstRow( |
| 2676 | 2676 | 'SELECT id, pw |
| 2677 | - FROM ' . prefixTable('items') . ' |
|
| 2677 | + FROM ' . prefixTable('items').' |
|
| 2678 | 2678 | WHERE perso = 0' |
| 2679 | 2679 | ); |
| 2680 | 2680 | |
| 2681 | 2681 | // Get itemKey from current user |
| 2682 | 2682 | $currentUserKey = DB::queryFirstRow( |
| 2683 | 2683 | 'SELECT share_key, increment_id |
| 2684 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2684 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2685 | 2685 | WHERE object_id = %i AND user_id = %i', |
| 2686 | 2686 | $record['id'], |
| 2687 | 2687 | $post_user_id |
@@ -2709,7 +2709,7 @@ discard block |
||
| 2709 | 2709 | ); |
| 2710 | 2710 | |
| 2711 | 2711 | // Load superGlobals |
| 2712 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2712 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2713 | 2713 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2714 | 2714 | $superGlobal->put('private_key', $privateKey, 'SESSION', 'user'); |
| 2715 | 2715 | |
@@ -2763,7 +2763,7 @@ discard block |
||
| 2763 | 2763 | $_SESSION['user_id'] |
| 2764 | 2764 | ); |
| 2765 | 2765 | // Return data |
| 2766 | - return '[{"new_value":"' . $_SESSION['sessionDuration'] . '"}]'; |
|
| 2766 | + return '[{"new_value":"'.$_SESSION['sessionDuration'].'"}]'; |
|
| 2767 | 2767 | } |
| 2768 | 2768 | |
| 2769 | 2769 | return '[{"new_value":"expired"}]'; |