Skip to content
Snippets Groups Projects
Commit 2a481de5 authored by Peter Rotich's avatar Peter Rotich
Browse files

Add ability to force password change while registering the user.

parent 321b15b2
No related branches found
No related tags found
No related merge requests found
...@@ -768,6 +768,8 @@ class UserAccount extends UserAccountModel { ...@@ -768,6 +768,8 @@ class UserAccount extends UserAccountModel {
if ($vars['passwd1'] && !$vars['sendemail']) { if ($vars['passwd1'] && !$vars['sendemail']) {
$account->set('passwd', Password::hash($vars['passwd1'])); $account->set('passwd', Password::hash($vars['passwd1']));
$account->setStatus(self::CONFIRMED); $account->setStatus(self::CONFIRMED);
if ($vars['pwreset-flag'])
$account->setStatus(self::PASSWD_RESET_REQUIRED);
} }
$account->save(true); $account->save(true);
......
...@@ -47,7 +47,7 @@ $user->getName()->getOriginal(); ?></b>.</p></div> ...@@ -47,7 +47,7 @@ $user->getName()->getOriginal(); ?></b>.</p></div>
<td> <td>
<input type="checkbox" id="sendemail" name="sendemail" value="1" <input type="checkbox" id="sendemail" name="sendemail" value="1"
<?php echo $info['sendemail'] ? 'checked="checked"' : ''; ?> > <?php echo $info['sendemail'] ? 'checked="checked"' : ''; ?> >
Send account confirmation email to user. Send account activation email to <?php echo $user->getEmail(); ?>.
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -82,6 +82,15 @@ $user->getName()->getOriginal(); ?></b>.</p></div> ...@@ -82,6 +82,15 @@ $user->getName()->getOriginal(); ?></b>.</p></div>
&nbsp;<span class="error">&nbsp;<?php echo $errors['passwd2']; ?></span> &nbsp;<span class="error">&nbsp;<?php echo $errors['passwd2']; ?></span>
</td> </td>
</tr> </tr>
<tr>
<td>
Password Change:
</td>
<td colspan=2>
<input type="checkbox" name="pwreset-flag" value="1" <?php
echo $info['pwreset-flag'] ? 'checked="checked"' : ''; ?>> Require password change on login
</td>
</tr>
</tbody> </tbody>
<tbody> <tbody>
<tr> <tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment