mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-08-08 09:43:01 +02:00
When a password activation or reset link is generated, the link expiry time is now defined in two conf: $conf[’password_reset_duration‘] with a default time of one hour and $conf[’password_activation_duration‘] with a default time of 72 hours.
This commit is contained in:
@@ -2215,8 +2215,9 @@ function send_new_user_password(user_id, mail) {
|
||||
$.ajax({
|
||||
url: "ws.php?format=json",
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
data:{
|
||||
method: 'pwg.users.generateResetPasswordLink',
|
||||
method: 'pwg.users.generatePasswordLink',
|
||||
user_id: user_id,
|
||||
send_by_mail: send_by_mail,
|
||||
pwg_token: pwg_token
|
||||
@@ -2228,12 +2229,14 @@ function send_new_user_password(user_id, mail) {
|
||||
$('#AddUserFieldContainer').hide();
|
||||
$('#AddUserSuccessContainer').fadeIn();
|
||||
$('#AddUserPasswordLink').val(response.result.generated_link).trigger('focus');
|
||||
$('#AddUserTextField').html(send_by_mail ? sprintf(validLinkMail, `<b>${mail}</b>`) : validLinkWithoutMail);
|
||||
$('#AddUserTextField').html(send_by_mail
|
||||
? sprintf(validLinkMail, response.result.time_validation, `<b>${mail}</b>`)
|
||||
: sprintf(validLinkWithoutMail, response.result.time_validation));
|
||||
|
||||
if(send_by_mail && !response.result.send_by_mail) {
|
||||
$('#AddUserUpdated').removeClass('icon-green border-green icon-ok').addClass('icon-red-error icon-cancel');
|
||||
$('#AddUserUpdatedText').html(errorMailSent);
|
||||
$('#AddUserTextField').html(errorMailSentMsg);
|
||||
$('#AddUserTextField').html(sprintf(errorMailSentMsg, response.result.time_validation));
|
||||
} else if (send_by_mail && response.result.send_by_mail) {
|
||||
password_container.hide();
|
||||
}
|
||||
@@ -2316,8 +2319,9 @@ function send_link_password(email, username, user_id, send_by_mail) {
|
||||
$.ajax({
|
||||
url: "ws.php?format=json",
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
data: {
|
||||
method: 'pwg.users.generateResetPasswordLink',
|
||||
method: 'pwg.users.generatePasswordLink',
|
||||
user_id: user_id,
|
||||
send_by_mail: send_by_mail,
|
||||
pwg_token: pwg_token
|
||||
|
||||
@@ -45,9 +45,9 @@ const mainUserUpgradeWebmaster = "{'This user must first be defined as the webma
|
||||
const errorStr = "{'an error happened'|@translate|escape:javascript}";
|
||||
const copyLinkStr = "{'Copied link'|@translate|escape:javascript}";
|
||||
const cantCopy = "{'You cannot copy the password if the connection to this site is not secure.'|@translate|escape:javascript}";
|
||||
const validLinkMail = "{'An activation link valid for 1 hour has been sent to "%s". If the user doesn\'t receive the link, you can generate and copy a new one by editing the user and managing her password.'|@translate|escape:javascript}";
|
||||
const validLinkMail = "{'An activation link valid for %s has been sent to "%s". If the user doesn\'t receive the link, you can generate and copy a new one by editing the user and managing her password.'|@translate|escape:javascript}";
|
||||
const validLinkWithoutMail = "{'Copy the link below and send it to the user so the password can be set.'|@translate|escape:javascript}";
|
||||
const errorMailSentMsg = "{'An activation link valid for 1 hour was created but could not be sent. You can now copy the link below and send it to the user.'|@translate|escape:javascript}";
|
||||
const errorMailSentMsg = "{'An activation link valid for %s was created but could not be sent. You can now copy the link below and send it to the user.'|@translate|escape:javascript}";
|
||||
|
||||
const registered_str = '{"Registered"|@translate|escape:javascript}';
|
||||
const last_visit_str = '{"Last visit"|@translate|escape:javascript}';
|
||||
|
||||
Reference in New Issue
Block a user