|
@@ -44,16 +44,16 @@ discard block |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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/anti-xss-master/src/voku/helper/AntiXSS.php'; |
|
|
191
|
+ include_once $SETTINGS['cpassman_dir'].'/includes/libraries/anti-xss-master/src/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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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 |
|
|
block discarded – undo |
|
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'], |
|
@@ -567,7 +567,7 @@ discard block |
|
|
block discarded – undo |
|
567
|
567
|
} |
|
568
|
568
|
// Append with roles from AD groups |
|
569
|
569
|
if (is_null($userInfo['roles_from_ad_groups']) === false) { |
|
570
|
|
- $userInfo['fonction_id'] = empty($userInfo['fonction_id']) === true ? $userInfo['roles_from_ad_groups'] : $userInfo['fonction_id']. ';' . $userInfo['roles_from_ad_groups']; |
|
|
570
|
+ $userInfo['fonction_id'] = empty($userInfo['fonction_id']) === true ? $userInfo['roles_from_ad_groups'] : $userInfo['fonction_id'].';'.$userInfo['roles_from_ad_groups']; |
|
571
|
571
|
} |
|
572
|
572
|
// store |
|
573
|
573
|
$superGlobal->put('fonction_id', $userInfo['fonction_id'], 'SESSION'); |
|
@@ -578,7 +578,7 @@ discard block |
|
|
block discarded – undo |
|
578
|
578
|
if (count($superGlobal->get('user_roles', 'SESSION')) > 0) { |
|
579
|
579
|
$rolesList = DB::query( |
|
580
|
580
|
'SELECT id, title, complexity |
|
581
|
|
- FROM ' . prefixTable('roles_title') . ' |
|
|
581
|
+ FROM ' . prefixTable('roles_title').' |
|
582
|
582
|
WHERE id IN %li', |
|
583
|
583
|
$superGlobal->get('user_roles', 'SESSION') |
|
584
|
584
|
); |
|
@@ -601,7 +601,7 @@ discard block |
|
|
block discarded – undo |
|
601
|
601
|
|
|
602
|
602
|
// build complete array of roles |
|
603
|
603
|
$superGlobal->put('arr_roles_full', [], 'SESSION'); |
|
604
|
|
- $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC'); |
|
|
604
|
+ $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC'); |
|
605
|
605
|
foreach ($rows as $record) { |
|
606
|
606
|
$superGlobal->put( |
|
607
|
607
|
$record['id'], |
|
@@ -668,10 +668,10 @@ discard block |
|
|
block discarded – undo |
|
668
|
668
|
$superGlobal->put('latest_items_tab', [], 'SESSION'); |
|
669
|
669
|
$superGlobal->put('nb_roles', 0, 'SESSION'); |
|
670
|
670
|
foreach ($superGlobal->get('latest_items', 'SESSION') as $item) { |
|
671
|
|
- if (! empty($item)) { |
|
|
671
|
+ if (!empty($item)) { |
|
672
|
672
|
$dataLastItems = DB::queryFirstRow( |
|
673
|
673
|
'SELECT id,label,id_tree |
|
674
|
|
- FROM ' . prefixTable('items') . ' |
|
|
674
|
+ FROM ' . prefixTable('items').' |
|
675
|
675
|
WHERE id=%i', |
|
676
|
676
|
$item |
|
677
|
677
|
); |
|
@@ -680,7 +680,7 @@ discard block |
|
|
block discarded – undo |
|
680
|
680
|
[ |
|
681
|
681
|
'id' => $item, |
|
682
|
682
|
'label' => $dataLastItems['label'], |
|
683
|
|
- 'url' => 'index.php?page=items&group=' . $dataLastItems['id_tree'] . '&id=' . $item, |
|
|
683
|
+ 'url' => 'index.php?page=items&group='.$dataLastItems['id_tree'].'&id='.$item, |
|
684
|
684
|
], |
|
685
|
685
|
'SESSION', |
|
686
|
686
|
'latest_items_tab' |
|
@@ -696,12 +696,12 @@ discard block |
|
|
block discarded – undo |
|
696
|
696
|
) { |
|
697
|
697
|
// get all Admin users |
|
698
|
698
|
$receivers = ''; |
|
699
|
|
- $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1); |
|
|
699
|
+ $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1); |
|
700
|
700
|
foreach ($rows as $record) { |
|
701
|
701
|
if (empty($receivers)) { |
|
702
|
702
|
$receivers = $record['email']; |
|
703
|
703
|
} else { |
|
704
|
|
- $receivers = ',' . $record['email']; |
|
|
704
|
+ $receivers = ','.$record['email']; |
|
705
|
705
|
} |
|
706
|
706
|
} |
|
707
|
707
|
// Add email to table |
|
@@ -717,7 +717,7 @@ discard block |
|
|
block discarded – undo |
|
717
|
717
|
'#tp_time#', |
|
718
|
718
|
], |
|
719
|
719
|
[ |
|
720
|
|
- ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')', |
|
|
720
|
+ ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')', |
|
721
|
721
|
date($SETTINGS['date_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
|
722
|
722
|
date($SETTINGS['time_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
|
723
|
723
|
], |
|
@@ -870,7 +870,7 @@ discard block |
|
|
block discarded – undo |
|
870
|
870
|
{ |
|
871
|
871
|
$rows = DB::query( |
|
872
|
872
|
'SELECT date |
|
873
|
|
- FROM ' . prefixTable('log_system') . " |
|
|
873
|
+ FROM ' . prefixTable('log_system')." |
|
874
|
874
|
WHERE field_1 = %s |
|
875
|
875
|
AND type = 'failed_auth' |
|
876
|
876
|
AND label = 'password_is_not_correct' |
|
@@ -884,7 +884,7 @@ discard block |
|
|
block discarded – undo |
|
884
|
884
|
foreach ($rows as $record) { |
|
885
|
885
|
array_push( |
|
886
|
886
|
$arrAttempts, |
|
887
|
|
- date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) |
|
|
887
|
+ date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']) |
|
888
|
888
|
); |
|
889
|
889
|
} |
|
890
|
890
|
} |
|
@@ -938,7 +938,7 @@ discard block |
|
|
block discarded – undo |
|
938
|
938
|
$ldapConnection |
|
939
|
939
|
) : bool |
|
940
|
940
|
{ |
|
941
|
|
- include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
|
941
|
+ include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
942
|
942
|
|
|
943
|
943
|
if ((int) $userInfoDisabled === 1) { |
|
944
|
944
|
return false; |
|
@@ -1130,45 +1130,45 @@ discard block |
|
|
block discarded – undo |
|
1130
|
1130
|
function authenticateThroughAD(string $username, array $userInfo, string $passwordClear, array $SETTINGS): array |
|
1131
|
1131
|
{ |
|
1132
|
1132
|
// Load expected libraries |
|
1133
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
1134
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Support/Arrayable.php'; |
|
1135
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
1136
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
1137
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
1138
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
1139
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
1140
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
1141
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
1142
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
1143
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
1144
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php'; |
|
1145
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php'; |
|
1146
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
1147
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php'; |
|
1148
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
1149
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php'; |
|
1150
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
1151
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php'; |
|
1152
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php'; |
|
1153
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php'; |
|
1154
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php'; |
|
1155
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php'; |
|
1156
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
1157
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php'; |
|
1158
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php'; |
|
1159
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php'; |
|
1160
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php'; |
|
1161
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php'; |
|
1162
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php'; |
|
1163
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
1164
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php'; |
|
1165
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php'; |
|
1166
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php'; |
|
1167
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
1168
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php'; |
|
1169
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php'; |
|
1170
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/HandlesConnection.php'; |
|
1171
|
|
- require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php'; |
|
|
1133
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
|
1134
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Support/Arrayable.php'; |
|
|
1135
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
|
1136
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
|
1137
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
|
1138
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
|
1139
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
|
1140
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
|
1141
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
|
1142
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
|
1143
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
|
1144
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php'; |
|
|
1145
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php'; |
|
|
1146
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
|
1147
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php'; |
|
|
1148
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
|
1149
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php'; |
|
|
1150
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
|
1151
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php'; |
|
|
1152
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php'; |
|
|
1153
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php'; |
|
|
1154
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php'; |
|
|
1155
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php'; |
|
|
1156
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
|
1157
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php'; |
|
|
1158
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php'; |
|
|
1159
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php'; |
|
|
1160
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php'; |
|
|
1161
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php'; |
|
|
1162
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php'; |
|
|
1163
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
|
1164
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php'; |
|
|
1165
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php'; |
|
|
1166
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php'; |
|
|
1167
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
|
1168
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php'; |
|
|
1169
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php'; |
|
|
1170
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/HandlesConnection.php'; |
|
|
1171
|
+ require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php'; |
|
1172
|
1172
|
$ad = new SplClassLoader('LdapRecord', '../includes/libraries'); |
|
1173
|
1173
|
$ad->register(); |
|
1174
|
1174
|
|
|
@@ -1205,7 +1205,7 @@ discard block |
|
|
block discarded – undo |
|
1205
|
1205
|
// Get user info from AD |
|
1206
|
1206
|
// We want to isolate attribute ldap_user_attribute |
|
1207
|
1207
|
$userADInfos = $connection->query() |
|
1208
|
|
- ->where((isset($SETTINGS['ldap_user_attribute']) ===true && empty($SETTINGS['ldap_user_attribute']) === false) ? strtolower($SETTINGS['ldap_user_attribute']) : 'distinguishedname', '=', $username) |
|
|
1208
|
+ ->where((isset($SETTINGS['ldap_user_attribute']) === true && empty($SETTINGS['ldap_user_attribute']) === false) ? strtolower($SETTINGS['ldap_user_attribute']) : 'distinguishedname', '=', $username) |
|
1209
|
1209
|
->firstOrFail(); |
|
1210
|
1210
|
|
|
1211
|
1211
|
} catch (\LdapRecord\Query\ObjectNotFoundException $e) { |
|
@@ -1267,7 +1267,7 @@ discard block |
|
|
block discarded – undo |
|
1267
|
1267
|
// prepapre background tasks for item keys generation |
|
1268
|
1268
|
$val = DB::queryFirstRow( |
|
1269
|
1269
|
'SELECT pw, public_key, private_key |
|
1270
|
|
- FROM ' . prefixTable('users') . ' |
|
|
1270
|
+ FROM ' . prefixTable('users').' |
|
1271
|
1271
|
WHERE id = %i', |
|
1272
|
1272
|
TP_USER_ID |
|
1273
|
1273
|
); |
|
@@ -1280,8 +1280,8 @@ discard block |
|
|
block discarded – undo |
|
1280
|
1280
|
'process_type' => 'create_user_keys', |
|
1281
|
1281
|
'arguments' => json_encode([ |
|
1282
|
1282
|
'new_user_id' => (int) $userInfo['id'], |
|
1283
|
|
- 'new_user_pwd' => cryption($passwordClear, '','encrypt')['string'], |
|
1284
|
|
- 'new_user_code' => cryption(uniqidReal(20), '','encrypt')['string'], |
|
|
1283
|
+ 'new_user_pwd' => cryption($passwordClear, '', 'encrypt')['string'], |
|
|
1284
|
+ 'new_user_code' => cryption(uniqidReal(20), '', 'encrypt')['string'], |
|
1285
|
1285
|
'owner_id' => (int) TP_USER_ID, |
|
1286
|
1286
|
'creator_pwd' => $val['pw'], |
|
1287
|
1287
|
]), |
|
@@ -1434,12 +1434,12 @@ discard block |
|
|
block discarded – undo |
|
1434
|
1434
|
if (isset($SETTINGS['enable_ad_users_with_ad_groups']) === true && (int) $SETTINGS['enable_ad_users_with_ad_groups'] === 1) { |
|
1435
|
1435
|
// Get user groups from AD |
|
1436
|
1436
|
$user_ad_groups = []; |
|
1437
|
|
- foreach($groups as $group) { |
|
|
1437
|
+ foreach ($groups as $group) { |
|
1438
|
1438
|
//print_r($group); |
|
1439
|
1439
|
// get relation role id for AD group |
|
1440
|
1440
|
$role = DB::queryFirstRow( |
|
1441
|
1441
|
'SELECT lgr.role_id |
|
1442
|
|
- FROM ' . prefixTable('ldap_groups_roles') . ' AS lgr |
|
|
1442
|
+ FROM ' . prefixTable('ldap_groups_roles').' AS lgr |
|
1443
|
1443
|
WHERE lgr.ldap_group_id = %i', |
|
1444
|
1444
|
$group |
|
1445
|
1445
|
); |
|
@@ -1500,7 +1500,7 @@ discard block |
|
|
block discarded – undo |
|
1500
|
1500
|
): void |
|
1501
|
1501
|
{ |
|
1502
|
1502
|
// load passwordLib library |
|
1503
|
|
- $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
|
1503
|
+ $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
1504
|
1504
|
$pwdlib->register(); |
|
1505
|
1505
|
$pwdlib = new PasswordLib\PasswordLib(); |
|
1506
|
1506
|
$hashedPassword = $pwdlib->createPasswordHash($passwordClear); |
|
@@ -1553,7 +1553,7 @@ discard block |
|
|
block discarded – undo |
|
1553
|
1553
|
function yubicoMFACheck($dataReceived, string $userInfo, array $SETTINGS): array |
|
1554
|
1554
|
{ |
|
1555
|
1555
|
// Load superGlobals |
|
1556
|
|
- include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
|
1556
|
+ include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1557
|
1557
|
$superGlobal = new protect\SuperGlobal\SuperGlobal(); |
|
1558
|
1558
|
$sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
|
1559
|
1559
|
$sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
|
@@ -1592,7 +1592,7 @@ discard block |
|
|
block discarded – undo |
|
1592
|
1592
|
} |
|
1593
|
1593
|
|
|
1594
|
1594
|
// Now check yubico validity |
|
1595
|
|
- include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
|
1595
|
+ include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
1596
|
1596
|
$yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key); |
|
1597
|
1597
|
$auth = $yubi->verify($yubico_key); |
|
1598
|
1598
|
//, null, null, null, 60 |
|
@@ -1633,7 +1633,7 @@ discard block |
|
|
block discarded – undo |
|
1633
|
1633
|
$userKeys = generateUserKeys($passwordClear); |
|
1634
|
1634
|
|
|
1635
|
1635
|
// load passwordLib library |
|
1636
|
|
- $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
|
1636
|
+ $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
1637
|
1637
|
$pwdlib->register(); |
|
1638
|
1638
|
$pwdlib = new PasswordLib\PasswordLib(); |
|
1639
|
1639
|
$hashedPassword = $pwdlib->createPasswordHash($passwordClear); |
|
@@ -1692,7 +1692,7 @@ discard block |
|
|
block discarded – undo |
|
1692
|
1692
|
] |
|
1693
|
1693
|
); |
|
1694
|
1694
|
// Rebuild tree |
|
1695
|
|
- $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
|
1695
|
+ $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
1696
|
1696
|
$tree->register(); |
|
1697
|
1697
|
$tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
|
1698
|
1698
|
$tree->rebuild(); |
|
@@ -1724,13 +1724,13 @@ discard block |
|
|
block discarded – undo |
|
1724
|
1724
|
&& empty($dataReceived['GACode']) === false |
|
1725
|
1725
|
) { |
|
1726
|
1726
|
// Load superGlobals |
|
1727
|
|
- include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
|
1727
|
+ include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1728
|
1728
|
$superGlobal = new protect\SuperGlobal\SuperGlobal(); |
|
1729
|
1729
|
$sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
|
1730
|
1730
|
$sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
|
1731
|
1731
|
$sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
|
1732
|
1732
|
// load library |
|
1733
|
|
- include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
|
1733
|
+ include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
1734
|
1734
|
// create new instance |
|
1735
|
1735
|
$tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']); |
|
1736
|
1736
|
// Init |
|
@@ -1753,7 +1753,7 @@ discard block |
|
|
block discarded – undo |
|
1753
|
1753
|
$mfaMessage = langHdl('ga_flash_qr_and_login'); |
|
1754
|
1754
|
// generate new QR |
|
1755
|
1755
|
$new_2fa_qr = $tfa->getQRCodeImageAsDataUri( |
|
1756
|
|
- 'Teampass - ' . $username, |
|
|
1756
|
+ 'Teampass - '.$username, |
|
1757
|
1757
|
$userInfo['ga'] |
|
1758
|
1758
|
); |
|
1759
|
1759
|
// clear temporary code from DB |
|
@@ -1766,7 +1766,7 @@ discard block |
|
|
block discarded – undo |
|
1766
|
1766
|
$userInfo['id'] |
|
1767
|
1767
|
); |
|
1768
|
1768
|
$firstTime = [ |
|
1769
|
|
- 'value' => '<img src="' . $new_2fa_qr . '">', |
|
|
1769
|
+ 'value' => '<img src="'.$new_2fa_qr.'">', |
|
1770
|
1770
|
'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '', |
|
1771
|
1771
|
'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '', |
|
1772
|
1772
|
'pwd_attempts' => (int) $sessionPwdAttempts, |
|
@@ -1821,12 +1821,12 @@ discard block |
|
|
block discarded – undo |
|
1821
|
1821
|
): array |
|
1822
|
1822
|
{ |
|
1823
|
1823
|
// Load superGlobals |
|
1824
|
|
- include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
|
1824
|
+ include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1825
|
1825
|
$superGlobal = new protect\SuperGlobal\SuperGlobal(); |
|
1826
|
1826
|
|
|
1827
|
1827
|
$sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
|
1828
|
|
- $saved_state = null !== $superGlobal->get('duo_state','SESSION') ? $superGlobal->get('duo_state','SESSION') : ''; |
|
1829
|
|
- $duo_status = null !== $superGlobal->get('duo_status','SESSION') ? $superGlobal->get('duo_status','SESSION') : ''; |
|
|
1828
|
+ $saved_state = null !== $superGlobal->get('duo_state', 'SESSION') ? $superGlobal->get('duo_state', 'SESSION') : ''; |
|
|
1829
|
+ $duo_status = null !== $superGlobal->get('duo_status', 'SESSION') ? $superGlobal->get('duo_status', 'SESSION') : ''; |
|
1830
|
1830
|
|
|
1831
|
1831
|
// Ensure state and login are set |
|
1832
|
1832
|
if ( |
|
@@ -1884,7 +1884,7 @@ discard block |
|
|
block discarded – undo |
|
1884
|
1884
|
): array |
|
1885
|
1885
|
{ |
|
1886
|
1886
|
// Load superGlobals |
|
1887
|
|
- include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
|
1887
|
+ include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
1888
|
1888
|
$superGlobal = new protect\SuperGlobal\SuperGlobal(); |
|
1889
|
1889
|
|
|
1890
|
1890
|
// load libraries |
|
@@ -1930,7 +1930,7 @@ discard block |
|
|
block discarded – undo |
|
1930
|
1930
|
}*/ |
|
1931
|
1931
|
return [ |
|
1932
|
1932
|
'error' => true, |
|
1933
|
|
- 'message' => $duo_error . langHdl('duo_error_check_config'), |
|
|
1933
|
+ 'message' => $duo_error.langHdl('duo_error_check_config'), |
|
1934
|
1934
|
'pwd_attempts' => (int) $sessionPwdAttempts, |
|
1935
|
1935
|
'debug_message' => $e->getMessage(), |
|
1936
|
1936
|
'proceedIdentification' => false, |
|
@@ -1946,7 +1946,7 @@ discard block |
|
|
block discarded – undo |
|
1946
|
1946
|
} catch (Duo\DuoUniversal\DuoException $e) { |
|
1947
|
1947
|
return [ |
|
1948
|
1948
|
'error' => true, |
|
1949
|
|
- 'message' => $duo_error . langHdl('duo_error_url'), |
|
|
1949
|
+ 'message' => $duo_error.langHdl('duo_error_url'), |
|
1950
|
1950
|
'pwd_attempts' => (int) $sessionPwdAttempts, |
|
1951
|
1951
|
'debug_message' => $e->getMessage(), |
|
1952
|
1952
|
'proceedIdentification' => false, |
|
@@ -1954,7 +1954,7 @@ discard block |
|
|
block discarded – undo |
|
1954
|
1954
|
} |
|
1955
|
1955
|
|
|
1956
|
1956
|
// Somethimes Duo return success but fail to return a URL, double check if the URL has been created |
|
1957
|
|
- if (!empty($duo_redirect_url) && isset($duo_redirect_url) && filter_var($duo_redirect_url,FILTER_SANITIZE_URL)) { |
|
|
1957
|
+ if (!empty($duo_redirect_url) && isset($duo_redirect_url) && filter_var($duo_redirect_url, FILTER_SANITIZE_URL)) { |
|
1958
|
1958
|
// Since Duo Universal requires a redirect, let's store some info when the user get's back after completing the Duo prompt |
|
1959
|
1959
|
$key = hash('sha256', $duo_state); |
|
1960
|
1960
|
$iv = substr(hash('sha256', $duo_state), 0, 16); |
|
@@ -1980,7 +1980,7 @@ discard block |
|
|
block discarded – undo |
|
1980
|
1980
|
} else { |
|
1981
|
1981
|
return [ |
|
1982
|
1982
|
'error' => true, |
|
1983
|
|
- 'message' => $duo_error . langHdl('duo_error_url'), |
|
|
1983
|
+ 'message' => $duo_error.langHdl('duo_error_url'), |
|
1984
|
1984
|
'pwd_attempts' => (int) $sessionPwdAttempts, |
|
1985
|
1985
|
'proceedIdentification' => false, |
|
1986
|
1986
|
]; |
|
@@ -2001,8 +2001,8 @@ discard block |
|
|
block discarded – undo |
|
2001
|
2001
|
// return the response (which should be the user name) |
|
2002
|
2002
|
if ($decoded_token['preferred_username'] === $username) { |
|
2003
|
2003
|
$superGlobal->put('duo_status', 'COMPLET', 'SESSION'); |
|
2004
|
|
- $superGlobal->forget('duo_state','SESSION'); |
|
2005
|
|
- $superGlobal->forget('duo_data','SESSION'); |
|
|
2004
|
+ $superGlobal->forget('duo_state', 'SESSION'); |
|
|
2005
|
+ $superGlobal->forget('duo_data', 'SESSION'); |
|
2006
|
2006
|
unset($superGlobal); |
|
2007
|
2007
|
|
|
2008
|
2008
|
return [ |
|
@@ -2013,9 +2013,9 @@ discard block |
|
|
block discarded – undo |
|
2013
|
2013
|
]; |
|
2014
|
2014
|
} else { |
|
2015
|
2015
|
// Something wrong, username from the original Duo request is different than the one received now |
|
2016
|
|
- $superGlobal->forget('duo_status','SESSION'); |
|
2017
|
|
- $superGlobal->forget('duo_state','SESSION'); |
|
2018
|
|
- $superGlobal->forget('duo_data','SESSION'); |
|
|
2016
|
+ $superGlobal->forget('duo_status', 'SESSION'); |
|
|
2017
|
+ $superGlobal->forget('duo_state', 'SESSION'); |
|
|
2018
|
+ $superGlobal->forget('duo_data', 'SESSION'); |
|
2019
|
2019
|
unset($superGlobal); |
|
2020
|
2020
|
|
|
2021
|
2021
|
return [ |
|
@@ -2027,9 +2027,9 @@ discard block |
|
|
block discarded – undo |
|
2027
|
2027
|
} |
|
2028
|
2028
|
} |
|
2029
|
2029
|
// If we are here something wrong |
|
2030
|
|
- $superGlobal->forget('duo_status','SESSION'); |
|
2031
|
|
- $superGlobal->forget('duo_state','SESSION'); |
|
2032
|
|
- $superGlobal->forget('duo_data','SESSION'); |
|
|
2030
|
+ $superGlobal->forget('duo_status', 'SESSION'); |
|
|
2031
|
+ $superGlobal->forget('duo_state', 'SESSION'); |
|
|
2032
|
+ $superGlobal->forget('duo_data', 'SESSION'); |
|
2033
|
2033
|
unset($superGlobal); |
|
2034
|
2034
|
return [ |
|
2035
|
2035
|
'error' => true, |
|
@@ -2055,8 +2055,8 @@ discard block |
|
|
block discarded – undo |
|
2055
|
2055
|
// Set to false |
|
2056
|
2056
|
$userPasswordVerified = false; |
|
2057
|
2057
|
// load passwordLib library |
|
2058
|
|
- include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
2059
|
|
- $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
|
2058
|
+ include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
|
2059
|
+ $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
2060
|
2060
|
$pwdlib->register(); |
|
2061
|
2061
|
$pwdlib = new PasswordLib\PasswordLib(); |
|
2062
|
2062
|
// Check if old encryption used |
|
@@ -2189,8 +2189,8 @@ discard block |
|
|
block discarded – undo |
|
2189
|
2189
|
public function get_user_info($login, $enable_ad_user_auto_creation) { |
|
2190
|
2190
|
$data = DB::queryFirstRow( |
|
2191
|
2191
|
'SELECT u.*, a.value AS api_key |
|
2192
|
|
- FROM ' . prefixTable('users') . ' AS u |
|
2193
|
|
- LEFT JOIN ' . prefixTable('api') . ' AS a ON (u.id = a.user_id) |
|
|
2192
|
+ FROM ' . prefixTable('users').' AS u |
|
|
2193
|
+ LEFT JOIN ' . prefixTable('api').' AS a ON (u.id = a.user_id) |
|
2194
|
2194
|
WHERE login = %s', |
|
2195
|
2195
|
$login |
|
2196
|
2196
|
); |
|
@@ -2290,7 +2290,7 @@ discard block |
|
|
block discarded – undo |
|
2290
|
2290
|
$checks->get_is_too_much_attempts($sessionPwdAttempts); |
|
2291
|
2291
|
} catch (Exception $e) { |
|
2292
|
2292
|
// Load superGlobals |
|
2293
|
|
- include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
|
2293
|
+ include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
2294
|
2294
|
$superGlobal = new protect\SuperGlobal\SuperGlobal(); |
|
2295
|
2295
|
$superGlobal->put('next_possible_pwd_attempts', time() + 10, 'SESSION'); |
|
2296
|
2296
|
$superGlobal->put('pwd_attempts', 0, 'SESSION'); |
|
@@ -2536,19 +2536,19 @@ discard block |
|
|
block discarded – undo |
|
2536
|
2536
|
if ($ret['error'] !== false) { |
|
2537
|
2537
|
logEvents($SETTINGS, 'failed_auth', 'bad_duo_mfa', '', stripslashes($username), stripslashes($username)); |
|
2538
|
2538
|
// Load superGlobals |
|
2539
|
|
- include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
|
2539
|
+ include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
2540
|
2540
|
# Retrieve the previously stored state and username from the session |
|
2541
|
2541
|
$superGlobal = new protect\SuperGlobal\SuperGlobal(); |
|
2542
|
|
- $superGlobal->forget('duo_state','SESSION'); |
|
2543
|
|
- $superGlobal->forget('duo_data','SESSION'); |
|
2544
|
|
- $superGlobal->forget('duo_status','SESSION'); |
|
|
2542
|
+ $superGlobal->forget('duo_state', 'SESSION'); |
|
|
2543
|
+ $superGlobal->forget('duo_data', 'SESSION'); |
|
|
2544
|
+ $superGlobal->forget('duo_status', 'SESSION'); |
|
2545
|
2545
|
unset($superGlobal); |
|
2546
|
2546
|
return [ |
|
2547
|
2547
|
'error' => true, |
|
2548
|
2548
|
'mfaData' => $ret, |
|
2549
|
2549
|
'mfaQRCodeInfos' => false, |
|
2550
|
2550
|
]; |
|
2551
|
|
- } else if ($ret['duo_url_ready'] === true){ |
|
|
2551
|
+ } else if ($ret['duo_url_ready'] === true) { |
|
2552
|
2552
|
return [ |
|
2553
|
2553
|
'error' => false, |
|
2554
|
2554
|
'mfaData' => $ret, |