Option to resend activation email for new users as admin
This is probably a new feature request in the section "users and groups" and "activity and notification"
Status quo
- Checkbox «Send email to new user» activated
- Admin creates new user and activation email was sent
- Password reset link (token) expired before user was able to set his new password (within 24 hours?)
- Admins cannot resend the activation email via user administration
- Admins have to delete and recreate a user or set a password and inform the user manually
Requested features
- Possibility for admins and group admins to resend activation emails with a link to set the password (fresh token)
- Optional: Change lifetime of reset password links/tokens maybe as config.php parameter
I have this issue as well and like the feature request to allow the admin to define the default token expiration time it's now to short.. or better said: how can I extend the token time now?
@MorrisJobke I would have a concern that this is a security issue as well and even a bug. simply for this reason: what is the purpose of the token that gets expired after an unidentifed time if the user can simply go to the main page and just resets its password and then gets a new password? Why would we have a token if there is always a workaround by doing an password reset?
Can we document the timeout please in config.php or make it customize-able from a day to a week(s)? (Enhancement yes I understand).
For the immediate need: how do I change (extend) the time-out now or even remove the timeout in the token?
PLease advise if possible? Its now causing me some grief with my users even more because I can't customize the e-mail template to give them a better customized welkom onboard message that helps them to resolve this token expired and or points them to online help on how to get the client installed.
thanks again!
Hello,
until this issue is somehow fixed so that we can set the expiration of the token as we want or resend a renewed token to the user is there a way to work around this ? re creating the users every time it expires is a bit difficult.
thank you
I have the excact same problem. It's quite unrealistic to assume that users sign up within 12 hours if not in a business environment. I think the main problem is that nextcloud cannot currently differentiate between a lost password token and the new user token. For the lost password token I find 12 hours good, but for new users it should be more, probably 3-7 days. I think I traced the code down to Line 187 in the LostController.php (as of Version 12.0.3). I changed this to 7 days now and will test this out with the next user I create. Using a config value in this place instead of a hardcoded value shouldn't be too much work as the config is readily available. Could it be considered to make this configurable at least? That would be great!
I faced this problem too. I believe these features would be awsome!
jonasgarstick commented on Aug 8 Requested features
Possibility for admins and group admins to resend activation emails with a link to set the password (fresh token) Optional: Change lifetime of reset password links/tokens maybe as config.php parameter
This feature would be nice! Due to different timezones i encountered this issue. I have created users yesterday in the afternoon and now i am getting email from users their tokens would have been expired...
Workaround to send a password reset mail
When the token is expired the user or admin can send a password recovery mail on the login page.
- Go to the login site
- Enter the username/email and anything in the password field.
- On the failed-login page, Click the button to reset the password. "Wrong Password, reset it?
- An email with a new token is sent to the user
It would be great to have this as a feature from within the users area of the nextcloud admin pages, quite a few users see the signup email and just assume it can wait... then i get bombarded with requests to send a new activation email which i cant, the workaround works but its far from ideal.
The nextcloud guys will get this sorted no doubt - its a solid product :-)
@JK74 @MorrisJobke with regards to customising the email this is possible, I didn't like the new welcome message and not having the ability to customise it was driving me a little crazy...
The below file is what is used to build the email sent to new users
/
If you just want to replace the wording head to line 128 your looking for
$emailTemplate->addBodyText
Personally I recommend making a copy of the original NewUserMailHelp.php, and making small changes to the file and then testing, I discovered that altering / removing some code from this php file caused the USERS admin page to stop loading ie i got zero users listed and instead a spinning wheel, this was what happened with me trying to remove the nextcloud client app download link... and my lack of php skillz ;-)
@010100110110010101100010 thanks for the guidance; I have now changed as well some items you mentioned below and it works like a charm! thanks again.
What I'm missing is still the suggestion to make custom lines as an admin to this e-mail template in the GUI like where a getting started doc can be found on the nextcloud and a way to change in the GUI the duration of the token. in addition there is a lot of white space between the lines in the e-mail; partically caused by the heading of the 'welcome on board' versus bodytext; but that is minor.
Twelve hours is definitely a small time for the welcome email's password token, I had to patch the code to allow 48 hours
@azazel75 dude throw us a bone and share how you did this, I've been searching the code but could not find what sets the token expiry at 12hrs.
@010100110110010101100010 like @Shyru said, I patched core/Controller/LostController.php, like this to obtain a validity of 48 hours:
--- nextcloud-12.0.5.vanilla/core/Controller/LostController.php 2018-01-24 09:36:26.000000000 +0000
+++ nextcloud-12.0.5/core/Controller/LostController.php 2018-01-26 14:06:49.582269107 +0000
@@ -184,7 +184,7 @@
throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid'));
}
- if ($splittedToken[0] < ($this->timeFactory->getTime() - 60*60*12) ||
+ if ($splittedToken[0] < ($this->timeFactory->getTime() - 60*60*48) ||
$user->getLastLogin() > $splittedToken[0]) {
throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is expired'));
}
OMG Sorry @azazel75 i cant believe i missed that above! being dense and not reading everything even back then.
Thanks
Any progress on this? I have to patch every single NC update source in order to have a longer token validity. Can't you guys just setup a variable in config.php with your 12h standard as default, thus enabling administrators to choose a period that best fits their organization?
Fix is in #9966
Appreciate your work guys 👍