Merge branch 'MDL-56955-master' of git://github.com/lameze/moodle

This commit is contained in:
David Monllao 2016-11-30 11:34:29 +08:00
commit 4495ddcf9f
2 changed files with 11 additions and 2 deletions

View file

@ -1008,12 +1008,20 @@ class core_renderer extends renderer_base {
* @return string HTML that you must output this, preferably immediately. * @return string HTML that you must output this, preferably immediately.
*/ */
public function header() { public function header() {
global $USER, $CFG; global $USER, $CFG, $SESSION;
if (\core\session\manager::is_loggedinas()) { if (\core\session\manager::is_loggedinas()) {
$this->page->add_body_class('userloggedinas'); $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, // 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 // check to see if the user is role-switched and add the appropriate
// CSS class to the body element. // CSS class to the body element.

View file

@ -299,7 +299,8 @@ div#dock {
} }
.userloggedinas, .userloggedinas,
.userswitchedrole { .userswitchedrole,
.loginfailures {
.usermenu { .usermenu {
.usertext { .usertext {
float: left; float: left;