Skip to content

Commit b55dbf9

Browse files
3.0.0.18
Fixes
1 parent fe6e1f8 commit b55dbf9

File tree

4 files changed

+46
-27
lines changed

4 files changed

+46
-27
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# These are supported funding model platforms
22

33
github: nilsteampassnet
4-
patreon: teampass
5-
open_collective: teampass
4+
# patreon: teampass
5+
# open_collective: teampass

includes/js/functions.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ function countdown()
2525
$('.countdown-icon')
2626
.addClass('fas fa-history')
2727
.removeClass('far fa-clock');
28-
return;
28+
29+
$(this).delay(1000).queue(function()
30+
{
31+
countdown();
32+
$(this).dequeue();
33+
});
34+
35+
return false;
2936
}
3037

3138
// Continue

pages/users.js.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2524,34 +2524,35 @@ function(data) {
25242524
var data = {
25252525
'action': 'stepFinishing',
25262526
'user_id': userId,
2527+
'user_new_otp': userTemporaryCode,
25272528
}
2528-
console.log("Finishing user creation from LDAP")
2529+
//console.log("Finishing user creation from LDAP")
25292530
console.log(data)
2531+
25302532
// Do query
25312533
$.post(
25322534
"sources/users.queries.php", {
2533-
type: "finishing_user_creation_from_ldap",
2535+
type: "finishing_user_keys_creation",
25342536
data: prepareExchangedData(JSON.stringify(data), 'encode', '<?php echo $_SESSION['key']; ?>'),
25352537
key: '<?php echo $_SESSION['key']; ?>'
25362538
},
25372539
function(data) {
25382540
data = prepareExchangedData(data, "decode", "<?php echo $_SESSION['key']; ?>");
25392541
console.log(data);
25402542
console.log("---");
2541-
}
2542-
);
2543-
2544-
// refresh the list of users in LDAP not added in Teampass
2545-
refreshListUsersLDAP();
2543+
2544+
// refresh the list of users in LDAP not added in Teampass
2545+
refreshListUsersLDAP();
25462546

2547-
// Rrefresh list of users in Teampass
2548-
oTable.ajax.reload();
2547+
// Rrefresh list of users in Teampass
2548+
oTable.ajax.reload();
25492549

2550-
$('#warningModal').modal('hide');
2550+
$('#warningModal').modal('hide');
25512551

2552-
// restart time expiration counter
2553-
ProcessInProgress = false;
2554-
console.log('TOUT EST TERMINE')
2552+
// restart time expiration counter
2553+
ProcessInProgress = false;
2554+
}
2555+
);
25552556
}
25562557
return dfd.promise();
25572558
}

sources/users.queries.php

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,9 +2760,9 @@
27602760
break;
27612761

27622762
/*
2763-
* ADD USER FROM LDAP - FINISHING
2764-
*/
2765-
case 'finishing_user_creation_from_ldap':
2763+
* ADD USER KEYS CREATION - FINISHING
2764+
*/
2765+
case 'finishing_user_keys_creation':
27662766
// Check KEY
27672767
if ($post_key !== $_SESSION['key']) {
27682768
echo prepareExchangedData(
@@ -2785,6 +2785,7 @@
27852785

27862786
// Prepare variables
27872787
$post_userId = filter_var($dataReceived['user_id'], FILTER_SANITIZE_STRING);
2788+
$post_otp = filter_var($dataReceived['user_new_otp'], FILTER_SANITIZE_STRING);
27882789

27892790
DB::update(
27902791
prefixTable('users'),
@@ -2795,6 +2796,24 @@
27952796
$post_userId
27962797
);
27972798

2799+
// Send mail to user with new OTP
2800+
$userInfo = DB::queryFirstRow(
2801+
'SELECT email
2802+
FROM ' . prefixTable('users') . '
2803+
WHERE id = %i',
2804+
$post_userId
2805+
);
2806+
sendEmail(
2807+
'TEAMPASS - ' . langHdl('temporary_encryption_code'),
2808+
str_replace(
2809+
array('#enc_code#'),
2810+
array($post_otp),
2811+
langHdl('email_body_user_added_from_ldap_encryption_code')
2812+
),
2813+
$userInfo['email'],
2814+
$SETTINGS
2815+
);
2816+
27982817

27992818
echo prepareExchangedData(
28002819
$SETTINGS['cpassman_dir'],
@@ -3379,16 +3398,8 @@
33793398

33803399
if ($userInfo['auth_type'] === 'local') {
33813400
$values['special'] = 'generate-keys';
3382-
/*array_push(
3383-
$values,
3384-
array('special' => 'generate-keys')
3385-
);*/
33863401
} elseif ($userInfo['auth_type'] === 'ldap') {
33873402
$values['special'] = 'user_added_from_ldap';
3388-
/*array_push(
3389-
$values,
3390-
array('special' => 'user_added_from_ldap')
3391-
);*/
33923403
}
33933404

33943405
// update profil

0 commit comments

Comments
 (0)