Maintenance Mode not for admin

joelfcarvalho3427

New Member
YetiShare User
Jan 7, 2014
18
0
0
Hello.

I need to be working around on the site but keep it in maintenance mode. But it seems I can only do this on the back-end and not on the front-end. If you do some modification, you want to check it out before going live, right? Am I overlooking something or it is not currently possible?

Maybe the script should keep the maintenance mode off for logged-in admin users?
Or the maintenance mode switch have an additional option: Yes / No / Yes except admins
Or maybe create a new field on the settings to set an exclusion IP (or range) for which the maintenance mode would be off?

Is there a way?
 

adam

Administrator
Staff member
Dec 5, 2009
2,046
108
63
You can tweak the code to allow access for admin users, you'll need to login via the /admin/ pages though.

Open include/master.inc.php
Find and delete:

Code:
// check for maintenance mode
if(SITE_CONFIG_MAINTENANCE_MODE == 'yes')
{
    showMaintenancePage();
}
In the same file, find:

Code:
$Auth = Auth::getAuth();
After add:

Code:
// check for maintenance mode
if((SITE_CONFIG_MAINTENANCE_MODE == 'yes') && ($Auth->level_id <= 2))
{
    showMaintenancePage();
}
This will show the maintenance page for any non, free and paid users.