use config system.server_role and deprecate 'UNO'
This commit is contained in:
@@ -407,7 +407,7 @@ function account_allow($hash) {
|
||||
|
||||
pop_lang();
|
||||
|
||||
if(get_config('system','auto_channel_create') || UNO)
|
||||
if(get_config('system','auto_channel_create') || get_config('system','server_role') === 'basic')
|
||||
auto_channel_create($register[0]['uid']);
|
||||
|
||||
if ($res) {
|
||||
@@ -511,7 +511,7 @@ function account_approve($hash) {
|
||||
|
||||
|
||||
|
||||
if(get_config('system','auto_channel_create') || UNO)
|
||||
if(get_config('system','auto_channel_create') || get_config('system','server_role') === 'basic')
|
||||
auto_channel_create($register[0]['uid']);
|
||||
else {
|
||||
$_SESSION['login_return_url'] = 'new_channel';
|
||||
|
||||
@@ -667,7 +667,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false)
|
||||
}
|
||||
|
||||
// Remove bookmarks from UNO
|
||||
if (UNO)
|
||||
if (get_config('system','server_role') === 'basic')
|
||||
$Text = str_replace('<span class="bookmark-identifier">#^</span>', '', $Text);
|
||||
|
||||
// Perform MAIL Search
|
||||
|
||||
@@ -423,14 +423,6 @@ function create_identity($arr) {
|
||||
set_pconfig($ret['channel']['channel_id'],'system','attach_path','%Y-%m');
|
||||
}
|
||||
|
||||
// UNO: channel defaults, incl addons (addons specific pconfig will only work after the relevant addon is enabled by the admin). It's located here, so members can modify these defaults after the channel is created.
|
||||
if(UNO) {
|
||||
//diaspora protocol addon
|
||||
set_pconfig($ret['channel']['channel_id'],'system','diaspora_allowed', '1');
|
||||
set_pconfig($ret['channel']['channel_id'],'system','diaspora_public_comments', '1');
|
||||
set_pconfig($ret['channel']['channel_id'],'system','prevent_tag_hijacking', '0');
|
||||
}
|
||||
|
||||
// auto-follow any of the hub's pre-configured channel choices.
|
||||
// Only do this if it's the first channel for this account;
|
||||
// otherwise it could get annoying. Don't make this list too big
|
||||
|
||||
@@ -1709,7 +1709,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){
|
||||
);
|
||||
}
|
||||
|
||||
if(feature_enabled($uid,'wiki') && (! UNO)) {
|
||||
if(feature_enabled($uid,'wiki') && (get_config('system','server_role') !== 'basic')) {
|
||||
$tabs[] = array(
|
||||
'label' => t('Wiki'),
|
||||
'url' => z_root() . '/wiki/' . $nickname,
|
||||
|
||||
@@ -38,7 +38,9 @@ function get_feature_default($feature) {
|
||||
|
||||
function get_features($filtered = true) {
|
||||
|
||||
if(UNO && $filtered)
|
||||
$server_role = get_config('system','server_role');
|
||||
|
||||
if($server_role === 'basic' && $filtered)
|
||||
return array();
|
||||
|
||||
$arr = array(
|
||||
@@ -52,7 +54,7 @@ function get_features($filtered = true) {
|
||||
array('advanced_profiles', t('Advanced Profiles'), t('Additional profile sections and selections'),false,get_config('feature_lock','advanced_profiles')),
|
||||
array('profile_export', t('Profile Import/Export'), t('Save and load profile details across sites/channels'),false,get_config('feature_lock','profile_export')),
|
||||
array('webpages', t('Web Pages'), t('Provide managed web pages on your channel'),false,get_config('feature_lock','webpages')),
|
||||
array('wiki', t('Wiki'), t('Provide a wiki for your channel'),((UNO) ? false : true),get_config('feature_lock','wiki')),
|
||||
array('wiki', t('Wiki'), t('Provide a wiki for your channel'),(($server_role === 'basic') ? false : true),get_config('feature_lock','wiki')),
|
||||
array('hide_rating', t('Hide Rating'), t('Hide the rating buttons on your channel and profile pages. Note: People can still rate you somewhere else.'),false,get_config('feature_lock','hide_rating')),
|
||||
array('private_notes', t('Private Notes'), t('Enables a tool to store notes and reminders (note: not encrypted)'),false,get_config('feature_lock','private_notes')),
|
||||
array('nav_channel_select', t('Navigation Channel Select'), t('Change channels directly from within the navigation dropdown menu'),false,get_config('feature_lock','nav_channel_select')),
|
||||
|
||||
@@ -61,13 +61,15 @@ EOT;
|
||||
'$banner' => $banner
|
||||
));
|
||||
|
||||
$server_role = get_config('system','server_role');
|
||||
$basic = (($server_role === 'basic') ? true : false);
|
||||
|
||||
// nav links: array of array('href', 'text', 'extra css classes', 'title')
|
||||
$nav = Array();
|
||||
|
||||
/**
|
||||
* Display login or logout
|
||||
*/
|
||||
*/
|
||||
|
||||
$nav['usermenu']=array();
|
||||
$userinfo = null;
|
||||
@@ -76,7 +78,7 @@ EOT;
|
||||
if(local_channel()) {
|
||||
|
||||
|
||||
if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select') && (! UNO))
|
||||
if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select') && (! $basic))
|
||||
$nav['channels'] = $chans;
|
||||
|
||||
$nav['logout'] = Array('logout',t('Logout'), "", t('End this session'),'logout_nav_btn');
|
||||
@@ -84,7 +86,7 @@ EOT;
|
||||
// user menu
|
||||
$nav['usermenu'][] = Array('channel/' . $channel['channel_address'], t('Home'), "", t('Your posts and conversations'),'channel_nav_btn');
|
||||
$nav['usermenu'][] = Array('profile/' . $channel['channel_address'], t('View Profile'), "", t('Your profile page'),'profile_nav_btn');
|
||||
if(feature_enabled(local_channel(),'multi_profiles') && (! UNO))
|
||||
if(feature_enabled(local_channel(),'multi_profiles') && (! $basic))
|
||||
$nav['usermenu'][] = Array('profiles', t('Edit Profiles'),"", t('Manage/Edit profiles'),'profiles_nav_btn');
|
||||
else
|
||||
$nav['usermenu'][] = Array('profiles/' . $prof[0]['id'], t('Edit Profile'),"", t('Edit your profile'),'profiles_nav_btn');
|
||||
@@ -92,19 +94,19 @@ EOT;
|
||||
$nav['usermenu'][] = Array('photos/' . $channel['channel_address'], t('Photos'), "", t('Your photos'),'photos_nav_btn');
|
||||
$nav['usermenu'][] = Array('cloud/' . $channel['channel_address'],t('Files'),"",t('Your files'),'cloud_nav_btn');
|
||||
|
||||
if((! UNO) && feature_enabled(local_channel(),'ajaxchat'))
|
||||
if((! $basic) && feature_enabled(local_channel(),'ajaxchat'))
|
||||
$nav['usermenu'][] = Array('chat/' . $channel['channel_address'], t('Chat'),"",t('Your chatrooms'),'chat_nav_btn');
|
||||
|
||||
|
||||
require_once('include/menu.php');
|
||||
$has_bookmarks = menu_list_count(local_channel(),'',MENU_BOOKMARK) + menu_list_count(local_channel(),'',MENU_SYSTEM|MENU_BOOKMARK);
|
||||
if(($has_bookmarks) && (! UNO)) {
|
||||
if(($has_bookmarks) && (! $basic)) {
|
||||
$nav['usermenu'][] = Array('bookmarks', t('Bookmarks'), "", t('Your bookmarks'),'bookmarks_nav_btn');
|
||||
}
|
||||
|
||||
if(feature_enabled($channel['channel_id'],'webpages') && (! UNO))
|
||||
if(feature_enabled($channel['channel_id'],'webpages') && (! $basic))
|
||||
$nav['usermenu'][] = Array('webpages/' . $channel['channel_address'],t('Webpages'),"",t('Your webpages'),'webpages_nav_btn');
|
||||
if(feature_enabled($channel['channel_id'],'wiki') && (! UNO))
|
||||
if(feature_enabled($channel['channel_id'],'wiki') && (! $basic))
|
||||
$nav['usermenu'][] = Array('wiki/' . $channel['channel_address'],t('Wiki'),"",t('Your wiki'),'wiki_nav_btn');
|
||||
}
|
||||
else {
|
||||
@@ -161,7 +163,7 @@ EOT;
|
||||
$nav['help'] = array($help_url, t('Help'), "", t('Help and documentation'), 'help_nav_btn', $context_help, $enable_context_help);
|
||||
}
|
||||
|
||||
if(! UNO)
|
||||
if(! $basic)
|
||||
$nav['apps'] = array('apps', t('Apps'), "", t('Applications, utilities, links, games'),'apps_nav_btn');
|
||||
|
||||
$nav['search'] = array('search', t('Search'), "", t('Search site @name, #tag, ?docs, content'));
|
||||
@@ -204,7 +206,7 @@ EOT;
|
||||
$nav['all_events']['all']=array('events', t('See all events'), "", "");
|
||||
$nav['all_events']['mark'] = array('', t('Mark all events seen'), '','');
|
||||
|
||||
if(! UNO)
|
||||
if(! $basic)
|
||||
$nav['manage'] = array('manage', t('Channel Manager'), "", t('Manage Your Channels'),'manage_nav_btn');
|
||||
|
||||
$nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings'),'settings_nav_btn');
|
||||
|
||||
@@ -595,7 +595,7 @@ function widget_settings_menu($arr) {
|
||||
}
|
||||
|
||||
// IF can go away when UNO export and import is fully functional
|
||||
if(! UNO) {
|
||||
if(get_config('system','server_role') !== 'basic') {
|
||||
$tabs[] = array(
|
||||
'label' => t('Export channel'),
|
||||
'url' => z_root() . '/uexport',
|
||||
@@ -609,7 +609,7 @@ function widget_settings_menu($arr) {
|
||||
'selected' => ((argv(1) === 'oauth') ? 'active' : ''),
|
||||
);
|
||||
|
||||
if(! UNO) {
|
||||
if(get_config('system','server_role') !== 'basic') {
|
||||
$tabs[] = array(
|
||||
'label' => t('Guest Access Tokens'),
|
||||
'url' => z_root() . '/settings/tokens',
|
||||
|
||||
@@ -2251,7 +2251,7 @@ function check_location_move($sender_hash,$locations) {
|
||||
if(! $locations)
|
||||
return;
|
||||
|
||||
if(! UNO)
|
||||
if(get_config('system','server_role') !== 'basic')
|
||||
return;
|
||||
|
||||
if(count($locations) != 1)
|
||||
@@ -2929,7 +2929,7 @@ function import_site($arr, $pubkey) {
|
||||
*/
|
||||
function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
|
||||
|
||||
if(UNO)
|
||||
if(get_config('system','server_role') === 'basic')
|
||||
return;
|
||||
|
||||
logger('build_sync_packet');
|
||||
@@ -3077,7 +3077,7 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
|
||||
*/
|
||||
function process_channel_sync_delivery($sender, $arr, $deliveries) {
|
||||
|
||||
if(UNO)
|
||||
if(get_config('system','server_role') === 'basic')
|
||||
return;
|
||||
|
||||
require_once('include/import.php');
|
||||
|
||||
Reference in New Issue
Block a user