start deprecation of server_role

This commit is contained in:
zotlabs 2017-05-29 13:50:02 -07:00
parent b15a5f03e6
commit 4fcfcc8117
13 changed files with 23 additions and 76 deletions

View File

@ -251,8 +251,6 @@ class ThreadItem {
); );
} }
$server_role = get_config('system','server_role');
$has_bookmarks = false; $has_bookmarks = false;
if(is_array($item['term'])) { if(is_array($item['term'])) {
foreach($item['term'] as $t) { foreach($item['term'] as $t) {

View File

@ -17,7 +17,6 @@ class Site {
check_form_security_token_redirectOnErr('/admin/site', 'admin_site'); check_form_security_token_redirectOnErr('/admin/site', 'admin_site');
$sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : ''); $sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : '');
$server_role = ((x($_POST,'server_role')) ? notags(trim($_POST['server_role'])) : 'standard');
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false); $banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
@ -68,7 +67,6 @@ class Site {
if(array_key_exists('techlevel', $_POST)) if(array_key_exists('techlevel', $_POST))
$techlevel = intval($_POST['techlevel']); $techlevel = intval($_POST['techlevel']);
set_config('system', 'server_role', $server_role);
set_config('system', 'feed_contacts', $feed_contacts); set_config('system', 'feed_contacts', $feed_contacts);
set_config('system', 'delivery_interval', $delivery_interval); set_config('system', 'delivery_interval', $delivery_interval);
set_config('system', 'delivery_batch_count', $delivery_batch_count); set_config('system', 'delivery_batch_count', $delivery_batch_count);
@ -254,12 +252,6 @@ class Site {
// now invert the logic for the setting. // now invert the logic for the setting.
$discover_tab = (1 - $discover_tab); $discover_tab = (1 - $discover_tab);
$server_roles = [
'basic' => t('Basic/Minimal Social Networking'),
'standard' => t('Standard Configuration (default)'),
'pro' => t('Professional')
];
$techlevels = [ $techlevels = [
'0' => t('Beginner/Basic'), '0' => t('Beginner/Basic'),
'1' => t('Novice - not skilled but willing to learn'), '1' => t('Novice - not skilled but willing to learn'),
@ -286,8 +278,6 @@ class Site {
// name, label, value, help string, extra data... // name, label, value, help string, extra data...
'$sitename' => array('sitename', t("Site name"), htmlspecialchars(get_config('system','sitename'), ENT_QUOTES, 'UTF-8'),''), '$sitename' => array('sitename', t("Site name"), htmlspecialchars(get_config('system','sitename'), ENT_QUOTES, 'UTF-8'),''),
'$server_role' => array('server_role', t("Server Configuration/Role"), get_config('system','server_role'),'',$server_roles),
'$techlevel' => [ 'techlevel', t('Site default technical skill level'), get_config('system','techlevel'), t('Used to provide a member experience matched to technical comfort level'), $techlevels ], '$techlevel' => [ 'techlevel', t('Site default technical skill level'), get_config('system','techlevel'), t('Used to provide a member experience matched to technical comfort level'), $techlevels ],
'$techlock' => [ 'techlock', t('Lock the technical skill level setting'), get_config('system','techlevel_lock'), t('Members can set their own technical comfort level by default') ], '$techlock' => [ 'techlock', t('Lock the technical skill level setting'), get_config('system','techlevel_lock'), t('Members can set their own technical comfort level by default') ],

View File

@ -117,12 +117,8 @@ class Chanview extends \Zotlabs\Web\Controller {
// the remote profile. // the remote profile.
// Zot channels will usually have a connect link. // Zot channels will usually have a connect link.
// If it isn't zot, 'pro' members won't be able to use the connect
// button as it is a foreign network so just send them to the remote
// profile.
if($is_zot) {
if($is_zot || \Zotlabs\Lib\System::get_server_role() === 'pro') {
if($is_zot && $observer) { if($is_zot && $observer) {
$url = zid($url); $url = zid($url);
} }

View File

@ -121,8 +121,7 @@ class Import extends \Zotlabs\Web\Controller {
$t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 ); $t = sprintf( t('Warning: Database versions differ by %1$d updates.'), $v2 - $v1 );
notice($t); notice($t);
} }
if(array_key_exists('server_role',$data['compatibility']) && $data['compatibility']['server_role'] == 'basic')
$moving = true;
} }
if($moving) if($moving)

View File

@ -151,7 +151,7 @@ class Register extends \Zotlabs\Web\Controller {
$new_channel = false; $new_channel = false;
$next_page = 'new_channel'; $next_page = 'new_channel';
if(get_config('system','auto_channel_create') || get_config('system','server_role') == 'basic') { if(get_config('system','auto_channel_create')) {
$new_channel = auto_channel_create($result['account']['account_id']); $new_channel = auto_channel_create($result['account']['account_id']);
if($new_channel['success']) { if($new_channel['success']) {
$channel_id = $new_channel['channel']['channel_id']; $channel_id = $new_channel['channel']['channel_id'];
@ -240,11 +240,9 @@ class Register extends \Zotlabs\Web\Controller {
$role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/member/member_guide#Account_Permission_Roles" target="_blank">' . t('Read more about roles') . '</a>',$perm_roles); $role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/member/member_guide#Account_Permission_Roles" target="_blank">' . t('Read more about roles') . '</a>',$perm_roles);
$tos = array('tos', $label_tos, '', '', array(t('no'),t('yes'))); $tos = array('tos', $label_tos, '', '', array(t('no'),t('yes')));
$server_role = get_config('system','server_role');
$auto_create = (get_config('system','auto_channel_create') ? true : false);
$auto_create = (($server_role == 'basic') || (get_config('system','auto_channel_create')) ? true : false); $default_role = get_config('system','default_permissions_role');
$default_role = (($server_role == 'basic') ? 'social' : get_config('system','default_permissions_role'));
require_once('include/bbcode.php'); require_once('include/bbcode.php');

View File

@ -489,7 +489,6 @@ class Channel {
'$h_prv' => t('Security and Privacy Settings'), '$h_prv' => t('Security and Privacy Settings'),
'$permissions_set' => $permissions_set, '$permissions_set' => $permissions_set,
'$server_role' => \Zotlabs\Lib\System::get_server_role(),
'$perms_set_msg' => t('Your permissions are already configured. Click to view/adjust'), '$perms_set_msg' => t('Your permissions are already configured. Click to view/adjust'),
'$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents displaying in your profile that you are online'), $yes_no), '$hide_presence' => array('hide_presence', t('Hide my online presence'),$hide_presence, t('Prevents displaying in your profile that you are online'), $yes_no),

View File

@ -73,9 +73,6 @@ class Setup extends \Zotlabs\Web\Controller {
$phpath = trim($_POST['phpath']); $phpath = trim($_POST['phpath']);
$adminmail = trim($_POST['adminmail']); $adminmail = trim($_POST['adminmail']);
$siteurl = trim($_POST['siteurl']); $siteurl = trim($_POST['siteurl']);
$server_role = trim($_POST['server_role']);
if(! $server_role)
$server_role = 'standard';
// $siteurl should not have a trailing slash // $siteurl should not have a trailing slash
@ -103,9 +100,6 @@ class Setup extends \Zotlabs\Web\Controller {
$timezone = trim($_POST['timezone']); $timezone = trim($_POST['timezone']);
$adminmail = trim($_POST['adminmail']); $adminmail = trim($_POST['adminmail']);
$siteurl = trim($_POST['siteurl']); $siteurl = trim($_POST['siteurl']);
$server_role = trim($_POST['server_role']);
if(! $server_role)
$server_role = 'standard';
if($siteurl != z_root()) { if($siteurl != z_root()) {
$test = z_fetch_url($siteurl."/setup/testrewrite"); $test = z_fetch_url($siteurl."/setup/testrewrite");
@ -134,7 +128,7 @@ class Setup extends \Zotlabs\Web\Controller {
'$dbpass' => $dbpass, '$dbpass' => $dbpass,
'$dbdata' => $dbdata, '$dbdata' => $dbdata,
'$dbtype' => $dbtype, '$dbtype' => $dbtype,
'$server_role' => $server_role, '$server_role' => 'pro',
'$timezone' => $timezone, '$timezone' => $timezone,
'$siteurl' => $siteurl, '$siteurl' => $siteurl,
'$site_id' => random_string(), '$site_id' => random_string(),

View File

@ -424,7 +424,7 @@ function account_allow($hash) {
pop_lang(); pop_lang();
if(get_config('system','auto_channel_create') || get_config('system','server_role') === 'basic') if(get_config('system','auto_channel_create'))
auto_channel_create($register[0]['uid']); auto_channel_create($register[0]['uid']);
if ($res) { if ($res) {
@ -528,7 +528,7 @@ function account_approve($hash) {
if(get_config('system','auto_channel_create') || get_config('system','server_role') === 'basic') if(get_config('system','auto_channel_create'))
auto_channel_create($register[0]['uid']); auto_channel_create($register[0]['uid']);
else { else {
$_SESSION['login_return_url'] = 'new_channel'; $_SESSION['login_return_url'] = 'new_channel';
@ -772,12 +772,6 @@ function upgrade_bool_message($bbcode = false) {
function get_account_techlevel($account_id = 0) { function get_account_techlevel($account_id = 0) {
$role = \Zotlabs\Lib\System::get_server_role();
if($role == 'basic')
return 0;
if($role == 'standard')
return 5;
if(! $account_id) { if(! $account_id) {
$x = \App::get_account(); $x = \App::get_account();
} }

View File

@ -45,10 +45,6 @@ function feature_level($feature,$def) {
function get_features($filtered = true) { function get_features($filtered = true) {
$server_role = \Zotlabs\Lib\System::get_server_role();
if($server_role === 'basic' && $filtered)
return array();
$arr = [ $arr = [
@ -424,16 +420,15 @@ function get_features($filtered = true) {
]; ];
if($server_role === 'pro') { $arr['general'][] = [
$arr['general'][] = [ 'premium_channel',
'premium_channel', t('Premium Channel'),
t('Premium Channel'), t('Allows you to set restrictions and terms on those that connect with your channel'),
t('Allows you to set restrictions and terms on those that connect with your channel'), false,
false, get_config('feature_lock','premium_channel'),
get_config('feature_lock','premium_channel'), feature_level('premium_channel',4),
feature_level('premium_channel',4), ];
];
}
$techlevel = get_account_techlevel(); $techlevel = get_account_techlevel();

View File

@ -65,8 +65,6 @@ EOT;
//we could additionally use this to display important system notifications e.g. for updates //we could additionally use this to display important system notifications e.g. for updates
)); ));
$server_role = get_config('system','server_role');
$basic = (($server_role === 'basic') ? true : false);
$techlevel = get_account_techlevel(); $techlevel = get_account_techlevel();
// nav links: array of array('href', 'text', 'extra css classes', 'title') // nav links: array of array('href', 'text', 'extra css classes', 'title')
@ -97,7 +95,7 @@ EOT;
if(local_channel()) { if(local_channel()) {
if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select') && (! $basic)) if($chans && count($chans) > 1 && feature_enabled(local_channel(),'nav_channel_select'))
$nav['channels'] = $chans; $nav['channels'] = $chans;
$nav['logout'] = ['logout',t('Logout'), "", t('End this session'),'logout_nav_btn']; $nav['logout'] = ['logout',t('Logout'), "", t('End this session'),'logout_nav_btn'];
@ -105,7 +103,7 @@ EOT;
// user menu // user menu
$nav['usermenu'][] = ['profile/' . $channel['channel_address'], t('View Profile'), "", t('Your profile page'),'profile_nav_btn']; $nav['usermenu'][] = ['profile/' . $channel['channel_address'], t('View Profile'), "", t('Your profile page'),'profile_nav_btn'];
if(feature_enabled(local_channel(),'multi_profiles') && (! $basic)) if(feature_enabled(local_channel(),'multi_profiles'))
$nav['usermenu'][] = ['profiles', t('Edit Profiles'),"", t('Manage/Edit profiles'),'profiles_nav_btn']; $nav['usermenu'][] = ['profiles', t('Edit Profiles'),"", t('Manage/Edit profiles'),'profiles_nav_btn'];
else else
$nav['usermenu'][] = ['profiles/' . $prof[0]['id'], t('Edit Profile'),"", t('Edit your profile'),'profiles_nav_btn']; $nav['usermenu'][] = ['profiles/' . $prof[0]['id'], t('Edit Profile'),"", t('Edit your profile'),'profiles_nav_btn'];
@ -201,8 +199,7 @@ EOT;
$nav['all_events']['all']=array('events', t('View events'), "", ""); $nav['all_events']['all']=array('events', t('View events'), "", "");
$nav['all_events']['mark'] = array('', t('Mark all events seen'), '',''); $nav['all_events']['mark'] = array('', t('Mark all events seen'), '','');
if(! $basic) $nav['manage'] = array('manage', t('Channel Manager'), "", t('Manage Your Channels'),'manage_nav_btn');
$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'); $nav['settings'] = array('settings', t('Settings'),"", t('Account/Channel Settings'),'settings_nav_btn');

View File

@ -2237,9 +2237,6 @@ function check_location_move($sender_hash,$locations) {
if(! $locations) if(! $locations)
return; return;
if(get_config('system','server_role') !== 'basic')
return;
if(count($locations) != 1) if(count($locations) != 1)
return; return;
@ -2935,8 +2932,6 @@ function import_site($arr, $pubkey) {
function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
if(get_config('system','server_role') === 'basic')
return;
logger('build_sync_packet'); logger('build_sync_packet');
@ -3086,8 +3081,6 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
function process_channel_sync_delivery($sender, $arr, $deliveries) { function process_channel_sync_delivery($sender, $arr, $deliveries) {
if(get_config('system','server_role') === 'basic')
return;
require_once('include/import.php'); require_once('include/import.php');

View File

@ -41,12 +41,9 @@
<input type='hidden' name='form_security_token' value='{{$form_security_token}}'> <input type='hidden' name='form_security_token' value='{{$form_security_token}}'>
{{include file="field_input.tpl" field=$sitename}} {{include file="field_input.tpl" field=$sitename}}
{{include file="field_select.tpl" field=$server_role}}
{{if $z_server_role == 'pro'}}
{{include file="field_select.tpl" field=$techlevel}} {{include file="field_select.tpl" field=$techlevel}}
{{include file="field_checkbox.tpl" field=$techlock}} {{include file="field_checkbox.tpl" field=$techlock}}
{{/if}}
{{include file="field_textarea.tpl" field=$banner}} {{include file="field_textarea.tpl" field=$banner}}
{{include file="field_textarea.tpl" field=$siteinfo}} {{include file="field_textarea.tpl" field=$siteinfo}}

View File

@ -1,6 +1,6 @@
<div class="generic-content-wrapper"> <div class="generic-content-wrapper">
<div class="section-title-wrapper"> <div class="section-title-wrapper">
{{if $server_role != 'basic'}}<a title="{{$removechannel}}" class="btn btn-danger btn-sm pull-right" href="removeme"><i class="fa fa-trash-o"></i>&nbsp;{{$removeme}}</a>{{/if}} <a title="{{$removechannel}}" class="btn btn-danger btn-sm pull-right" href="removeme"><i class="fa fa-trash-o"></i>&nbsp;{{$removeme}}</a>
<h2>{{$ptitle}}</h2> <h2>{{$ptitle}}</h2>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
@ -44,12 +44,9 @@
</div> </div>
<div id="privacy-settings-collapse" class="collapse" role="tabpanel" aria-labelledby="privacy-settings"> <div id="privacy-settings-collapse" class="collapse" role="tabpanel" aria-labelledby="privacy-settings">
<div class="section-content-tools-wrapper"> <div class="section-content-tools-wrapper">
{{if $server_role != 'basic'}}
{{include file="field_select_grouped.tpl" field=$role}} {{include file="field_select_grouped.tpl" field=$role}}
{{/if}} <div id="advanced-perm" style="display:{{if $permissions_set}}none{{else}}block{{/if}};">
<div id="advanced-perm" style="display:{{if $permissions_set && $server_role != 'basic' }}none{{else}}block{{/if}};">
{{if $server_role != 'basic'}}
<div class="form-group"> <div class="form-group">
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#apsModal">{{$lbl_p2macro}}</button> <button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#apsModal">{{$lbl_p2macro}}</button>
</div> </div>
@ -71,7 +68,7 @@
</div><!-- /.modal-content --> </div><!-- /.modal-content -->
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->
</div><!-- /.modal --> </div><!-- /.modal -->
{{/if}}
<div id="settings-default-perms" class="form-group" > <div id="settings-default-perms" class="form-group" >
<button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#aclModal"><i id="jot-perms-icon" class="fa"></i>&nbsp;{{$permissions}}</button> <button type="button" class="btn btn-outline-secondary" data-toggle="modal" data-target="#aclModal"><i id="jot-perms-icon" class="fa"></i>&nbsp;{{$permissions}}</button>
</div> </div>