diff options
author | M. Dent <dentm42@gmail.com> | 2018-09-29 00:17:55 +0200 |
---|---|---|
committer | M. Dent <dentm42@gmail.com> | 2018-09-29 00:17:55 +0200 |
commit | ba4a8aa7623038fd9926b58d826e7cb733176b48 (patch) | |
tree | b714359bdc9c056376c6f3780e8edb0e066bf73f | |
parent | 2904e58a9fea6441202d1f9f7a3304a2d2b1429c (diff) | |
parent | 5f992ffe154ed9e2b225c9a1b3d7c47d39e41d34 (diff) | |
download | volse-hubzilla-ba4a8aa7623038fd9926b58d826e7cb733176b48.tar.gz volse-hubzilla-ba4a8aa7623038fd9926b58d826e7cb733176b48.tar.bz2 volse-hubzilla-ba4a8aa7623038fd9926b58d826e7cb733176b48.zip |
Merge branch 'remove-servicelevel-logic' into 'dev'
Remove servicelevel logic
See merge request hubzilla/core!1291
-rw-r--r-- | Zotlabs/Lib/ThreadItem.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Admin/Account_edit.php | 5 | ||||
-rw-r--r-- | Zotlabs/Module/Admin/Site.php | 24 | ||||
-rw-r--r-- | Zotlabs/Module/Item.php | 22 | ||||
-rw-r--r-- | Zotlabs/Module/Mail.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/New_channel.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Register.php | 5 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Account.php | 15 | ||||
-rw-r--r-- | Zotlabs/Module/Settings/Channel.php | 7 | ||||
-rw-r--r-- | include/account.php | 13 | ||||
-rw-r--r-- | include/bbcode.php | 3 | ||||
-rw-r--r-- | include/features.php | 5 | ||||
-rw-r--r-- | include/nav.php | 2 | ||||
-rw-r--r-- | view/tpl/admin_account_edit.tpl | 1 | ||||
-rwxr-xr-x | view/tpl/admin_site.tpl | 3 | ||||
-rwxr-xr-x | view/tpl/settings_account.tpl | 6 |
16 files changed, 8 insertions, 109 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index ac24806a6..48018f66c 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -274,7 +274,7 @@ class ThreadItem { $has_bookmarks = false; if(is_array($item['term'])) { foreach($item['term'] as $t) { - if((get_account_techlevel() > 0) && ($t['ttype'] == TERM_BOOKMARK)) + if(($t['ttype'] == TERM_BOOKMARK)) $has_bookmarks = true; } } diff --git a/Zotlabs/Module/Admin/Account_edit.php b/Zotlabs/Module/Admin/Account_edit.php index 6dfadf183..0300fb10c 100644 --- a/Zotlabs/Module/Admin/Account_edit.php +++ b/Zotlabs/Module/Admin/Account_edit.php @@ -31,7 +31,7 @@ class Account_edit { } $service_class = trim($_REQUEST['service_class']); - $account_level = intval(trim($_REQUEST['account_level'])); + $account_level = 5; $account_language = trim($_REQUEST['account_language']); $r = q("update account set account_service_class = '%s', account_level = %d, account_language = '%s' @@ -68,7 +68,6 @@ class Account_edit { '$title' => t('Account Edit'), '$pass1' => [ 'pass1', t('New Password'), ' ','' ], '$pass2' => [ 'pass2', t('New Password again'), ' ','' ], - '$account_level' => [ 'account_level', t('Technical skill level'), $x[0]['account_level'], '', \Zotlabs\Lib\Techlevels::levels() ], '$account_language' => [ 'account_language' , t('Account language (for emails)'), $x[0]['account_language'], '', language_list() ], '$service_class' => [ 'service_class', t('Service class'), $x[0]['account_service_class'], '' ], '$submit' => t('Submit'), @@ -81,4 +80,4 @@ class Account_edit { } -}
\ No newline at end of file +} diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php index 5912a7c97..e67f9f165 100644 --- a/Zotlabs/Module/Admin/Site.php +++ b/Zotlabs/Module/Admin/Site.php @@ -72,7 +72,6 @@ class Site { $maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50); $feed_contacts = ((x($_POST,'feed_contacts')) ? intval($_POST['feed_contacts']) : 0); $verify_email = ((x($_POST,'verify_email')) ? 1 : 0); - $techlevel_lock = ((x($_POST,'techlock')) ? intval($_POST['techlock']) : 0); $imagick_path = ((x($_POST,'imagick_path')) ? trim($_POST['imagick_path']) : ''); $thumbnail_security = ((x($_POST,'thumbnail_security')) ? intval($_POST['thumbnail_security']) : 0); $force_queue = ((intval($_POST['force_queue']) > 0) ? intval($_POST['force_queue']) : 3000); @@ -81,10 +80,6 @@ class Site { $permissions_role = escape_tags(trim($_POST['permissions_role'])); - $techlevel = null; - if(array_key_exists('techlevel', $_POST)) - $techlevel = intval($_POST['techlevel']); - set_config('system', 'feed_contacts', $feed_contacts); set_config('system', 'delivery_interval', $delivery_interval); set_config('system', 'delivery_batch_count', $delivery_batch_count); @@ -110,12 +105,6 @@ class Site { set_config('system', 'pubstream_incl',$pub_incl); set_config('system', 'pubstream_excl',$pub_excl); - set_config('system', 'techlevel_lock', $techlevel_lock); - - - - if(! is_null($techlevel)) - set_config('system', 'techlevel', $techlevel); if($directory_server) set_config('system','directory_server',$directory_server); @@ -284,15 +273,6 @@ class Site { // now invert the logic for the setting. $discover_tab = (1 - $discover_tab); - $techlevels = [ - '0' => t('Beginner/Basic'), - '1' => t('Novice - not skilled but willing to learn'), - '2' => t('Intermediate - somewhat comfortable'), - '3' => t('Advanced - very comfortable'), - '4' => t('Expert - I can write computer code'), - '5' => t('Wizard - I probably know more than you do') - ]; - $perm_roles = \Zotlabs\Access\PermissionRoles::roles(); $default_role = get_config('system','default_permissions_role','social'); @@ -316,10 +296,6 @@ class Site { // name, label, value, help string, extra data... '$sitename' => array('sitename', t("Site name"), htmlspecialchars(get_config('system','sitename'), ENT_QUOTES, 'UTF-8'),''), - '$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') ], - '$banner' => array('banner', t("Banner/Logo"), $banner, t('Unfiltered HTML/CSS/JS is allowed')), '$admininfo' => array('admininfo', t("Administrator Information"), $admininfo, t("Contact information for site administrators. Displayed on siteinfo page. BBCode can be used here")), '$siteinfo' => array('siteinfo', t('Site Information'), get_config('system','siteinfo'), t("Publicly visible description of this site. Displayed on siteinfo page. BBCode can be used here")), diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index a24d6da9c..2ee639874 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -1165,28 +1165,6 @@ class Item extends \Zotlabs\Web\Controller { return $ret; } - // auto-upgrade beginner (techlevel 0) accounts - if they have at least two friends and ten posts - // and have uploaded something (like a profile photo), promote them to level 1. - - $a = q("select account_id, account_level from account where account_id = (select channel_account_id from channel where channel_id = %d limit 1)", - intval($channel_id) - ); - if((! intval($a[0]['account_level'])) && intval($r[0]['total']) > 10) { - $x = q("select count(abook_id) as total from abook where abook_channel = %d", - intval($channel_id) - ); - if($x && intval($x[0]['total']) > 2) { - $y = q("select count(id) as total from attach where uid = %d", - intval($channel_id) - ); - if($y && intval($y[0]['total']) > 1) { - q("update account set account_level = 1 where account_id = %d limit 1", - intval($a[0]['account_id']) - ); - } - } - } - if (!$iswebpage) { $max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items')); if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) { diff --git a/Zotlabs/Module/Mail.php b/Zotlabs/Module/Mail.php index ca183f644..d38c1d88c 100644 --- a/Zotlabs/Module/Mail.php +++ b/Zotlabs/Module/Mail.php @@ -393,7 +393,7 @@ class Mail extends \Zotlabs\Web\Controller { 'delete' => t('Delete message'), 'dreport' => t('Delivery report'), 'recall' => t('Recall message'), - 'can_recall' => (($channel['channel_hash'] == $message['from_xchan'] && get_account_techlevel() > 0) ? true : false), + 'can_recall' => ($channel['channel_hash'] == $message['from_xchan']), 'is_recalled' => (intval($message['mail_recalled']) ? t('Message has been recalled.') : ''), 'date' => datetime_convert('UTC',date_default_timezone_get(),$message['created'], 'c'), ); diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php index ebdd6c37f..a9022a03a 100644 --- a/Zotlabs/Module/New_channel.php +++ b/Zotlabs/Module/New_channel.php @@ -171,8 +171,6 @@ class New_channel extends \Zotlabs\Web\Controller { $privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : "" ); $perm_roles = \Zotlabs\Access\PermissionRoles::roles(); - if((get_account_techlevel() < 4) && $privacy_role !== 'custom') - unset($perm_roles[t('Other')]); $name = array('name', t('Channel name'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), $name_help, "*"); $nickhub = '@' . \App::get_hostname(); diff --git a/Zotlabs/Module/Register.php b/Zotlabs/Module/Register.php index 3dded19c7..f9d81be0c 100644 --- a/Zotlabs/Module/Register.php +++ b/Zotlabs/Module/Register.php @@ -227,11 +227,6 @@ class Register extends \Zotlabs\Web\Controller { $perm_roles = \Zotlabs\Access\PermissionRoles::roles(); - // A new account will not have a techlevel, but accounts can also be created by the administrator. - - if((get_account_techlevel() < 4) && $privacy_role !== 'custom') - unset($perm_roles[t('Other')]); - // Configurable terms of service link $tosurl = get_config('system','tos_url'); diff --git a/Zotlabs/Module/Settings/Account.php b/Zotlabs/Module/Settings/Account.php index 9643c5958..b40f516ca 100644 --- a/Zotlabs/Module/Settings/Account.php +++ b/Zotlabs/Module/Settings/Account.php @@ -12,7 +12,6 @@ class Account { $errs = array(); $email = ((x($_POST,'email')) ? trim(notags($_POST['email'])) : ''); - $techlevel = ((array_key_exists('techlevel',$_POST)) ? intval($_POST['techlevel']) : 0); $account = \App::get_account(); if($email != $account['account_email']) { @@ -32,13 +31,6 @@ class Account { $errs[] = t('System failure storing new email. Please try again.'); } } - if($techlevel != $account['account_level']) { - $r = q("update account set account_level = %d where account_id = %d", - intval($techlevel), - intval($account['account_id']) - ); - info( t('Technical skill level updated') . EOL); - } if($errs) { foreach($errs as $err) @@ -101,11 +93,6 @@ class Account { $email = \App::$account['account_email']; - $techlevels = \Zotlabs\Lib\Techlevels::levels(); - - $def_techlevel = \App::$account['account_level']; - $techlock = get_config('system','techlevel_lock'); - $tpl = get_markup_template("settings_account.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_account"), @@ -113,8 +100,6 @@ class Account { '$origpass' => array('origpass', t('Current Password'), ' ',''), '$password1'=> array('npassword', t('Enter New Password'), '', ''), '$password2'=> array('confirm', t('Confirm New Password'), '', t('Leave password fields blank unless changing')), - '$techlevel' => [ 'techlevel', t('Your technical skill level'), $def_techlevel, t('Used to provide a member experience and additional features consistent with your comfort level'), $techlevels ], - '$techlock' => $techlock, '$submit' => t('Submit'), '$email' => array('email', t('Email Address:'), $email, ''), '$removeme' => t('Remove Account'), diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php index 73cb4decb..c473a70a4 100644 --- a/Zotlabs/Module/Settings/Channel.php +++ b/Zotlabs/Module/Settings/Channel.php @@ -432,7 +432,7 @@ class Channel { '$nickname' => (($intl_nickname === $webbie) ? $webbie : $intl_nickname . ' (' . $webbie . ')'), '$subdir' => $subdir, '$davdesc' => t('Your files/photos are accessible via WebDAV at'), - '$davpath' => ((get_account_techlevel() > 3) ? z_root() . '/dav/' . $nickname : ''), + '$davpath' => z_root() . '/dav/' . $nickname, '$basepath' => \App::get_hostname() )); @@ -490,11 +490,6 @@ class Channel { $permissions_set = (($permissions_role != 'custom') ? true : false); $perm_roles = \Zotlabs\Access\PermissionRoles::roles(); - if((get_account_techlevel() < 4) && $permissions_role !== 'custom') - unset($perm_roles[t('Other')]); - - - $vnotify = get_pconfig(local_channel(),'system','vnotify'); $always_show_in_notices = get_pconfig(local_channel(),'system','always_show_in_notices'); diff --git a/include/account.php b/include/account.php index 51118c3c5..2ab99ce19 100644 --- a/include/account.php +++ b/include/account.php @@ -124,7 +124,7 @@ function account_store_lowlevel($arr) { 'account_expires' => ((array_key_exists('account_expires',$arr)) ? $arr['account_expires'] : '0001-01-01 00:00:00'), 'account_expire_notified' => ((array_key_exists('account_expire_notified',$arr)) ? $arr['account_expire_notified'] : '0001-01-01 00:00:00'), 'account_service_class' => ((array_key_exists('account_service_class',$arr)) ? $arr['account_service_class'] : ''), - 'account_level' => ((array_key_exists('account_level',$arr)) ? $arr['account_level'] : '0'), + 'account_level' => '5', 'account_password_changed' => ((array_key_exists('account_password_changed',$arr)) ? $arr['account_password_changed'] : '0001-01-01 00:00:00') ]; @@ -215,7 +215,7 @@ function create_account($arr) { 'account_created' => datetime_convert(), 'account_flags' => intval($flags), 'account_roles' => intval($roles), - 'account_level' => intval($techlevel), + 'account_level' => 5, 'account_expires' => $expires, 'account_service_class' => $default_service_class ] @@ -821,13 +821,6 @@ function upgrade_bool_message($bbcode = false) { function get_account_techlevel($account_id = 0) { - if(! $account_id) { - $x = \App::get_account(); - } - else { - $x = get_account_by_id($account_id); - } - - return (($x) ? intval($x['account_level']) : 0); + return (5); } diff --git a/include/bbcode.php b/include/bbcode.php index 6f22509e6..137e25a9c 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -968,9 +968,6 @@ function bbcode($Text, $options = []) { $Text = preg_replace("/\[zrl\=([$URLSearchString]*)\](.*?)\[\/zrl\]/ism", '<a class="zrl" href="$1" ' . $target . ' rel="nofollow noopener" >$2</a>', $Text); } - if (get_account_techlevel() < 2) - $Text = str_replace('<span class="bookmark-identifier">#^</span>', '', $Text); - // Perform MAIL Search if (strpos($Text,'[/mail]') !== false) { $Text = preg_replace("/\[mail\]([$MAILSearchString]*)\[\/mail\]/", '<a href="mailto:$1" ' . $target . ' rel="nofollow noopener" >$1</a>', $Text); diff --git a/include/features.php b/include/features.php index ccf3c5faf..a3395d7a8 100644 --- a/include/features.php +++ b/include/features.php @@ -416,8 +416,6 @@ function get_features($filtered = true, $level = (-1)) { $arr = $x['features']; - $techlevel = (($level >= 0) ? $level : get_account_techlevel()); - // removed any locked features and remove the entire category if this makes it empty if($filtered) { @@ -428,9 +426,6 @@ function get_features($filtered = true, $level = (-1)) { for($y = 0; $y < count($arr[$k]); $y ++) { $disabled = false; if(is_array($arr[$k][$y])) { - if($arr[$k][$y][5] > $techlevel) { - $disabled = true; - } if($arr[$k][$y][4] !== false) { $disabled = true; } diff --git a/include/nav.php b/include/nav.php index 988a07b7c..b5592d7aa 100644 --- a/include/nav.php +++ b/include/nav.php @@ -60,8 +60,6 @@ function nav($template = 'default') { //we could additionally use this to display important system notifications e.g. for updates )); - $techlevel = get_account_techlevel(); - // nav links: array of array('href', 'text', 'extra css classes', 'title') $nav = []; diff --git a/view/tpl/admin_account_edit.tpl b/view/tpl/admin_account_edit.tpl index 3329c0025..1cbb9af0b 100644 --- a/view/tpl/admin_account_edit.tpl +++ b/view/tpl/admin_account_edit.tpl @@ -8,7 +8,6 @@ {{include file="field_password.tpl" field=$pass1}} {{include file="field_password.tpl" field=$pass2}} -{{include file="field_select.tpl" field=$account_level}} {{include file="field_select.tpl" field=$account_language}} {{include file="field_input.tpl" field=$service_class}} diff --git a/view/tpl/admin_site.tpl b/view/tpl/admin_site.tpl index c3f8177c2..c644bc973 100755 --- a/view/tpl/admin_site.tpl +++ b/view/tpl/admin_site.tpl @@ -42,9 +42,6 @@ {{include file="field_input.tpl" field=$sitename}} - {{include file="field_select.tpl" field=$techlevel}} - {{include file="field_checkbox.tpl" field=$techlock}} - {{include file="field_textarea.tpl" field=$banner}} {{include file="field_textarea.tpl" field=$siteinfo}} {{include file="field_textarea.tpl" field=$admininfo}} diff --git a/view/tpl/settings_account.tpl b/view/tpl/settings_account.tpl index dd1d0d0c9..3eacf3f7a 100755 --- a/view/tpl/settings_account.tpl +++ b/view/tpl/settings_account.tpl @@ -12,12 +12,6 @@ {{include file="field_password.tpl" field=$password1}} {{include file="field_password.tpl" field=$password2}} - {{if ! $techlock}} - {{include file="field_select.tpl" field=$techlevel}} - {{else}} - <input type="hidden" name="techlevel" value="{{$techlevel.2}}" /> - {{/if}} - <div class="settings-submit-wrapper" > <button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button> </div> |