this is what we use for maintenance...
// User Logging In event
function User_LoggingIn($usr, &$pwd) {
if(_getPreferences('MAINTENANCE_MODE')) {
if( strtolower($usr) == strtolower(Config("ADMIN_USER_NAME"))) return true; // check if an administrator.. let them in
$this->terminate(_getPreferences("MAINTENANCE_MODE_REDIRECT"));
return FALSE;
}
OR
// Page_Load event
function Page_Load() {
if(_getPreferences('MAINTENANCE_MODE')) {
$this->terminate(_getPreferences("MAINTENANCE_MODE_REDIRECT_URL"));
return FALSE;
}
you could do this on the Page_Load event, but then there would be no check to see if its an admin trying to get into the system to disable the maintenance mode or do other tasks.... (unless you have a backdoor or direct access to the DB to change the maintenance mode flag -- then you can put it in page_load).
_getPreferences() is just a global function we use to get values from a table for various app settings, substitute with your logic
MAINTENANCE_MODE_REDIRECT = a web page or site that you want to display, page gets loaded and the function is set to fail the login and end...
just my 2 cents