mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 12:32:14 +09:00
Add Context::isLocked() to detect site lock easily
This commit is contained in:
parent
a3b557dcbc
commit
118b209042
1 changed files with 17 additions and 0 deletions
|
|
@ -152,6 +152,12 @@ class Context
|
||||||
*/
|
*/
|
||||||
public $is_uploaded = FALSE;
|
public $is_uploaded = FALSE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the site is locked
|
||||||
|
* @var bool TRUE if the site is locked
|
||||||
|
*/
|
||||||
|
public $is_site_locked = FALSE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pattern for request vars check
|
* Pattern for request vars check
|
||||||
* @var array
|
* @var array
|
||||||
|
|
@ -1482,6 +1488,7 @@ class Context
|
||||||
define('_XE_SITELOCK_TITLE_', config('lock.title') ?: self::getLang('admin.sitelock_in_use'));
|
define('_XE_SITELOCK_TITLE_', config('lock.title') ?: self::getLang('admin.sitelock_in_use'));
|
||||||
define('_XE_SITELOCK_MESSAGE_', config('lock.message'));
|
define('_XE_SITELOCK_MESSAGE_', config('lock.message'));
|
||||||
unset($_SESSION['XE_VALIDATOR_RETURN_URL']);
|
unset($_SESSION['XE_VALIDATOR_RETURN_URL']);
|
||||||
|
self::$_instance->is_site_locked = true;
|
||||||
|
|
||||||
// Load the sitelock template.
|
// Load the sitelock template.
|
||||||
if(FileHandler::exists(RX_BASEDIR . 'common/tpl/sitelock.user.html'))
|
if(FileHandler::exists(RX_BASEDIR . 'common/tpl/sitelock.user.html'))
|
||||||
|
|
@ -2472,6 +2479,16 @@ class Context
|
||||||
return (bool)config('config_version');
|
return (bool)config('config_version');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the site is locked
|
||||||
|
*
|
||||||
|
* @return bool True if the site is locked, otherwise false
|
||||||
|
*/
|
||||||
|
public static function isLocked()
|
||||||
|
{
|
||||||
|
return (bool)self::$_instance->is_site_locked;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transforms codes about widget or other features into the actual code, deprecatred
|
* Transforms codes about widget or other features into the actual code, deprecatred
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue