Skip to content
Permalink
Browse files
Merge branch 'MDL-63528-master' of git://github.com/junpataleta/moodle
  • Loading branch information
David Monllao committed Oct 29, 2018
2 parents 4af7cf6 + 428a47f commit beb86abdffd749e7aa84b7ded2988f589b19c560
Showing with 18 additions and 2 deletions.
  1. +3 −2 auth/classes/output/login.php
  2. +15 −0 auth/tests/behat/login.feature
@@ -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;

@@ -87,12 +87,13 @@ public function __construct(array $authsequence, $username = '') {
$this->cansignup = $CFG->registerauth == 'email' || !empty($CFG->registerauth);
if ($CFG->rememberusername == 0) {
$this->cookieshelpicon = new help_icon('cookiesenabledonlysession', 'core');
$this->rememberusername = false;
} else {
$this->cookieshelpicon = new help_icon('cookiesenabled', 'core');
$this->rememberusername = true;
}

$this->autofocusform = !empty($CFG->loginpageautofocus);
$this->rememberusername = isset($CFG->rememberusername) and $CFG->rememberusername == 2;

$this->forgotpasswordurl = new moodle_url('/login/forgot_password.php');
$this->loginurl = new moodle_url('/login/index.php');
@@ -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 beb86ab

Please sign in to comment.