/var/www/html/moodle/lib/pagelib.php
$summary .= 'Page type ' . $this->pagetype . '. ';
if ($this->subpage) {
$summary .= 'Sub-page ' . $this->subpage . '. ';
}
return $summary;
}
// Setter methods =============================================================.
/**
* Set the state.
*
* The state must be one of that STATE_... constants, and the state is only allowed to advance one step at a time.
*
* @param int $state The new state.
* @throws coding_exception
*/
public function set_state($state) {
if ($state != $this->_state + 1 || $state > self::STATE_DONE) {
throw new coding_exception('Invalid state passed to moodle_page::set_state. We are in state ' .
$this->_state . ' and state ' . $state . ' was requested.');
}
if ($state == self::STATE_PRINTING_HEADER) {
$this->starting_output();
}
$this->_state = $state;
}
/**
* Set the current course. This sets both $PAGE->course and $COURSE. It also
* sets the right theme and locale.
*
* Normally you don't need to call this function yourself, require_login will
* call it for you if you pass a $course to it. You can use this function
* on pages that do need to call require_login().
*
* Sets $PAGE->context to the course context, if it is not already set.
*
/var/www/html/moodle/lib/outputrenderers.php
if (isset($SESSION->justloggedin) && !empty($CFG->displayloginfailures)) {
require_once($CFG->dirroot . '/user/lib.php');
// Set second parameter to false as we do not want reset the counter, the same message appears on footer.
if ($count = user_count_login_failures($USER, false)) {
$this->page->add_body_class('loginfailures');
}
}
// If the user is logged in, and we're not in initial install,
// check to see if the user is role-switched and add the appropriate
// CSS class to the body element.
if (!during_initial_install() && isloggedin() && is_role_switched($this->page->course->id)) {
$this->page->add_body_class('userswitchedrole');
}
// Give themes a chance to init/alter the page object.
$this->page->theme->init_page($this->page);
$this->page->set_state(moodle_page::STATE_PRINTING_HEADER);
// Find the appropriate page layout file, based on $this->page->pagelayout.
$layoutfile = $this->page->theme->layout_file($this->page->pagelayout);
// Render the layout using the layout file.
$rendered = $this->render_page_layout($layoutfile);
// Slice the rendered output into header and footer.
$cutpos = strpos($rendered, $this->unique_main_content_token);
if ($cutpos === false) {
$cutpos = strpos($rendered, self::MAIN_CONTENT_TOKEN);
$token = self::MAIN_CONTENT_TOKEN;
} else {
$token = $this->unique_main_content_token;
}
if ($cutpos === false) {
throw new coding_exception('page layout file ' . $layoutfile . ' does not contain the main content placeholder, please include "<?php echo $OUTPUT->main_content() ?>" in theme layout file.');
}
$header = substr($rendered, 0, $cutpos);
/var/www/html/moodle/login/forgot_password.php
if (!empty($SESSION->password_reset_token)) {
$token = $SESSION->password_reset_token;
unset($SESSION->password_reset_token);
$tokeninsession = true;
}
if (empty($token)) {
core_login_process_password_reset_request();
} else {
if (!$tokeninsession && $_SERVER['REQUEST_METHOD'] === 'GET') {
$SESSION->password_reset_token = $token;
redirect($CFG->wwwroot . '/login/forgot_password.php');
} else {
core_login_process_password_set($token);
}
}
$mform = new login_forgot_password_form();
echo $OUTPUT->header();
?>
<div class="d-flex row">
<div class="col-xl-4 col-lg-5 col-md-8 col-sm-10 mx-auto">
<img src="{{{logourl}}}" alt="Login image" width="120" />
<h2 class="text-dark">Forgot Password</h2>
<p>Don't worry, it happens to the best of us. Enter your phone number to get a password reset verification code.</p>
<?php
$mform->display();
?>
<a href="login.php">Go back to login</a>
</div>
</div>
<?php
echo $OUTPUT->footer();