Skip to content

Commit

Permalink
Merge branch 'MDL-63528-35' of git://github.com/junpataleta/moodle in…
Browse files Browse the repository at this point in the history
…to MOODLE_35_STABLE
  • Loading branch information
David Monllao committed Oct 29, 2018
2 parents 116b0d2 + a8e4094 commit eb5263e
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
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class login implements renderable, templatable {
* @param string $username The username to display. * @param string $username The username to display.
*/ */
public function __construct(array $authsequence, $username = '') { public function __construct(array $authsequence, $username = '') {
global $CFG, $SESSION; global $CFG;


$this->username = $username; $this->username = $username;


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


$this->autofocusform = !empty($CFG->loginpageautofocus); $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->forgotpasswordurl = new moodle_url('/login/forgot_password.php');
$this->loginurl = new moodle_url('/login/index.php'); $this->loginurl = new moodle_url('/login/index.php');
Expand Down
15 changes: 15 additions & 0 deletions auth/tests/behat/login.feature
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -39,3 +39,18 @@ Feature: Authentication
Given I log in as "admin" Given I log in as "admin"
When I log out When I log out
Then I should see "You are not logged in" in the "page-footer" "region" 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 eb5263e

Please sign in to comment.