diff options
author | redmatrix <git@macgirvin.com> | 2016-02-07 18:11:10 -0800 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-02-07 18:11:10 -0800 |
commit | d8e6fd5df0713ef4f52277944d15fd8230deec81 (patch) | |
tree | ad5cb27b976ab3670b86cfb2ddfface8f47cf559 | |
parent | ec950de2054243f22e7d6b30e4d7b9b41f293d4e (diff) | |
download | volse-hubzilla-d8e6fd5df0713ef4f52277944d15fd8230deec81.tar.gz volse-hubzilla-d8e6fd5df0713ef4f52277944d15fd8230deec81.tar.bz2 volse-hubzilla-d8e6fd5df0713ef4f52277944d15fd8230deec81.zip |
provide get_server_role() to abstract different roles and capabilities
-rwxr-xr-x | boot.php | 6 | ||||
-rw-r--r-- | include/identity.php | 2 | ||||
-rw-r--r-- | include/network.php | 1 | ||||
-rw-r--r-- | mod/import.php | 2 |
4 files changed, 9 insertions, 2 deletions
@@ -2394,3 +2394,9 @@ function get_site_icon() { return z_root() . '/images/hz-32.png'; } + +function get_server_role() { + if(UNO) + return 'basic'; + return 'advanced'; +} diff --git a/include/identity.php b/include/identity.php index 0b9842caf..641f188f4 100644 --- a/include/identity.php +++ b/include/identity.php @@ -484,7 +484,7 @@ function identity_basic_export($channel_id, $items = false) { // use constants here as otherwise we will have no idea if we can import from a site // with a non-standard platform and version. - $ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION, 'server_role' => UNO ); + $ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION, 'server_role' => get_server_role()); $r = q("select * from channel where channel_id = %d limit 1", intval($channel_id) diff --git a/include/network.php b/include/network.php index fe6b553e9..1d0159ea5 100644 --- a/include/network.php +++ b/include/network.php @@ -1805,6 +1805,7 @@ function get_site_info() { $data = Array( 'version' => $version, 'version_tag' => $tag, + 'server_role' => get_server_role(), 'commit' => $commit, 'url' => z_root(), 'plugins' => $visible_plugins, diff --git a/mod/import.php b/mod/import.php index 1a2c87a63..0bbd38ffe 100644 --- a/mod/import.php +++ b/mod/import.php @@ -120,7 +120,7 @@ function import_account(&$a, $account_id) { notice($t); } if(array_key_exists('server_role',$data['compatibility']) - && $data['compatibility']['server_role'] != UNO) { + && $data['compatibility']['server_role'] != get_server_role()) { notice( t('Server platform is not compatible. Operation not permitted.') . EOL); return; } |