Commit 1ba4bc99 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie

Updated for account deleted status and new rule for account suspension.

Added a class that all auth classes should extend, that listens for events
to do with account activity.
parent d393a131
......@@ -577,6 +577,11 @@ function login_submit($values) {
redirect(get_config('wwwroot'));
}
// Check if the user's account has been deleted
if ($userdata->deleted) {
die_info(get_string('accountdeleted'));
}
// Check if the user's account has expired
if ($userdata->expiry > 0 && time() > $userdata->expiry) {
die_info(get_string('accountexpired'));
......@@ -590,12 +595,8 @@ function login_submit($values) {
}
// Check if the user's account has been suspended
// Note: only the internal authentication method can say if a user is suspended for now.
// There are problems with how searching excluding suspended users will work that would
// need to be resolved before this could be implemented for all methods
// @todo TEST THIS
if ($suspend = get_record('usr_suspension', 'usr', $userdata->id)) {
die_info(get_string('accountsuspended', 'mahara', $suspend->ctime, $suspend->reason));
if ($userdata->suspendedcusr) {
die_info(get_string('accountsuspended', 'mahara', $userdata->suspendedctime, $userdata->suspendedreason));
}
// User is allowed to log in
......@@ -679,4 +680,20 @@ function auth_handle_account_expiries() {
}
}
class PluginAuth extends Plugin {
public static function get_event_subscriptions() {
$activecheck = new StdClass;
$activecheck->plugin = 'internal';
$activecheck->event = 'suspenduser';
$activecheck->callfunction = 'update_active_flag';
}
public static function update_active_flag($event, $userid) {
log_debug('update_active_flag: ' . $event . ', ' . $userid);
}
}
?>
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