Commit 45cd101f authored by Simey Lameze's avatar Simey Lameze
Browse files

MDL-56955 theme_boost: fix login failure displaying on user menu

parent a0352aa9
......@@ -1008,12 +1008,20 @@ class core_renderer extends renderer_base {
* @return string HTML that you must output this, preferably immediately.
*/
public function header() {
global $USER, $CFG;
global $USER, $CFG, $SESSION;
if (\core\session\manager::is_loggedinas()) {
$this->page->add_body_class('userloggedinas');
}
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.
......
......@@ -299,7 +299,8 @@ div#dock {
}
.userloggedinas,
.userswitchedrole {
.userswitchedrole,
.loginfailures {
.usermenu {
.usertext {
float: left;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment