summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2012-03-10 15:47:05 +0100
committerAndreas Gohr <andi@splitbrain.org>2012-03-10 15:47:05 +0100
commit50fbf1b6522a235e93ba72c50d0f54e09506604a (patch)
tree37c31125df63879026f02df9db8a92d14061a629 /inc/html.php
parent7980e1acf1a671646747e5b924f2c8e208280a2e (diff)
parent8a9735e34dc99c24355e0aee74a3cd49aa3b1492 (diff)
downloadrpg-50fbf1b6522a235e93ba72c50d0f54e09506604a.tar.gz
rpg-50fbf1b6522a235e93ba72c50d0f54e09506604a.tar.bz2
Merge branch 'resetpassword'
No longer autogenerate passwords for password reset when $conf['autopasswd'] is disabled. Instead allow to change the password online. * resetpassword: added a timelimit for password reset tokens removed commented line use correct lang string for password mismatch removed outdated language string. it has to be retranslated German translation for password reset honor autopasswd setting for resend password Conflicts: inc/lang/no/lang.php inc/lang/sl/lang.php
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;
+ }
+
+
}
/**