* @author Andreas Gohr * * @triggers HTML_RESENDPWDFORM_OUTPUT * @return void */ public function show() { global $lang; global $conf; global $INPUT; $token = preg_replace('/[^a-f0-9]+/', '', $INPUT->str('pwauth')); // print intro print p_locale_xhtml('resetpwd'); print '
'.DOKU_LF; if (!$conf['autopasswd'] && $token) { // create the form $form = new Form(['id' => 'dw__resendpwd']); $form->addTagOpen('div')->addClass('no'); $form->addFieldsetOpen($lang['btn_resendpwd']); $form->setHiddenField('token', $token); $form->setHiddenField('do', 'resendpwd'); $input = $form->addPasswordInput('pass', $lang['pass'])->attr('size', '50')->addClass('edit'); $input->getLabel()->attr('class', 'block'); $form->addHTML("
\n"); $input = $form->addPasswordInput('passchk', $lang['passchk'])->attr('size', '50')->addClass('edit'); $input->getLabel()->attr('class', 'block'); $form->addHTML("
\n"); $form->addButton('', $lang['btn_resendpwd'])->attrs(['type' => 'submit']); $form->addFieldsetClose(); $form->addTagClose('div'); } else { // create the form $form = new Form(['id' => 'dw__resendpwd']); $form->addTagOpen('div')->addClass('no'); $form->addFieldsetOpen($lang['btn_resendpwd']); $form->setHiddenField('do', 'resendpwd'); $form->setHiddenField('save', '1'); $form->addHTML("
\n"); $input = $form->addTextInput('login', $lang['user'])->addClass('edit') ->val($INPUT->str('login')); $input->getLabel()->attr('class', 'block'); $form->addHTML("
\n"); $form->addHTML("
\n"); $form->addButton('', $lang['btn_resendpwd'])->attrs(['type' => 'submit']); $form->addFieldsetClose(); $form->addTagClose('div'); } // emit HTML_RESENDPWDFORM_OUTPUT event, print the form Event::createAndTrigger('HTML_RESENDPWDFORM_OUTPUT', $form, 'html_form_output', false); print '
'.DOKU_LF; } }