summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php50
1 files changed, 36 insertions, 14 deletions
diff --git a/inc/html.php b/inc/html.php
index ece26d136..ef95aa11f 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -1663,26 +1663,48 @@ 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_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;
+ }
+
+
}
/**