Skip to content

Commit 4ab60c9

Browse files
author
David Monllao
committed
Merge branch 'MDL-63528-34' of git://github.com/junpataleta/moodle into MOODLE_34_STABLE
2 parents 747e843 + 0f6973a commit 4ab60c9

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

auth/classes/output/login.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class login implements renderable, templatable {
7878
* @param string $username The username to display.
7979
*/
8080
public function __construct(array $authsequence, $username = '') {
81-
global $CFG, $SESSION;
81+
global $CFG;
8282

8383
$this->username = $username;
8484

@@ -88,7 +88,7 @@ public function __construct(array $authsequence, $username = '') {
8888
$this->cookieshelpicon = new help_icon('cookiesenabled', 'core');
8989

9090
$this->autofocusform = !empty($CFG->loginpageautofocus);
91-
$this->rememberusername = isset($CFG->rememberusername) and $CFG->rememberusername == 2;
91+
$this->rememberusername = isset($CFG->rememberusername) && $CFG->rememberusername != 0;
9292

9393
$this->forgotpasswordurl = new moodle_url('/login/forgot_password.php');
9494
$this->loginurl = new moodle_url('/login/index.php');

auth/tests/behat/login.feature

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,18 @@ Feature: Authentication
3939
Given I log in as "admin"
4040
When I log out
4141
Then I should see "You are not logged in" in the "page-footer" "region"
42+
43+
Scenario Outline: Checking the display of the Remember username checkbox
44+
Given I log in as "admin"
45+
And I set the following administration settings values:
46+
| rememberusername | <settingvalue> |
47+
And I log out
48+
And I am on homepage
49+
When I click on "Log in" "link" in the ".logininfo" "css_element"
50+
Then I should <expect> "Remember username"
51+
52+
Examples:
53+
| settingvalue | expect |
54+
| 0 | not see |
55+
| 1 | see |
56+
| 2 | see |

0 commit comments

Comments
 (0)