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

This commit is contained in:
Simey Lameze
2016-11-30 11:32:38 +08:00
parent a0352aa95e
commit 45cd101f80
2 changed files with 11 additions and 2 deletions
+9 -1
View File
@@ -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.
+2 -1
View File
@@ -299,7 +299,8 @@ div#dock {
}
.userloggedinas,
.userswitchedrole {
.userswitchedrole,
.loginfailures {
.usermenu {
.usertext {
float: left;