diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2011-10-31 15:41:53 +0100 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2011-10-31 15:58:36 +0100 |
commit | cc204bbd1f1625352ddd0edaacdd297fe022881c (patch) | |
tree | ea7f952e01acf8b7b051a0dcd85dc9af747815cf /inc/html.php | |
parent | 222298bcee7f8e8fd98bb6fc1bcfb821ac1e55cd (diff) | |
download | rpg-cc204bbd1f1625352ddd0edaacdd297fe022881c.tar.gz rpg-cc204bbd1f1625352ddd0edaacdd297fe022881c.tar.bz2 |
honor autopasswd setting for resend password
When autopasswd is disabled, the resend password option now asks for a
new password instead of autogenerating a new one and sending it by mail.
Note to translators: the wording for btn_resendpwd and resendpwd changed
to be more universal. English and German language files where updated -
other languages need to be adjusted.
Conflicts:
inc/lang/en/lang.php
Diffstat (limited to 'inc/html.php')
-rw-r--r-- | inc/html.php | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/inc/html.php b/inc/html.php index 1a2d7daef..dea9ac6ab 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1661,26 +1661,49 @@ function html_admin(){ * Form to request a new password for an existing account * * @author Benoit Chesneau <benoit@bchesneau.info> + * @author Andreas Gohr <gohr@cosmocode.de> */ function html_resendpwd() { global $lang; global $conf; global $ID; - print p_locale_xhtml('resendpwd'); - print '<div class="centeralign">'.NL; - $form = new Doku_Form(array('id' => 'dw__resendpwd')); - $form->startFieldset($lang['resendpwd']); - $form->addHidden('do', 'resendpwd'); - $form->addHidden('save', '1'); - $form->addElement(form_makeTag('br')); - $form->addElement(form_makeTextField('login', $_POST['login'], $lang['user'], '', 'block')); - $form->addElement(form_makeTag('br')); - $form->addElement(form_makeTag('br')); - $form->addElement(form_makeButton('submit', '', $lang['btn_resendpwd'])); - $form->endFieldset(); - html_form('resendpwd', $form); - print '</div>'.NL; + $token = preg_replace('/[^a-f0-9]+/','',$_REQUEST['pwauth']); + + if(!$conf['autopasswd'] && $token){ + print p_locale_xhtml('resetpwd'); + print '<div class="centeralign">'.NL; + $form = new Doku_Form(array('id' => 'dw__resendpwd')); + $form->startFieldset($lang['btn_resendpwd']); + $form->addHidden('token', $token); + $form->addHidden('do', 'resendpwd'); + //$form->addElement(form_makeTag('br')); + + $form->addElement(form_makePasswordField('pass', $lang['pass'], '', 'block', array('size'=>'50'))); + $form->addElement(form_makePasswordField('passchk', $lang['passchk'], '', 'block', array('size'=>'50'))); + + $form->addElement(form_makeButton('submit', '', $lang['btn_resendpwd'])); + $form->endFieldset(); + html_form('resendpwd', $form); + print '</div>'.NL; + }else{ + print p_locale_xhtml('resendpwd'); + print '<div class="centeralign">'.NL; + $form = new Doku_Form(array('id' => 'dw__resendpwd')); + $form->startFieldset($lang['resendpwd']); + $form->addHidden('do', 'resendpwd'); + $form->addHidden('save', '1'); + $form->addElement(form_makeTag('br')); + $form->addElement(form_makeTextField('login', $_POST['login'], $lang['user'], '', 'block')); + $form->addElement(form_makeTag('br')); + $form->addElement(form_makeTag('br')); + $form->addElement(form_makeButton('submit', '', $lang['btn_resendpwd'])); + $form->endFieldset(); + html_form('resendpwd', $form); + print '</div>'.NL; + } + + } /** |