3 // This is one "supplanter" form that generates
4 // one correct forgot_password.php request in
5 // order to get the mailout for 'restored' users
6 // working automatically without having to
7 // fill the form manually (the user already has
8 // filled the username and it has been detected
9 // as a 'restored' one. Surely, some day this will
10 // be out, with the forgot_password utility being
11 // part of each plugin, but now now. See MDL-20846
12 // for the rationale for this implementation.
14 if (!defined('MOODLE_INTERNAL')) {
15 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
18 require_once $CFG->libdir
.'/formslib.php';
20 class login_forgot_password_form
extends moodleform
{
22 function definition() {
23 $mform =& $this->_form
;
25 $username = $this->_customdata
['username'];
27 $mform->addElement('hidden', 'username', $username);
28 $mform->setType('username', PARAM_RAW
);
30 $this->add_action_buttons(false, get_string('continue'));