@@ -44,16 +44,16 @@ 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 | 52 | // Load libraries |
| 53 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 55 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 56 | -include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 53 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 55 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 56 | +include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 57 | 57 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 58 | 58 | |
| 59 | 59 | // Prepare POST variables |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 67 | 67 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 68 | 68 | } |
| 69 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 69 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 70 | 70 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 71 | 71 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 72 | 72 | } |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | defineComplexity(); |
| 89 | 89 | |
| 90 | 90 | // Load superGlobals |
| 91 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 91 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 92 | 92 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 93 | 93 | |
| 94 | 94 | // If Debug then clean the files |
| 95 | 95 | if (DEBUGLDAP === true) { |
| 96 | - define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'] . '/ldap.debug.txt'); |
|
| 96 | + define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'].'/ldap.debug.txt'); |
|
| 97 | 97 | file_put_contents(DEBUGLDAPFILE, ''); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -180,19 +180,19 @@ discard block |
||
| 180 | 180 | if (findTpConfigFile() === false) { |
| 181 | 181 | throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
| 182 | 182 | } |
| 183 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 184 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 185 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 183 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 184 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 185 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 186 | 186 | |
| 187 | 187 | header('Content-type: text/html; charset=utf-8'); |
| 188 | 188 | error_reporting(E_ERROR); |
| 189 | 189 | |
| 190 | 190 | // Load AntiXSS |
| 191 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 191 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 192 | 192 | $antiXss = new voku\helper\AntiXSS(); |
| 193 | 193 | |
| 194 | 194 | // Load superGlobals |
| 195 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 195 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 196 | 196 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 197 | 197 | |
| 198 | 198 | // Prepare GET variables |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $server['PHP_AUTH_PW'] = $superGlobal->get('PHP_AUTH_PW', 'SERVER'); |
| 207 | 207 | |
| 208 | 208 | // connect to the server |
| 209 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 209 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 210 | 210 | DB::$host = DB_HOST; |
| 211 | 211 | DB::$user = DB_USER; |
| 212 | 212 | DB::$password = defined('DB_PASSWD_CLEAR') === false ? defuseReturnDecrypted(DB_PASSWD, $SETTINGS) : DB_PASSWD_CLEAR; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | DB::$ssl = DB_SSL; |
| 217 | 217 | DB::$connect_options = DB_CONNECT_OPTIONS; |
| 218 | 218 | // User's language loading |
| 219 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $sessionUserLanguage . '.php'; |
|
| 219 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$sessionUserLanguage.'.php'; |
|
| 220 | 220 | |
| 221 | 221 | // decrypt and retreive data in JSON format |
| 222 | 222 | if (empty($sessionKey) === true) { |
@@ -232,18 +232,18 @@ discard block |
||
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | // Check if Duo auth is in progress and pass the pw and login back to the standard login process |
| 235 | - if( |
|
| 235 | + if ( |
|
| 236 | 236 | isKeyExistingAndEqual('duo', 1, $SETTINGS) === true |
| 237 | 237 | && $dataReceived['user_2fa_selection'] === 'duo' |
| 238 | - && $superGlobal->get('duo_status','SESSION') === 'IN_PROGRESS' |
|
| 238 | + && $superGlobal->get('duo_status', 'SESSION') === 'IN_PROGRESS' |
|
| 239 | 239 | && !empty($dataReceived['duo_state']) |
| 240 | - ){ |
|
| 240 | + ) { |
|
| 241 | 241 | $key = hash('sha256', $dataReceived['duo_state']); |
| 242 | 242 | $iv = substr(hash('sha256', $dataReceived['duo_state']), 0, 16); |
| 243 | - $duo_data_dec = openssl_decrypt(base64_decode($superGlobal->get('duo_data','SESSION')), 'AES-256-CBC', $key, 0, $iv); |
|
| 243 | + $duo_data_dec = openssl_decrypt(base64_decode($superGlobal->get('duo_data', 'SESSION')), 'AES-256-CBC', $key, 0, $iv); |
|
| 244 | 244 | // Clear the data from the Duo process to continue clean with the standard login process |
| 245 | - $superGlobal->forget('duo_data','SESSION'); |
|
| 246 | - if($duo_data_dec === false){ |
|
| 245 | + $superGlobal->forget('duo_data', 'SESSION'); |
|
| 246 | + if ($duo_data_dec === false) { |
|
| 247 | 247 | echo prepareExchangedData( |
| 248 | 248 | $SETTINGS['cpassman_dir'], |
| 249 | 249 | [ |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | $dataReceived['login'] = $duo_data['duo_login']; |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | - if(isset($dataReceived['pw']) === false || isset($dataReceived['login']) === false) { |
|
| 262 | + if (isset($dataReceived['pw']) === false || isset($dataReceived['login']) === false) { |
|
| 263 | 263 | echo json_encode([ |
| 264 | 264 | 'data' => prepareExchangedData( |
| 265 | 265 | $SETTINGS['cpassman_dir'], |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | } |
| 567 | 567 | // Append with roles from AD groups |
| 568 | 568 | if (is_null($userInfo['roles_from_ad_groups']) === false) { |
| 569 | - $userInfo['fonction_id'] = empty($userInfo['fonction_id']) === true ? $userInfo['roles_from_ad_groups'] : $userInfo['fonction_id']. ';' . $userInfo['roles_from_ad_groups']; |
|
| 569 | + $userInfo['fonction_id'] = empty($userInfo['fonction_id']) === true ? $userInfo['roles_from_ad_groups'] : $userInfo['fonction_id'].';'.$userInfo['roles_from_ad_groups']; |
|
| 570 | 570 | } |
| 571 | 571 | // store |
| 572 | 572 | $superGlobal->put('fonction_id', $userInfo['fonction_id'], 'SESSION'); |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | if (count($superGlobal->get('user_roles', 'SESSION')) > 0) { |
| 578 | 578 | $rolesList = DB::query( |
| 579 | 579 | 'SELECT id, title, complexity |
| 580 | - FROM ' . prefixTable('roles_title') . ' |
|
| 580 | + FROM ' . prefixTable('roles_title').' |
|
| 581 | 581 | WHERE id IN %li', |
| 582 | 582 | $superGlobal->get('user_roles', 'SESSION') |
| 583 | 583 | ); |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | |
| 601 | 601 | // build complete array of roles |
| 602 | 602 | $superGlobal->put('arr_roles_full', [], 'SESSION'); |
| 603 | - $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC'); |
|
| 603 | + $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC'); |
|
| 604 | 604 | foreach ($rows as $record) { |
| 605 | 605 | $superGlobal->put( |
| 606 | 606 | $record['id'], |
@@ -667,10 +667,10 @@ discard block |
||
| 667 | 667 | $superGlobal->put('latest_items_tab', [], 'SESSION'); |
| 668 | 668 | $superGlobal->put('nb_roles', 0, 'SESSION'); |
| 669 | 669 | foreach ($superGlobal->get('latest_items', 'SESSION') as $item) { |
| 670 | - if (! empty($item)) { |
|
| 670 | + if (!empty($item)) { |
|
| 671 | 671 | $dataLastItems = DB::queryFirstRow( |
| 672 | 672 | 'SELECT id,label,id_tree |
| 673 | - FROM ' . prefixTable('items') . ' |
|
| 673 | + FROM ' . prefixTable('items').' |
|
| 674 | 674 | WHERE id=%i', |
| 675 | 675 | $item |
| 676 | 676 | ); |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | [ |
| 680 | 680 | 'id' => $item, |
| 681 | 681 | 'label' => $dataLastItems['label'], |
| 682 | - 'url' => 'index.php?page=items&group=' . $dataLastItems['id_tree'] . '&id=' . $item, |
|
| 682 | + 'url' => 'index.php?page=items&group='.$dataLastItems['id_tree'].'&id='.$item, |
|
| 683 | 683 | ], |
| 684 | 684 | 'SESSION', |
| 685 | 685 | 'latest_items_tab' |
@@ -695,12 +695,12 @@ discard block |
||
| 695 | 695 | ) { |
| 696 | 696 | // get all Admin users |
| 697 | 697 | $receivers = ''; |
| 698 | - $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1); |
|
| 698 | + $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1); |
|
| 699 | 699 | foreach ($rows as $record) { |
| 700 | 700 | if (empty($receivers)) { |
| 701 | 701 | $receivers = $record['email']; |
| 702 | 702 | } else { |
| 703 | - $receivers = ',' . $record['email']; |
|
| 703 | + $receivers = ','.$record['email']; |
|
| 704 | 704 | } |
| 705 | 705 | } |
| 706 | 706 | // Add email to table |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | '#tp_time#', |
| 717 | 717 | ], |
| 718 | 718 | [ |
| 719 | - ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')', |
|
| 719 | + ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')', |
|
| 720 | 720 | date($SETTINGS['date_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
| 721 | 721 | date($SETTINGS['time_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
| 722 | 722 | ], |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | { |
| 870 | 870 | $rows = DB::query( |
| 871 | 871 | 'SELECT date |
| 872 | - FROM ' . prefixTable('log_system') . " |
|
| 872 | + FROM ' . prefixTable('log_system')." |
|
| 873 | 873 | WHERE field_1 = %s |
| 874 | 874 | AND type = 'failed_auth' |
| 875 | 875 | AND label = 'password_is_not_correct' |
@@ -883,7 +883,7 @@ discard block |
||
| 883 | 883 | foreach ($rows as $record) { |
| 884 | 884 | array_push( |
| 885 | 885 | $arrAttempts, |
| 886 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) |
|
| 886 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']) |
|
| 887 | 887 | ); |
| 888 | 888 | } |
| 889 | 889 | } |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | $ldapConnection |
| 938 | 938 | ) : bool |
| 939 | 939 | { |
| 940 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 940 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 941 | 941 | |
| 942 | 942 | if ((int) $userInfoDisabled === 1) { |
| 943 | 943 | return false; |
@@ -1129,45 +1129,45 @@ discard block |
||
| 1129 | 1129 | function authenticateThroughAD(string $username, array $userInfo, string $passwordClear, array $SETTINGS): array |
| 1130 | 1130 | { |
| 1131 | 1131 | // Load expected libraries |
| 1132 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
| 1133 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Support/Arrayable.php'; |
|
| 1134 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
| 1135 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 1136 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
| 1137 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 1138 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
| 1139 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
| 1140 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
| 1141 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
| 1142 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 1143 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php'; |
|
| 1144 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php'; |
|
| 1145 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 1146 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php'; |
|
| 1147 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 1148 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 1149 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 1150 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 1151 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 1152 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php'; |
|
| 1153 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 1154 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 1155 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 1156 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 1157 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 1158 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 1159 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 1160 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 1161 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 1162 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 1163 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php'; |
|
| 1164 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 1165 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php'; |
|
| 1166 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 1167 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php'; |
|
| 1168 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 1169 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/HandlesConnection.php'; |
|
| 1170 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php'; |
|
| 1132 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
| 1133 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Support/Arrayable.php'; |
|
| 1134 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
| 1135 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 1136 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
| 1137 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 1138 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
| 1139 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
| 1140 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
| 1141 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
| 1142 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 1143 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php'; |
|
| 1144 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php'; |
|
| 1145 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 1146 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php'; |
|
| 1147 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 1148 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 1149 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 1150 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 1151 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 1152 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php'; |
|
| 1153 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 1154 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 1155 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 1156 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 1157 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 1158 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 1159 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 1160 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 1161 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 1162 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 1163 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php'; |
|
| 1164 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 1165 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php'; |
|
| 1166 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 1167 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php'; |
|
| 1168 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 1169 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/HandlesConnection.php'; |
|
| 1170 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php'; |
|
| 1171 | 1171 | $ad = new SplClassLoader('LdapRecord', '../includes/libraries'); |
| 1172 | 1172 | $ad->register(); |
| 1173 | 1173 | |
@@ -1204,7 +1204,7 @@ discard block |
||
| 1204 | 1204 | // Get user info from AD |
| 1205 | 1205 | // We want to isolate attribute ldap_user_attribute |
| 1206 | 1206 | $userADInfos = $connection->query() |
| 1207 | - ->where((isset($SETTINGS['ldap_user_attribute']) ===true && empty($SETTINGS['ldap_user_attribute']) === false) ? strtolower($SETTINGS['ldap_user_attribute']) : 'distinguishedname', '=', $username) |
|
| 1207 | + ->where((isset($SETTINGS['ldap_user_attribute']) === true && empty($SETTINGS['ldap_user_attribute']) === false) ? strtolower($SETTINGS['ldap_user_attribute']) : 'distinguishedname', '=', $username) |
|
| 1208 | 1208 | ->firstOrFail(); |
| 1209 | 1209 | |
| 1210 | 1210 | // Check shadowexpire attribute - if === 1 then user disabled |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | $error = $e->getDetailedError(); |
| 1239 | 1239 | return [ |
| 1240 | 1240 | 'error' => true, |
| 1241 | - 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage(), |
|
| 1241 | + 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage(), |
|
| 1242 | 1242 | |
| 1243 | 1243 | ]; |
| 1244 | 1244 | } |
@@ -1267,7 +1267,7 @@ discard block |
||
| 1267 | 1267 | // prepapre background tasks for item keys generation |
| 1268 | 1268 | $val = DB::queryFirstRow( |
| 1269 | 1269 | 'SELECT valeur |
| 1270 | - FROM ' . prefixTable('misc') . ' |
|
| 1270 | + FROM ' . prefixTable('misc').' |
|
| 1271 | 1271 | WHERE type = %s AND intitule = %s', |
| 1272 | 1272 | 'secret', |
| 1273 | 1273 | 'pwd' |
@@ -1281,8 +1281,8 @@ discard block |
||
| 1281 | 1281 | 'process_type' => 'create_user_keys', |
| 1282 | 1282 | 'arguments' => json_encode([ |
| 1283 | 1283 | 'new_user_id' => (int) $userInfo['id'], |
| 1284 | - 'new_user_pwd' => cryption($passwordClear, '','encrypt', $SETTINGS)['string'], |
|
| 1285 | - 'new_user_code' => cryption(uniqidReal(20), '','encrypt', $SETTINGS)['string'], |
|
| 1284 | + 'new_user_pwd' => cryption($passwordClear, '', 'encrypt', $SETTINGS)['string'], |
|
| 1285 | + 'new_user_code' => cryption(uniqidReal(20), '', 'encrypt', $SETTINGS)['string'], |
|
| 1286 | 1286 | 'owner_id' => (int) $_SESSION['user_id'], |
| 1287 | 1287 | 'creator_pwd' => $val['valeur'], |
| 1288 | 1288 | ]), |
@@ -1435,12 +1435,12 @@ discard block |
||
| 1435 | 1435 | if (isset($SETTINGS['enable_ad_users_with_ad_groups']) === true && (int) $SETTINGS['enable_ad_users_with_ad_groups'] === 1) { |
| 1436 | 1436 | // Get user groups from AD |
| 1437 | 1437 | $user_ad_groups = []; |
| 1438 | - foreach($groups as $group) { |
|
| 1438 | + foreach ($groups as $group) { |
|
| 1439 | 1439 | //print_r($group); |
| 1440 | 1440 | // get relation role id for AD group |
| 1441 | 1441 | $role = DB::queryFirstRow( |
| 1442 | 1442 | 'SELECT lgr.role_id |
| 1443 | - FROM ' . prefixTable('ldap_groups_roles') . ' AS lgr |
|
| 1443 | + FROM ' . prefixTable('ldap_groups_roles').' AS lgr |
|
| 1444 | 1444 | WHERE lgr.ldap_group_id = %i', |
| 1445 | 1445 | $group |
| 1446 | 1446 | ); |
@@ -1490,7 +1490,7 @@ discard block |
||
| 1490 | 1490 | ): void |
| 1491 | 1491 | { |
| 1492 | 1492 | // load passwordLib library |
| 1493 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1493 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1494 | 1494 | $pwdlib->register(); |
| 1495 | 1495 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1496 | 1496 | $hashedPassword = $pwdlib->createPasswordHash($passwordClear); |
@@ -1543,7 +1543,7 @@ discard block |
||
| 1543 | 1543 | function yubicoMFACheck($dataReceived, string $userInfo, array $SETTINGS): array |
| 1544 | 1544 | { |
| 1545 | 1545 | // Load superGlobals |
| 1546 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1546 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1547 | 1547 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1548 | 1548 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
| 1549 | 1549 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
@@ -1582,7 +1582,7 @@ discard block |
||
| 1582 | 1582 | } |
| 1583 | 1583 | |
| 1584 | 1584 | // Now check yubico validity |
| 1585 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 1585 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 1586 | 1586 | $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key); |
| 1587 | 1587 | $auth = $yubi->verify($yubico_key); |
| 1588 | 1588 | //, null, null, null, 60 |
@@ -1623,7 +1623,7 @@ discard block |
||
| 1623 | 1623 | $userKeys = generateUserKeys($passwordClear); |
| 1624 | 1624 | |
| 1625 | 1625 | // load passwordLib library |
| 1626 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1626 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1627 | 1627 | $pwdlib->register(); |
| 1628 | 1628 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1629 | 1629 | $hashedPassword = $pwdlib->createPasswordHash($passwordClear); |
@@ -1681,7 +1681,7 @@ discard block |
||
| 1681 | 1681 | ] |
| 1682 | 1682 | ); |
| 1683 | 1683 | // Rebuild tree |
| 1684 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1684 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1685 | 1685 | $tree->register(); |
| 1686 | 1686 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1687 | 1687 | $tree->rebuild(); |
@@ -1713,13 +1713,13 @@ discard block |
||
| 1713 | 1713 | && empty($dataReceived['GACode']) === false |
| 1714 | 1714 | ) { |
| 1715 | 1715 | // Load superGlobals |
| 1716 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1716 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1717 | 1717 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1718 | 1718 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
| 1719 | 1719 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
| 1720 | 1720 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
| 1721 | 1721 | // load library |
| 1722 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 1722 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 1723 | 1723 | // create new instance |
| 1724 | 1724 | $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']); |
| 1725 | 1725 | // Init |
@@ -1742,7 +1742,7 @@ discard block |
||
| 1742 | 1742 | $mfaMessage = langHdl('ga_flash_qr_and_login'); |
| 1743 | 1743 | // generate new QR |
| 1744 | 1744 | $new_2fa_qr = $tfa->getQRCodeImageAsDataUri( |
| 1745 | - 'Teampass - ' . $username, |
|
| 1745 | + 'Teampass - '.$username, |
|
| 1746 | 1746 | $userInfo['ga'] |
| 1747 | 1747 | ); |
| 1748 | 1748 | // clear temporary code from DB |
@@ -1755,7 +1755,7 @@ discard block |
||
| 1755 | 1755 | $userInfo['id'] |
| 1756 | 1756 | ); |
| 1757 | 1757 | $firstTime = [ |
| 1758 | - 'value' => '<img src="' . $new_2fa_qr . '">', |
|
| 1758 | + 'value' => '<img src="'.$new_2fa_qr.'">', |
|
| 1759 | 1759 | 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '', |
| 1760 | 1760 | 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '', |
| 1761 | 1761 | 'pwd_attempts' => (int) $sessionPwdAttempts, |
@@ -1810,12 +1810,12 @@ discard block |
||
| 1810 | 1810 | ): array |
| 1811 | 1811 | { |
| 1812 | 1812 | // Load superGlobals |
| 1813 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1813 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1814 | 1814 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1815 | 1815 | |
| 1816 | 1816 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
| 1817 | - $saved_state = null !== $superGlobal->get('duo_state','SESSION') ? $superGlobal->get('duo_state','SESSION') : ''; |
|
| 1818 | - $duo_status = null !== $superGlobal->get('duo_status','SESSION') ? $superGlobal->get('duo_status','SESSION') : ''; |
|
| 1817 | + $saved_state = null !== $superGlobal->get('duo_state', 'SESSION') ? $superGlobal->get('duo_state', 'SESSION') : ''; |
|
| 1818 | + $duo_status = null !== $superGlobal->get('duo_status', 'SESSION') ? $superGlobal->get('duo_status', 'SESSION') : ''; |
|
| 1819 | 1819 | |
| 1820 | 1820 | // Ensure state and login are set |
| 1821 | 1821 | if ( |
@@ -1873,7 +1873,7 @@ discard block |
||
| 1873 | 1873 | ): array |
| 1874 | 1874 | { |
| 1875 | 1875 | // Load superGlobals |
| 1876 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1876 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1877 | 1877 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1878 | 1878 | |
| 1879 | 1879 | // load libraries |
@@ -1919,7 +1919,7 @@ discard block |
||
| 1919 | 1919 | }*/ |
| 1920 | 1920 | return [ |
| 1921 | 1921 | 'error' => true, |
| 1922 | - 'message' => $duo_error . langHdl('duo_error_check_config'), |
|
| 1922 | + 'message' => $duo_error.langHdl('duo_error_check_config'), |
|
| 1923 | 1923 | 'pwd_attempts' => (int) $sessionPwdAttempts, |
| 1924 | 1924 | 'debug_message' => $e->getMessage(), |
| 1925 | 1925 | 'proceedIdentification' => false, |
@@ -1935,7 +1935,7 @@ discard block |
||
| 1935 | 1935 | } catch (Duo\DuoUniversal\DuoException $e) { |
| 1936 | 1936 | return [ |
| 1937 | 1937 | 'error' => true, |
| 1938 | - 'message' => $duo_error . langHdl('duo_error_url'), |
|
| 1938 | + 'message' => $duo_error.langHdl('duo_error_url'), |
|
| 1939 | 1939 | 'pwd_attempts' => (int) $sessionPwdAttempts, |
| 1940 | 1940 | 'debug_message' => $e->getMessage(), |
| 1941 | 1941 | 'proceedIdentification' => false, |
@@ -1943,7 +1943,7 @@ discard block |
||
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | 1945 | // Somethimes Duo return success but fail to return a URL, double check if the URL has been created |
| 1946 | - if (!empty($duo_redirect_url) && isset($duo_redirect_url) && filter_var($duo_redirect_url,FILTER_SANITIZE_URL)) { |
|
| 1946 | + if (!empty($duo_redirect_url) && isset($duo_redirect_url) && filter_var($duo_redirect_url, FILTER_SANITIZE_URL)) { |
|
| 1947 | 1947 | // Since Duo Universal requires a redirect, let's store some info when the user get's back after completing the Duo prompt |
| 1948 | 1948 | $key = hash('sha256', $duo_state); |
| 1949 | 1949 | $iv = substr(hash('sha256', $duo_state), 0, 16); |
@@ -1969,7 +1969,7 @@ discard block |
||
| 1969 | 1969 | } else { |
| 1970 | 1970 | return [ |
| 1971 | 1971 | 'error' => true, |
| 1972 | - 'message' => $duo_error . langHdl('duo_error_url'), |
|
| 1972 | + 'message' => $duo_error.langHdl('duo_error_url'), |
|
| 1973 | 1973 | 'pwd_attempts' => (int) $sessionPwdAttempts, |
| 1974 | 1974 | 'proceedIdentification' => false, |
| 1975 | 1975 | ]; |
@@ -1990,8 +1990,8 @@ discard block |
||
| 1990 | 1990 | // return the response (which should be the user name) |
| 1991 | 1991 | if ($decoded_token['preferred_username'] === $username) { |
| 1992 | 1992 | $superGlobal->put('duo_status', 'COMPLET', 'SESSION'); |
| 1993 | - $superGlobal->forget('duo_state','SESSION'); |
|
| 1994 | - $superGlobal->forget('duo_data','SESSION'); |
|
| 1993 | + $superGlobal->forget('duo_state', 'SESSION'); |
|
| 1994 | + $superGlobal->forget('duo_data', 'SESSION'); |
|
| 1995 | 1995 | unset($superGlobal); |
| 1996 | 1996 | |
| 1997 | 1997 | return [ |
@@ -2002,9 +2002,9 @@ discard block |
||
| 2002 | 2002 | ]; |
| 2003 | 2003 | } else { |
| 2004 | 2004 | // Something wrong, username from the original Duo request is different than the one received now |
| 2005 | - $superGlobal->forget('duo_status','SESSION'); |
|
| 2006 | - $superGlobal->forget('duo_state','SESSION'); |
|
| 2007 | - $superGlobal->forget('duo_data','SESSION'); |
|
| 2005 | + $superGlobal->forget('duo_status', 'SESSION'); |
|
| 2006 | + $superGlobal->forget('duo_state', 'SESSION'); |
|
| 2007 | + $superGlobal->forget('duo_data', 'SESSION'); |
|
| 2008 | 2008 | unset($superGlobal); |
| 2009 | 2009 | |
| 2010 | 2010 | return [ |
@@ -2016,9 +2016,9 @@ discard block |
||
| 2016 | 2016 | } |
| 2017 | 2017 | } |
| 2018 | 2018 | // If we are here something wrong |
| 2019 | - $superGlobal->forget('duo_status','SESSION'); |
|
| 2020 | - $superGlobal->forget('duo_state','SESSION'); |
|
| 2021 | - $superGlobal->forget('duo_data','SESSION'); |
|
| 2019 | + $superGlobal->forget('duo_status', 'SESSION'); |
|
| 2020 | + $superGlobal->forget('duo_state', 'SESSION'); |
|
| 2021 | + $superGlobal->forget('duo_data', 'SESSION'); |
|
| 2022 | 2022 | unset($superGlobal); |
| 2023 | 2023 | return [ |
| 2024 | 2024 | 'error' => true, |
@@ -2044,8 +2044,8 @@ discard block |
||
| 2044 | 2044 | // Set to false |
| 2045 | 2045 | $userPasswordVerified = false; |
| 2046 | 2046 | // load passwordLib library |
| 2047 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 2048 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 2047 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 2048 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 2049 | 2049 | $pwdlib->register(); |
| 2050 | 2050 | $pwdlib = new PasswordLib\PasswordLib(); |
| 2051 | 2051 | // Check if old encryption used |
@@ -2178,8 +2178,8 @@ discard block |
||
| 2178 | 2178 | public function get_user_info($login, $enable_ad_user_auto_creation) { |
| 2179 | 2179 | $data = DB::queryFirstRow( |
| 2180 | 2180 | 'SELECT u.*, a.value AS api_key |
| 2181 | - FROM ' . prefixTable('users') . ' AS u |
|
| 2182 | - LEFT JOIN ' . prefixTable('api') . ' AS a ON (u.id = a.user_id) |
|
| 2181 | + FROM ' . prefixTable('users').' AS u |
|
| 2182 | + LEFT JOIN ' . prefixTable('api').' AS a ON (u.id = a.user_id) |
|
| 2183 | 2183 | WHERE login = %s', |
| 2184 | 2184 | $login |
| 2185 | 2185 | ); |
@@ -2199,7 +2199,7 @@ discard block |
||
| 2199 | 2199 | }*/ |
| 2200 | 2200 | |
| 2201 | 2201 | // Prepare user roles (fonction_id + roles_from_ad_groups) |
| 2202 | - $data['fonction_id'] = is_null($data['roles_from_ad_groups']) === true ? $data['fonction_id'] : (empty($data['roles_from_ad_groups']) === true ? $data['fonction_id'] : $data['fonction_id'] . ';' . $data['roles_from_ad_groups']); |
|
| 2202 | + $data['fonction_id'] = is_null($data['roles_from_ad_groups']) === true ? $data['fonction_id'] : (empty($data['roles_from_ad_groups']) === true ? $data['fonction_id'] : $data['fonction_id'].';'.$data['roles_from_ad_groups']); |
|
| 2203 | 2203 | |
| 2204 | 2204 | return $data; |
| 2205 | 2205 | } |
@@ -2278,7 +2278,7 @@ discard block |
||
| 2278 | 2278 | $checks->get_is_too_much_attempts($sessionPwdAttempts); |
| 2279 | 2279 | } catch (Exception $e) { |
| 2280 | 2280 | // Load superGlobals |
| 2281 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2281 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2282 | 2282 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2283 | 2283 | $superGlobal->put('next_possible_pwd_attempts', time() + 10, 'SESSION'); |
| 2284 | 2284 | $superGlobal->put('pwd_attempts', 0, 'SESSION'); |
@@ -2524,19 +2524,19 @@ discard block |
||
| 2524 | 2524 | if ($ret['error'] !== false) { |
| 2525 | 2525 | logEvents($SETTINGS, 'failed_auth', 'bad_duo_mfa', '', stripslashes($username), stripslashes($username)); |
| 2526 | 2526 | // Load superGlobals |
| 2527 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2527 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2528 | 2528 | # Retrieve the previously stored state and username from the session |
| 2529 | 2529 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2530 | - $superGlobal->forget('duo_state','SESSION'); |
|
| 2531 | - $superGlobal->forget('duo_data','SESSION'); |
|
| 2532 | - $superGlobal->forget('duo_status','SESSION'); |
|
| 2530 | + $superGlobal->forget('duo_state', 'SESSION'); |
|
| 2531 | + $superGlobal->forget('duo_data', 'SESSION'); |
|
| 2532 | + $superGlobal->forget('duo_status', 'SESSION'); |
|
| 2533 | 2533 | unset($superGlobal); |
| 2534 | 2534 | return [ |
| 2535 | 2535 | 'error' => true, |
| 2536 | 2536 | 'mfaData' => $ret, |
| 2537 | 2537 | 'mfaQRCodeInfos' => false, |
| 2538 | 2538 | ]; |
| 2539 | - } else if ($ret['duo_url_ready'] === true){ |
|
| 2539 | + } else if ($ret['duo_url_ready'] === true) { |
|
| 2540 | 2540 | return [ |
| 2541 | 2541 | 'error' => false, |
| 2542 | 2542 | 'mfaData' => $ret, |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | * |
| 23 | 23 | * @see https://www.teampass.net |
| 24 | 24 | */ |
| 25 | -require_once API_ROOT_PATH . "/Model/Database.php"; |
|
| 25 | +require_once API_ROOT_PATH."/Model/Database.php"; |
|
| 26 | 26 | |
| 27 | 27 | class FolderModel extends Database |
| 28 | 28 | { |
| 29 | 29 | public function getFoldersInfo(array $foldersId): array |
| 30 | 30 | { |
| 31 | - $rows = $this->select( "SELECT id, title FROM " . prefixTable('nested_tree') . " WHERE nlevel=1" ); |
|
| 31 | + $rows = $this->select("SELECT id, title FROM ".prefixTable('nested_tree')." WHERE nlevel=1"); |
|
| 32 | 32 | |
| 33 | 33 | $ret = []; |
| 34 | 34 | |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | private function getFoldersChildren(int $parentId, array $foldersId): array |
| 56 | 56 | { |
| 57 | 57 | $ret = []; |
| 58 | - $childrens = $this->select('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE parent_id=' . $parentId); |
|
| 58 | + $childrens = $this->select('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE parent_id='.$parentId); |
|
| 59 | 59 | |
| 60 | - if ( count($childrens) > 0) { |
|
| 60 | + if (count($childrens) > 0) { |
|
| 61 | 61 | foreach ($childrens as $children) { |
| 62 | 62 | $isVisible = in_array((int) $children['id'], $foldersId); |
| 63 | 63 | $childs = $this->getFoldersChildren($children['id'], $foldersId); |