diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-08-23 06:57:10 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-08-23 06:57:10 -0400 |
commit | 420aa4bc44a2fdf707b3964582258809f978ea2d (patch) | |
tree | c6def258a9311d513d6e1e89918c2ec0d17114f7 /boot.php | |
parent | 305e0538d293ff4ad72f30b11998ae3b06efa4ea (diff) | |
parent | 1e6a491400eaa01aeb2991d4b38e0255499d8b67 (diff) | |
download | volse-hubzilla-420aa4bc44a2fdf707b3964582258809f978ea2d.tar.gz volse-hubzilla-420aa4bc44a2fdf707b3964582258809f978ea2d.tar.bz2 volse-hubzilla-420aa4bc44a2fdf707b3964582258809f978ea2d.zip |
Merge remote-tracking branch 'upstream/dev' into website-export
Diffstat (limited to 'boot.php')
-rwxr-xr-x | boot.php | 49 |
1 files changed, 37 insertions, 12 deletions
@@ -150,15 +150,6 @@ define ( 'MAX_IMAGE_LENGTH', -1 ); define ( 'DEFAULT_DB_ENGINE', 'MyISAM' ); /** - * SSL redirection policies - */ - -define ( 'SSL_POLICY_NONE', 0 ); -define ( 'SSL_POLICY_FULL', 1 ); -define ( 'SSL_POLICY_SELFSIGN', 2 ); // NOT supported in Red - - -/** * log levels */ @@ -168,6 +159,15 @@ define ( 'LOGGER_DEBUG', 2 ); define ( 'LOGGER_DATA', 3 ); define ( 'LOGGER_ALL', 4 ); + +/** + * Server roles + */ + +define ( 'SERVER_ROLE_BASIC', 0x0001 ); +define ( 'SERVER_ROLE_STANDARD', 0x0002 ); +define ( 'SERVER_ROLE_PRO', 0x0004 ); + /** * registration policies */ @@ -612,11 +612,11 @@ function sys_boot() { if(UNO) App::$config['system']['server_role'] = 'basic'; else - App::$config['system']['server_role'] = 'pro'; + App::$config['system']['server_role'] = 'standard'; } if(! (array_key_exists('server_role',App::$config['system']) && App::$config['system']['server_role'])) - App::$config['system']['server_role'] = 'pro'; + App::$config['system']['server_role'] = 'standard'; App::$timezone = ((App::$config['system']['timezone']) ? App::$config['system']['timezone'] : 'UTC'); date_default_timezone_set(App::$timezone); @@ -760,7 +760,7 @@ class miniApp { class App { public static $install = false; // true if we are installing the software - + public static $role = 0; // server role (constant, not the string) public static $account = null; // account record of the logged-in account public static $channel = null; // channel record of the current channel of the logged-in account public static $observer = null; // xchan record of the page observer @@ -1044,6 +1044,31 @@ class App { } } + public static function get_role() { + if(! self::$role) + return self::set_role(); + return self::$role; + } + + public static function set_role() { + $role_str = \Zotlabs\Lib\System::get_server_role(); + switch($role_str) { + case 'basic': + $role = SERVER_ROLE_BASIC; + break; + case 'pro': + $role = SERVER_ROLE_PRO; + break; + case 'standard': + default: + $role = SERVER_ROLE_STANDARD; + break; + } + self::$role = $role; + return $role; + } + + public static function get_scheme() { return self::$scheme; } |