MDL-63528 auth: Show "Remember username" on login form only when needed

This commit is contained in:
Jun Pataleta
2018-10-04 11:43:22 +08:00
parent 5211af1658
commit 78cee5d64c
+2 -2
View File
@@ -78,7 +78,7 @@ class login implements renderable, templatable {
* @param string $username The username to display.
*/
public function __construct(array $authsequence, $username = '') {
global $CFG, $SESSION;
global $CFG;
$this->username = $username;
@@ -88,7 +88,7 @@ class login implements renderable, templatable {
$this->cookieshelpicon = new help_icon('cookiesenabled', 'core');
$this->autofocusform = !empty($CFG->loginpageautofocus);
$this->rememberusername = isset($CFG->rememberusername) and $CFG->rememberusername == 2;
$this->rememberusername = isset($CFG->rememberusername) && $CFG->rememberusername != 0;
$this->forgotpasswordurl = new moodle_url('/login/forgot_password.php');
$this->loginurl = new moodle_url('/login/index.php');