diff options
author | redmatrix <git@macgirvin.com> | 2016-08-22 16:21:07 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-08-22 16:21:07 -0700 |
commit | d177cf94dacb518efae1e78bc0ceff99b880484d (patch) | |
tree | abbf6ec45b7e456e1b10023628c19c4f5a72090a | |
parent | a3e0e67953da3450fcc82c22b87b7b677454ccb8 (diff) | |
download | volse-hubzilla-d177cf94dacb518efae1e78bc0ceff99b880484d.tar.gz volse-hubzilla-d177cf94dacb518efae1e78bc0ceff99b880484d.tar.bz2 volse-hubzilla-d177cf94dacb518efae1e78bc0ceff99b880484d.zip |
server role management, part 1
-rw-r--r-- | Zotlabs/Lib/System.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Setup.php | 2 | ||||
-rwxr-xr-x | boot.php | 45 |
3 files changed, 37 insertions, 12 deletions
diff --git a/Zotlabs/Lib/System.php b/Zotlabs/Lib/System.php index 4479bf597..6ccfd664c 100644 --- a/Zotlabs/Lib/System.php +++ b/Zotlabs/Lib/System.php @@ -45,7 +45,7 @@ class System { static public function get_server_role() { if(is_array(\App::$config) && is_array(\App::$config['system']) && \App::$config['system']['server_role']) return \App::$config['system']['server_role']; - return 'pro'; + return 'standard'; } static public function get_std_version() { diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php index 4553b6866..cb43b5c20 100644 --- a/Zotlabs/Module/Setup.php +++ b/Zotlabs/Module/Setup.php @@ -101,7 +101,7 @@ class Setup extends \Zotlabs\Web\Controller { $timezone = notags(trim($_POST['timezone'])); $adminmail = notags(trim($_POST['adminmail'])); $siteurl = notags(trim($_POST['siteurl'])); - $advanced = ((intval($_POST['advanced'])) ? 'pro' : 'basic'); + $advanced = ((intval($_POST['advanced'])) ? 'standard' : 'basic'); if($siteurl != z_root()) { $test = z_fetch_url($siteurl."/setup/testrewrite"); @@ -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 */ @@ -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; } |