MDL-45814 login: don't prompt guest user to change password
authorDan Poltawski <dan@moodle.com>
Tue, 3 Nov 2015 14:46:59 +0000 (14:46 +0000)
committerDan Poltawski <dan@moodle.com>
Tue, 3 Nov 2015 14:48:58 +0000 (14:48 +0000)
login/index.php

index 287d3da..407ba79 100644 (file)
@@ -205,7 +205,7 @@ if ($frm and isset($frm->username)) {                             // Login WITH
     /// check if user password has expired
     /// Currently supported only for ldap-authentication module
         $userauth = get_auth_plugin($USER->auth);
-        if (!empty($userauth->config->expiration) and $userauth->config->expiration == 1) {
+        if (!isguestuser() and !empty($userauth->config->expiration) and $userauth->config->expiration == 1) {
             if ($userauth->can_change_password()) {
                 $passwordchangeurl = $userauth->change_password_url();
                 if (!$passwordchangeurl) {