Commit 170bb96e authored by Richard Mansfield's avatar Richard Mansfield
Browse files

608c8af2 from trunk

parent d69e08b3
......@@ -1018,11 +1018,13 @@ function login_submit(Pieform $form, $values) {
// Check if the user's account has been deleted
if ($USER->deleted) {
$USER->logout();
die_info(get_string('accountdeleted'));
}
// Check if the user's account has expired
if ($USER->expiry > 0 && time() > $USER->expiry) {
$USER->logout();
die_info(get_string('accountexpired'));
}
......@@ -1030,12 +1032,16 @@ function login_submit(Pieform $form, $values) {
$inactivetime = get_config('defaultaccountinactiveexpire');
if ($inactivetime && $oldlastlogin > 0
&& $oldlastlogin + $inactivetime < time()) {
$USER->logout();
die_info(get_string('accountinactive'));
}
// Check if the user's account has been suspended
if ($USER->suspendedcusr) {
die_info(get_string('accountsuspended', 'mahara', $USER->suspendedctime, $USER->suspendedreason));
$suspendedctime = $USER->suspendedctime;
$suspendedreason = $USER->suspendedreason;
$USER->logout();
die_info(get_string('accountsuspended', 'mahara', $suspendedctime, $suspendedreason));
}
// 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