forked from kevinowino869/mitrobill
New Feature: Maintenance Mode
Maintenance Mode when enabled user/customer will not be able to login, a maintenance page will be displayed instead. but all admin users can login
This commit is contained in:
committed by
Ibnu Maksum
parent
0bad687f7a
commit
533d46bbf5
13
init.php
13
init.php
@ -322,3 +322,16 @@ function _alert($text, $type = 'success', $url = "home", $time = 3)
|
||||
if (!isset($api_secret)) {
|
||||
$api_secret = $db_password;
|
||||
}
|
||||
|
||||
function displayMaintenanceMessage(): void
|
||||
{
|
||||
global $config, $ui;
|
||||
$date = $config['maintenance_date'];
|
||||
if ($date){
|
||||
$ui->assign('date', $date);
|
||||
}
|
||||
http_response_code(503);
|
||||
$ui->assign('companyName', $config['CompanyName']);
|
||||
$ui->display('maintenance.tpl');
|
||||
die();
|
||||
}
|
||||
|
Reference in New Issue
Block a user