Commit abda43b5 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Remove unused inactive check from login code (bug #890929)



This code was never run because the $oldlastlogin variable was
hardcoded to 0.  The code can be removed altogether, and instead rely
on cron to set expiry dates on inactive users.

Change-Id: I9883a7720960f2337edf060197346cd17f0193c5
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 41dd2c41
......@@ -1226,7 +1226,6 @@ function login_submit(Pieform $form, $values) {
$username = trim($values['login_username']);
$password = $values['login_password'];
$authenticated = false;
$oldlastlogin = 0;
try {
$authenticated = $USER->login($username, $password);
......@@ -1354,14 +1353,6 @@ function login_submit(Pieform $form, $values) {
redirect();
}
// Check if the user's account has become inactive
$inactivetime = get_config('defaultaccountinactiveexpire');
if ($inactivetime && $oldlastlogin > 0
&& $oldlastlogin + $inactivetime < time()) {
$USER->logout();
die_info(get_string('accountinactive'));
}
ensure_user_account_is_active();
// User is allowed to log in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment