Skip to content

Commit

Permalink
3.0.0.18
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
nilsteampassnet committed Sep 11, 2022
1 parent fe6e1f8 commit b55dbf9
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These are supported funding model platforms

github: nilsteampassnet
patreon: teampass
open_collective: teampass
# patreon: teampass
# open_collective: teampass
9 changes: 8 additions & 1 deletion includes/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ function countdown()
$('.countdown-icon')
.addClass('fas fa-history')
.removeClass('far fa-clock');
return;

$(this).delay(1000).queue(function()
{
countdown();
$(this).dequeue();
});

return false;
}

// Continue
Expand Down
27 changes: 14 additions & 13 deletions pages/users.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -2524,34 +2524,35 @@ function(data) {
var data = {
'action': 'stepFinishing',
'user_id': userId,
'user_new_otp': userTemporaryCode,
}
console.log("Finishing user creation from LDAP")
//console.log("Finishing user creation from LDAP")
console.log(data)

// Do query
$.post(
"sources/users.queries.php", {
type: "finishing_user_creation_from_ldap",
type: "finishing_user_keys_creation",
data: prepareExchangedData(JSON.stringify(data), 'encode', '<?php echo $_SESSION['key']; ?>'),
key: '<?php echo $_SESSION['key']; ?>'
},
function(data) {
data = prepareExchangedData(data, "decode", "<?php echo $_SESSION['key']; ?>");
console.log(data);
console.log("---");
}
);

// refresh the list of users in LDAP not added in Teampass
refreshListUsersLDAP();

// refresh the list of users in LDAP not added in Teampass
refreshListUsersLDAP();

// Rrefresh list of users in Teampass
oTable.ajax.reload();
// Rrefresh list of users in Teampass
oTable.ajax.reload();

$('#warningModal').modal('hide');
$('#warningModal').modal('hide');

// restart time expiration counter
ProcessInProgress = false;
console.log('TOUT EST TERMINE')
// restart time expiration counter
ProcessInProgress = false;
}
);
}
return dfd.promise();
}
Expand Down
33 changes: 22 additions & 11 deletions sources/users.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -2760,9 +2760,9 @@
break;

/*
* ADD USER FROM LDAP - FINISHING
*/
case 'finishing_user_creation_from_ldap':
* ADD USER KEYS CREATION - FINISHING
*/
case 'finishing_user_keys_creation':
// Check KEY
if ($post_key !== $_SESSION['key']) {
echo prepareExchangedData(
Expand All @@ -2785,6 +2785,7 @@

// Prepare variables
$post_userId = filter_var($dataReceived['user_id'], FILTER_SANITIZE_STRING);
$post_otp = filter_var($dataReceived['user_new_otp'], FILTER_SANITIZE_STRING);

DB::update(
prefixTable('users'),
Expand All @@ -2795,6 +2796,24 @@
$post_userId
);

// Send mail to user with new OTP
$userInfo = DB::queryFirstRow(
'SELECT email
FROM ' . prefixTable('users') . '
WHERE id = %i',
$post_userId
);
sendEmail(
'TEAMPASS - ' . langHdl('temporary_encryption_code'),
str_replace(
array('#enc_code#'),
array($post_otp),
langHdl('email_body_user_added_from_ldap_encryption_code')
),
$userInfo['email'],
$SETTINGS
);


echo prepareExchangedData(
$SETTINGS['cpassman_dir'],
Expand Down Expand Up @@ -3379,16 +3398,8 @@

if ($userInfo['auth_type'] === 'local') {
$values['special'] = 'generate-keys';
/*array_push(
$values,
array('special' => 'generate-keys')
);*/
} elseif ($userInfo['auth_type'] === 'ldap') {
$values['special'] = 'user_added_from_ldap';
/*array_push(
$values,
array('special' => 'user_added_from_ldap')
);*/
}

// update profil
Expand Down

0 comments on commit b55dbf9

Please sign in to comment.