Commit 097d50bb authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fail login form submission and add error message when site is closed


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent ad3ba556
......@@ -782,6 +782,18 @@ class LiveUser extends User {
throw new AuthUnknownUserException("\"$username\" is not known");
}
$siteclosedforupgrade = get_config('siteclosed');
if ($siteclosedforupgrade && get_config('disablelogin')) {
global $SESSION;
$SESSION->add_error_msg(get_string('siteclosedlogindisabled'));
return false;
}
if (!$user->admin && ($siteclosedforupgrade || get_config('siteclosedbyadmin'))) {
global $SESSION;
$SESSION->add_error_msg(get_string('siteclosed'));
return false;
}
// Authentication instances that have parents do so because they cannot
// use Mahara's normal login mechanism - for example, XMLRPC. If the
// user is using one of these authentication instances, we look and try
......
Supports Markdown
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