Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'MDL-63528-34' of git://github.com/junpataleta/moodle in…
…to MOODLE_34_STABLE
  • Loading branch information
David Monllao committed Oct 29, 2018
2 parents 747e843 + 0f6973a commit 4ab60c9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions auth/classes/output/login.php
Expand Up @@ -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;

Expand All @@ -88,7 +88,7 @@ public function __construct(array $authsequence, $username = '') {
$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');
Expand Down
15 changes: 15 additions & 0 deletions auth/tests/behat/login.feature
Expand Up @@ -39,3 +39,18 @@ Feature: Authentication
Given I log in as "admin"
When I log out
Then I should see "You are not logged in" in the "page-footer" "region"

Scenario Outline: Checking the display of the Remember username checkbox
Given I log in as "admin"
And I set the following administration settings values:
| rememberusername | <settingvalue> |
And I log out
And I am on homepage
When I click on "Log in" "link" in the ".logininfo" "css_element"
Then I should <expect> "Remember username"

Examples:
| settingvalue | expect |
| 0 | not see |
| 1 | see |
| 2 | see |

0 comments on commit 4ab60c9

Please sign in to comment.