From e735220691366fb29276dbc3f47ad0347c40aaf5 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 23 Sep 2018 20:54:36 +0200 Subject: only explain how to select a channel if there are channels to select --- Zotlabs/Module/Manage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Manage.php b/Zotlabs/Module/Manage.php index ea24bbf61..20d5b0449 100644 --- a/Zotlabs/Module/Manage.php +++ b/Zotlabs/Module/Manage.php @@ -129,7 +129,7 @@ class Manage extends \Zotlabs\Web\Controller { } } - + $r = q("select count(channel_id) as total from channel where channel_account_id = %d and channel_removed = 0", intval(get_account_id()) ); @@ -170,7 +170,7 @@ class Manage extends \Zotlabs\Web\Controller { '$header' => t('Channel Manager'), '$msg_selected' => t('Current Channel'), '$selected' => local_channel(), - '$desc' => t('Switch to one of your channels by selecting it.'), + '$desc' => ((count($channels) > 1 || $delegates) ? t('Switch to one of your channels by selecting it.') : ''), '$msg_default' => t('Default Channel'), '$msg_make_default' => t('Make Default'), '$create' => $create, -- cgit v1.2.3 From 995fc63f2caa6d735044b28caf03793f7c275eb1 Mon Sep 17 00:00:00 2001 From: "M.Dent" Date: Sun, 23 Sep 2018 22:36:27 -0400 Subject: Add filters for addon/app installed checks and docs --- Zotlabs/Lib/Apps.php | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 010947467..4ee64f15e 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -532,7 +532,7 @@ class Apps { static public function app_install($uid,$app) { $app['uid'] = $uid; - if(self::app_installed($uid,$app)) + if(self::app_installed($uid,$app,true)) $x = self::app_update($app); else $x = self::app_store($app); @@ -660,33 +660,60 @@ class Apps { } } - static public function app_installed($uid,$app) { + static public function app_installed($uid,$app,$bypass_filter=false) { $r = q("select id from app where app_id = '%s' and app_channel = %d limit 1", dbesc((array_key_exists('guid',$app)) ? $app['guid'] : ''), intval($uid) ); + if (!$bypass_filter) { + $filter_arr = [ + 'uid'=>$uid, + 'app'=>$app, + 'installed'=>$r + ]; + call_hooks('app_installed_filter',$filter_arr); + $r = $filter_arr['installed']; + } return(($r) ? true : false); } - static public function addon_app_installed($uid,$app) { + static public function addon_app_installed($uid,$app,$bypass_filter=false) { $r = q("select id from app where app_plugin = '%s' and app_channel = %d limit 1", dbesc($app), intval($uid) ); + if (!$bypass_filter) { + $filter_arr = [ + 'uid'=>$uid, + 'app'=>$app, + 'installed'=>$r + ]; + call_hooks('addon_app_installed_filter',$filter_arr); + $r = $filter_arr['installed']; + } return(($r) ? true : false); } - static public function system_app_installed($uid,$app) { + static public function system_app_installed($uid,$app,$bypass_filter=false) { $r = q("select id from app where app_id = '%s' and app_channel = %d limit 1", dbesc(hash('whirlpool',$app)), intval($uid) ); + if (!$bypass_filter) { + $filter_arr = [ + 'uid'=>$uid, + 'app'=>$app, + 'installed'=>$r + ]; + call_hooks('system_app_installed_filter',$filter_arr); + $r = $filter_arr['installed']; + } return(($r) ? true : false); } -- cgit v1.2.3 From 7cadc30914041364663b947d787da6f8b980b894 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 24 Sep 2018 09:33:52 +0200 Subject: settings for directory and set App::$profile_uid in directory if local_channel() --- Zotlabs/Module/Directory.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Directory.php b/Zotlabs/Module/Directory.php index 8a7c6baf6..c29fa8326 100644 --- a/Zotlabs/Module/Directory.php +++ b/Zotlabs/Module/Directory.php @@ -12,13 +12,16 @@ class Directory extends \Zotlabs\Web\Controller { function init() { \App::set_pager_itemspage(60); - if(x($_GET,'ignore')) { + if(local_channel() && x($_GET,'ignore')) { q("insert into xign ( uid, xchan ) values ( %d, '%s' ) ", intval(local_channel()), dbesc($_GET['ignore']) ); goaway(z_root() . '/directory?f=&suggest=1'); } + + if(local_channel()) + \App::$profile_uid = local_channel(); $observer = get_observer_hash(); $global_changed = false; @@ -55,6 +58,7 @@ class Directory extends \Zotlabs\Web\Controller { if($observer) set_xconfig($observer,'directory','pubforums',$pubforums); } + } function get() { -- cgit v1.2.3 From 85e06a77af7c81dab185b7a5757564215c41a2ed Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 24 Sep 2018 09:34:28 +0200 Subject: add file --- Zotlabs/Module/Settings/Directory.php | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Zotlabs/Module/Settings/Directory.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Directory.php b/Zotlabs/Module/Settings/Directory.php new file mode 100644 index 000000000..2682bcafc --- /dev/null +++ b/Zotlabs/Module/Settings/Directory.php @@ -0,0 +1,43 @@ + $rpath, + '$action_url' => 'settings/' . $module, + '$form_security_token' => get_form_security_token('settings_' . $module), + '$title' => t('Directory Settings'), + '$features' => process_module_features_get(local_channel(), $features), + '$submit' => t('Submit') + )); + + return $o; + } + +} -- cgit v1.2.3 From c3aa15cc165730b6e67de580065ace255454dfb5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 24 Sep 2018 11:46:18 +0200 Subject: appification of notes --- Zotlabs/Module/Notes.php | 41 ++++++++++++++++++++++++++++++++++------- Zotlabs/Widget/Notes.php | 14 ++++++++++---- 2 files changed, 44 insertions(+), 11 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Notes.php b/Zotlabs/Module/Notes.php index e530e6ff4..cd383a6c2 100644 --- a/Zotlabs/Module/Notes.php +++ b/Zotlabs/Module/Notes.php @@ -1,13 +1,19 @@ true); if(array_key_exists('note_text',$_REQUEST)) { @@ -24,17 +30,38 @@ class Notes extends \Zotlabs\Web\Controller { } set_pconfig(local_channel(),'notes','text',$body); } - + // push updates to channel clones - + if((argc() > 1) && (argv(1) === 'sync')) { require_once('include/zot.php'); build_sync_packet(); } - + logger('notes saved.', LOGGER_DEBUG); json_return_and_die($ret); - + + } + + function get() { + + if(! local_channel()) + return EMPTY_STR; + + if(! Apps::system_app_installed(local_channel(), 'Notes')) { + //Do not display any associated widgets at this point + App::$pdl = EMPTY_STR; + + $o = 'Notes App (Not Installed):
'; + $o .= t('A simple notes app with a widget (note: notes are not encrypted)'); + return $o; + } + + $w = new \Zotlabs\Widget\Notes; + $arr = ['app' => true]; + + return $w->widget($arr); + } } diff --git a/Zotlabs/Widget/Notes.php b/Zotlabs/Widget/Notes.php index 5c83a550f..238008d81 100644 --- a/Zotlabs/Widget/Notes.php +++ b/Zotlabs/Widget/Notes.php @@ -2,20 +2,26 @@ namespace Zotlabs\Widget; +use Zotlabs\Lib\Apps; + class Notes { function widget($arr) { if(! local_channel()) - return ''; - if(! feature_enabled(local_channel(),'private_notes')) - return ''; + return EMPTY_STR; + + if(! Apps::system_app_installed(local_channel(), 'Notes')) + return EMPTY_STR; $text = get_pconfig(local_channel(),'notes','text'); - $o = replace_macros(get_markup_template('notes.tpl'), array( + $tpl = get_markup_template('notes.tpl'); + + $o = replace_macros($tpl, array( '$banner' => t('Notes'), '$text' => $text, '$save' => t('Save'), + '$app' => ((isset($arr['app'])) ? true : false) )); return $o; -- cgit v1.2.3 From 4c58a5cef278357c1bc31b76cfbd2719e3338398 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 25 Sep 2018 10:06:24 +0200 Subject: premium channel app --- Zotlabs/Module/Connect.php | 68 +++++++++++++++++++++++++++------------- Zotlabs/Widget/Settings_menu.php | 19 +---------- 2 files changed, 48 insertions(+), 39 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Connect.php b/Zotlabs/Module/Connect.php index cd43ea290..7194e7039 100644 --- a/Zotlabs/Module/Connect.php +++ b/Zotlabs/Module/Connect.php @@ -1,21 +1,21 @@ 1) $which = argv(1); else { notice( t('Requested profile is not available.') . EOL ); - \App::$error = 404; + App::$error = 404; return; } @@ -24,20 +24,32 @@ class Connect extends \Zotlabs\Web\Controller { ); if($r) - \App::$data['channel'] = $r[0]; + App::$data['channel'] = $r[0]; + + $channel_id = App::$data['channel']['channel_id']; + + if(! Apps::system_app_installed($channel_id, 'Premium Channel')) { + return; + } profile_load($which,''); } function post() { - if(! array_key_exists('channel', \App::$data)) + if(! array_key_exists('channel', App::$data)) + return; + + $channel_id = App::$data['channel']['channel_id']; + + if(! Apps::system_app_installed($channel_id, 'Premium Channel')) { return; + } - $edit = ((local_channel() && (local_channel() == \App::$data['channel']['channel_id'])) ? true : false); + $edit = ((local_channel() && (local_channel() == $channel_id)) ? true : false); if($edit) { - $has_premium = ((\App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? 1 : 0); + $has_premium = ((App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? 1 : 0); $premium = (($_POST['premium']) ? intval($_POST['premium']) : 0); $text = escape_tags($_POST['text']); @@ -48,25 +60,25 @@ class Connect extends \Zotlabs\Web\Controller { intval(local_channel()) ); - \Zotlabs\Daemon\Master::Summon(array('Notifier','refresh_all',\App::$data['channel']['channel_id'])); + \Zotlabs\Daemon\Master::Summon(array('Notifier','refresh_all',$channel_id)); } - set_pconfig(\App::$data['channel']['channel_id'],'system','selltext',$text); + set_pconfig($channel_id,'system','selltext',$text); // reload the page completely to get fresh data - goaway(z_root() . '/' . \App::$query_string); + goaway(z_root() . '/' . App::$query_string); } $url = ''; - $observer = \App::get_observer(); + $observer = App::get_observer(); if(($observer) && ($_POST['submit'] === t('Continue'))) { if($observer['xchan_follow']) - $url = sprintf($observer['xchan_follow'],urlencode(channel_reddress(\App::$data['channel']))); + $url = sprintf($observer['xchan_follow'],urlencode(channel_reddress(App::$data['channel']))); if(! $url) { $r = q("select * from hubloc where hubloc_hash = '%s' order by hubloc_id desc limit 1", dbesc($observer['xchan_hash']) ); if($r) - $url = $r[0]['hubloc_url'] . '/follow?f=&url=' . urlencode(channel_reddress(\App::$data['channel'])); + $url = $r[0]['hubloc_url'] . '/follow?f=&url=' . urlencode(channel_reddress(App::$data['channel'])); } } if($url) @@ -79,17 +91,31 @@ class Connect extends \Zotlabs\Web\Controller { function get() { + + if(! array_key_exists('channel', App::$data)) + return; + + $channel_id = App::$data['channel']['channel_id']; + + if(! Apps::system_app_installed($channel_id, 'Premium Channel')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = 'Premium Channel App (Not Installed):
'; + $o .= t('Allows you to set restrictions and terms on those that connect with your channel'); + return $o; + } - $edit = ((local_channel() && (local_channel() == \App::$data['channel']['channel_id'])) ? true : false); + $edit = ((local_channel() && (local_channel() == $channel_id)) ? true : false); - $text = get_pconfig(\App::$data['channel']['channel_id'],'system','selltext'); + $text = get_pconfig($channel_id,'system','selltext'); if($edit) { $o = replace_macros(get_markup_template('sellpage_edit.tpl'),array( '$header' => t('Premium Channel Setup'), - '$address' => \App::$data['channel']['channel_address'], - '$premium' => array('premium', t('Enable premium channel connection restrictions'),((\App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? '1' : ''),''), + '$address' => App::$data['channel']['channel_address'], + '$premium' => array('premium', t('Enable premium channel connection restrictions'),((App::$data['channel']['channel_pageflags'] & PAGE_PREMIUM) ? '1' : ''),''), '$lbl_about' => t('Please enter your restrictions or conditions, such as paypal receipt, usage guidelines, etc.'), '$text' => $text, '$desc' => t('This channel may require additional steps or acknowledgement of the following conditions prior to connecting:'), @@ -107,7 +133,7 @@ class Connect extends \Zotlabs\Web\Controller { $submit = replace_macros(get_markup_template('sellpage_submit.tpl'), array( '$continue' => t('Continue'), - '$address' => \App::$data['channel']['channel_address'] + '$address' => App::$data['channel']['channel_address'] )); $o = replace_macros(get_markup_template('sellpage_view.tpl'),array( @@ -120,7 +146,7 @@ class Connect extends \Zotlabs\Web\Controller { )); - $arr = array('channel' => \App::$data['channel'],'observer' => \App::get_observer(), 'sellpage' => $o, 'submit' => $submit); + $arr = array('channel' => App::$data['channel'],'observer' => App::get_observer(), 'sellpage' => $o, 'submit' => $submit); call_hooks('connect_premium', $arr); $o = $arr['sellpage']; diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index f35d6f147..1b96e4d14 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -111,7 +111,6 @@ class Settings_menu { ); } - if($role === false || $role === 'custom') { $tabs[] = array( 'label' => t('Connection Default Permissions'), @@ -120,22 +119,6 @@ class Settings_menu { ); } - if(feature_enabled(local_channel(),'premium_channel')) { - $tabs[] = array( - 'label' => t('Premium Channel Settings'), - 'url' => z_root() . '/connect/' . $channel['channel_address'], - 'selected' => '' - ); - } - - if(feature_enabled(local_channel(),'channel_sources')) { - $tabs[] = array( - 'label' => t('Channel Sources'), - 'url' => z_root() . '/sources', - 'selected' => '' - ); - } - $tabtpl = get_markup_template("generic_links_widget.tpl"); return replace_macros($tabtpl, array( '$title' => t('Settings'), @@ -144,4 +127,4 @@ class Settings_menu { )); } -} \ No newline at end of file +} -- cgit v1.2.3 From 39866b74637a58df5b1ffb8f2b6f164849d65315 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 25 Sep 2018 11:37:22 +0200 Subject: move start_menu switch to settings/display for now --- Zotlabs/Module/Settings/Display.php | 12 +++++++++++- Zotlabs/Widget/Newmember.php | 9 ++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index 340b3c0bb..dbc383135 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -30,6 +30,7 @@ class Display { $channel_list_mode = ((x($_POST,'channel_list_mode')) ? intval($_POST['channel_list_mode']) : 0); $network_list_mode = ((x($_POST,'network_list_mode')) ? intval($_POST['network_list_mode']) : 0); $manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0); + $start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0); $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); if($channel_divmore_height < 50) @@ -60,6 +61,7 @@ class Display { set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height); set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update); set_pconfig(local_channel(),'system','channel_menu', $channel_menu); + set_pconfig(local_channel(),'system','start_menu', $start_menu); $newschema = ''; if($theme){ @@ -150,6 +152,14 @@ class Display { $theme_selected = explode(':', $theme_selected)[0]; } + $account = \App::get_account(); + + if($account['account_created'] > datetime_convert('','','now - 60 days')) { + $start_menu = get_pconfig(local_channel(), 'system', 'start_menu', 1); + } + else { + $start_menu = get_pconfig(local_channel(), 'system', 'start_menu', 0); + } $preload_images = get_pconfig(local_channel(),'system','preload_images'); $preload_images = (($preload_images===false)? '0': $preload_images); // default if not set: 0 @@ -211,7 +221,7 @@ class Display { '$network_list_mode' => array('network_list_mode', t('Use blog/list mode on grid page'), get_pconfig(local_channel(),'system','network_list_mode'), t('(comments displayed separately)'), $yes_no), '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), '$network_divmore_height' => array('network_divmore_height', t('Grid page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), - + '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no] )); diff --git a/Zotlabs/Widget/Newmember.php b/Zotlabs/Widget/Newmember.php index 1a4b575b9..e57cf5171 100644 --- a/Zotlabs/Widget/Newmember.php +++ b/Zotlabs/Widget/Newmember.php @@ -17,7 +17,14 @@ class Newmember { if(! $a) return EMPTY_STR; - if(! feature_enabled(local_channel(),'start_menu')) + if($a['account_created'] > datetime_convert('','','now - 60 days')) { + $enabled = get_pconfig(local_channel(), 'system', 'start_menu', 1); + } + else { + $enabled = get_pconfig(local_channel(), 'system', 'start_menu', 0); + } + + if(! $enabled) return EMPTY_STR; $options = [ -- cgit v1.2.3 From 9bb0f1d18ece05ac1d37800c61d0b071f560dac3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 25 Sep 2018 12:02:00 +0200 Subject: move advanced_theming switch to settings/display for now --- Zotlabs/Module/Settings/Display.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index dbc383135..d35c54a90 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -30,7 +30,8 @@ class Display { $channel_list_mode = ((x($_POST,'channel_list_mode')) ? intval($_POST['channel_list_mode']) : 0); $network_list_mode = ((x($_POST,'network_list_mode')) ? intval($_POST['network_list_mode']) : 0); $manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0); - $start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0); + $start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0); + $advanced_theming = ((x($_POST,'advanced_theming')) ? intval($_POST['advanced_theming']) : 0); $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); if($channel_divmore_height < 50) @@ -62,6 +63,7 @@ class Display { set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update); set_pconfig(local_channel(),'system','channel_menu', $channel_menu); set_pconfig(local_channel(),'system','start_menu', $start_menu); + set_pconfig(local_channel(),'system','advanced_theming', $advanced_theming); $newschema = ''; if($theme){ @@ -179,6 +181,8 @@ class Display { $title_tosource = get_pconfig(local_channel(),'system','title_tosource'); $title_tosource = (($title_tosource===false)? '0': $title_tosource); // default if not set: 0 + $advanced_theming = get_pconfig(local_channel(),'system','advanced_theming', 0); + $theme_config = ""; if(($themeconfigfile = $this->get_theme_config_file($theme)) != null){ require_once($themeconfigfile); @@ -216,12 +220,13 @@ class Display { '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no), '$layout_editor' => t('System Page Layout Editor - (advanced)'), '$theme_config' => $theme_config, - '$expert' => feature_enabled(local_channel(),'advanced_theming'), + '$expert' => $advanced_theming, '$channel_list_mode' => array('channel_list_mode', t('Use blog/list mode on channel page'), get_pconfig(local_channel(),'system','channel_list_mode'), t('(comments displayed separately)'), $yes_no), '$network_list_mode' => array('network_list_mode', t('Use blog/list mode on grid page'), get_pconfig(local_channel(),'system','network_list_mode'), t('(comments displayed separately)'), $yes_no), '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), '$network_divmore_height' => array('network_divmore_height', t('Grid page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), - '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no] + '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no], + '$advanced_theming' => ['advanced_theming', t('Advanced Theme and Layout Settings'), $advanced_theming, t('Allows fine tuning of themes and page layouts'), $yes_no] )); -- cgit v1.2.3 From 9948bb3f2aa3bf3efa68623b87ba854fb59b4926 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 25 Sep 2018 12:59:53 +0200 Subject: appification of privacy groups --- Zotlabs/Module/Group.php | 29 ++++++++++++++++++++++++----- Zotlabs/Widget/Activity_filter.php | 4 +++- 2 files changed, 27 insertions(+), 6 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index acebe995d..bf0edb1ed 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -1,11 +1,13 @@ Privacy Groups App (Not Installed):
'; + $o .= t('Management of privacy groups'); + return $o; + } + // Switch to text mode interface if we have more than 'n' contacts or group members $switchtotext = get_pconfig(local_channel(),'system','groupedit_image_limit'); if($switchtotext === false) diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php index d725f8b55..912bfce49 100644 --- a/Zotlabs/Widget/Activity_filter.php +++ b/Zotlabs/Widget/Activity_filter.php @@ -2,6 +2,8 @@ namespace Zotlabs\Widget; +use Zotlabs\Lib\Apps; + class Activity_filter { function widget($arr) { @@ -44,7 +46,7 @@ class Activity_filter { ]; } - if(feature_enabled(local_channel(),'groups')) { + if(Apps::system_app_installed(local_channel(), 'Privacy Groups')) { $groups = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval(local_channel()) ); -- cgit v1.2.3 From 9bc76b425948e7a6118e7749a3eb7c08c447bab3 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 15:02:20 +0200 Subject: appification of the pdl editor and move advanced_theming to theme settings where it belongs --- Zotlabs/Module/Pdledit.php | 21 +++++++++++++++------ Zotlabs/Module/Settings/Display.php | 10 +--------- 2 files changed, 16 insertions(+), 15 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php index 9b86b599b..d0bde7715 100644 --- a/Zotlabs/Module/Pdledit.php +++ b/Zotlabs/Module/Pdledit.php @@ -1,15 +1,20 @@ PDL Editor App (Not Installed):
'; + $o .= t('Provides the ability to edit system page layouts'); + return $o; } if(argc() > 2 && argv(2) === 'reset') { diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index d35c54a90..0c63a3056 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -31,7 +31,6 @@ class Display { $network_list_mode = ((x($_POST,'network_list_mode')) ? intval($_POST['network_list_mode']) : 0); $manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0); $start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0); - $advanced_theming = ((x($_POST,'advanced_theming')) ? intval($_POST['advanced_theming']) : 0); $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); if($channel_divmore_height < 50) @@ -63,7 +62,6 @@ class Display { set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update); set_pconfig(local_channel(),'system','channel_menu', $channel_menu); set_pconfig(local_channel(),'system','start_menu', $start_menu); - set_pconfig(local_channel(),'system','advanced_theming', $advanced_theming); $newschema = ''; if($theme){ @@ -181,8 +179,6 @@ class Display { $title_tosource = get_pconfig(local_channel(),'system','title_tosource'); $title_tosource = (($title_tosource===false)? '0': $title_tosource); // default if not set: 0 - $advanced_theming = get_pconfig(local_channel(),'system','advanced_theming', 0); - $theme_config = ""; if(($themeconfigfile = $this->get_theme_config_file($theme)) != null){ require_once($themeconfigfile); @@ -218,16 +214,12 @@ class Display { '$channel_menu' => [ 'channel_menu', t('Provide channel menu in navigation bar'), get_pconfig(local_channel(),'system','channel_menu',get_config('system','channel_menu',0)), t('Default: channel menu located in app menu'),$yes_no ], '$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no), '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no), - '$layout_editor' => t('System Page Layout Editor - (advanced)'), '$theme_config' => $theme_config, - '$expert' => $advanced_theming, '$channel_list_mode' => array('channel_list_mode', t('Use blog/list mode on channel page'), get_pconfig(local_channel(),'system','channel_list_mode'), t('(comments displayed separately)'), $yes_no), '$network_list_mode' => array('network_list_mode', t('Use blog/list mode on grid page'), get_pconfig(local_channel(),'system','network_list_mode'), t('(comments displayed separately)'), $yes_no), '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), '$network_divmore_height' => array('network_divmore_height', t('Grid page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), - '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no], - '$advanced_theming' => ['advanced_theming', t('Advanced Theme and Layout Settings'), $advanced_theming, t('Allows fine tuning of themes and page layouts'), $yes_no] - + '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no] )); call_hooks('display_settings',$o); -- cgit v1.2.3 From aab97adb23c65dfc54f4f160742f8066fcd98032 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 16:22:34 +0200 Subject: oauth and oauth2 apps manager --- Zotlabs/Module/Oauth.php | 177 +++++++++++++++++++++++++++++++++ Zotlabs/Module/Oauth2.php | 199 +++++++++++++++++++++++++++++++++++++ Zotlabs/Module/Settings/Oauth.php | 161 ------------------------------ Zotlabs/Module/Settings/Oauth2.php | 184 ---------------------------------- 4 files changed, 376 insertions(+), 345 deletions(-) create mode 100644 Zotlabs/Module/Oauth.php create mode 100644 Zotlabs/Module/Oauth2.php delete mode 100644 Zotlabs/Module/Settings/Oauth.php delete mode 100644 Zotlabs/Module/Settings/Oauth2.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Oauth.php b/Zotlabs/Module/Oauth.php new file mode 100644 index 000000000..196209308 --- /dev/null +++ b/Zotlabs/Module/Oauth.php @@ -0,0 +1,177 @@ + 1) && (argv(1) === 'edit' || argv(1) === 'add') && x($_POST,'submit')) { + + check_form_security_token_redirectOnErr('oauth', 'oauth'); + + $name = ((x($_POST,'name')) ? escape_tags($_POST['name']) : ''); + $key = ((x($_POST,'key')) ? escape_tags($_POST['key']) : ''); + $secret = ((x($_POST,'secret')) ? escape_tags($_POST['secret']) : ''); + $redirect = ((x($_POST,'redirect')) ? escape_tags($_POST['redirect']) : ''); + $icon = ((x($_POST,'icon')) ? escape_tags($_POST['icon']) : ''); + $oauth2 = ((x($_POST,'oauth2')) ? intval($_POST['oauth2']) : 0); + $ok = true; + if($name == '') { + $ok = false; + notice( t('Name is required') . EOL); + } + if($key == '' || $secret == '') { + $ok = false; + notice( t('Key and Secret are required') . EOL); + } + + if($ok) { + if ($_POST['submit']==t("Update")){ + $r = q("UPDATE clients SET + client_id='%s', + pw='%s', + clname='%s', + redirect_uri='%s', + icon='%s', + uid=%d + WHERE client_id='%s'", + dbesc($key), + dbesc($secret), + dbesc($name), + dbesc($redirect), + dbesc($icon), + intval(local_channel()), + dbesc($key)); + } else { + $r = q("INSERT INTO clients (client_id, pw, clname, redirect_uri, icon, uid) + VALUES ('%s','%s','%s','%s','%s',%d)", + dbesc($key), + dbesc($secret), + dbesc($name), + dbesc($redirect), + dbesc($icon), + intval(local_channel()) + ); + $r = q("INSERT INTO xperm (xp_client, xp_channel, xp_perm) VALUES ('%s', %d, '%s') ", + dbesc($key), + intval(local_channel()), + dbesc('all') + ); + } + } + goaway(z_root()."/oauth"); + return; + } + } + + function get() { + + if(! Apps::system_app_installed(local_channel(), 'OAuth Apps Manager')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = 'OAuth App (Not Installed):
'; + $o .= t('An OAuth apps manager'); + return $o; + } + + + if((argc() > 1) && (argv(1) === 'add')) { + $tpl = get_markup_template("oauth_edit.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("oauth"), + '$title' => t('Add application'), + '$submit' => t('Submit'), + '$cancel' => t('Cancel'), + '$name' => array('name', t('Name'), '', t('Name of application')), + '$key' => array('key', t('Consumer Key'), random_string(16), t('Automatically generated - change if desired. Max length 20')), + '$secret' => array('secret', t('Consumer Secret'), random_string(16), t('Automatically generated - change if desired. Max length 20')), + '$redirect' => array('redirect', t('Redirect'), '', t('Redirect URI - leave blank unless your application specifically requires this')), + '$icon' => array('icon', t('Icon url'), '', t('Optional')), + )); + return $o; + } + + if((argc() > 2) && (argv(1) === 'edit')) { + $r = q("SELECT * FROM clients WHERE client_id='%s' AND uid=%d", + dbesc(argv(2)), + local_channel()); + + if (!count($r)){ + notice(t('Application not found.')); + return; + } + $app = $r[0]; + + $tpl = get_markup_template("oauth_edit.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("oauth"), + '$title' => t('Add application'), + '$submit' => t('Update'), + '$cancel' => t('Cancel'), + '$name' => array('name', t('Name'), $app['clname'] , ''), + '$key' => array('key', t('Consumer Key'), $app['client_id'], ''), + '$secret' => array('secret', t('Consumer Secret'), $app['pw'], ''), + '$redirect' => array('redirect', t('Redirect'), $app['redirect_uri'], ''), + '$icon' => array('icon', t('Icon url'), $app['icon'], ''), + )); + return $o; + } + + if((argc() > 2) && (argv(1) === 'delete')) { + check_form_security_token_redirectOnErr('/oauth', 'oauth', 't'); + + $r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d", + dbesc(argv(2)), + local_channel()); + goaway(z_root()."/oauth"); + return; + } + + + $r = q("SELECT clients.*, tokens.id as oauth_token, (clients.uid=%d) AS my + FROM clients + LEFT JOIN tokens ON clients.client_id=tokens.client_id + WHERE clients.uid IN (%d,0)", + local_channel(), + local_channel()); + + + $tpl = get_markup_template("oauth.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("oauth"), + '$baseurl' => z_root(), + '$title' => t('Connected OAuth Apps'), + '$add' => t('Add application'), + '$edit' => t('Edit'), + '$delete' => t('Delete'), + '$consumerkey' => t('Client key starts with'), + '$noname' => t('No name'), + '$remove' => t('Remove authorization'), + '$apps' => $r, + )); + return $o; + + } + +} diff --git a/Zotlabs/Module/Oauth2.php b/Zotlabs/Module/Oauth2.php new file mode 100644 index 000000000..2302d1b10 --- /dev/null +++ b/Zotlabs/Module/Oauth2.php @@ -0,0 +1,199 @@ + 1) && (argv(1) === 'edit' || argv(1) === 'add') && x($_POST,'submit')) { + + check_form_security_token_redirectOnErr('oauth2', 'oauth2'); + + $name = ((x($_POST,'name')) ? escape_tags(trim($_POST['name'])) : ''); + $secret = ((x($_POST,'secret')) ? escape_tags(trim($_POST['secret'])) : ''); + $redirect = ((x($_POST,'redirect')) ? escape_tags(trim($_POST['redirect'])) : ''); + $grant = ((x($_POST,'grant')) ? escape_tags(trim($_POST['grant'])) : ''); + $scope = ((x($_POST,'scope')) ? escape_tags(trim($_POST['scope'])) : ''); + + $ok = true; + if($name == '' || $secret == '') { + $ok = false; + notice( t('Name and Secret are required') . EOL); + } + + if($ok) { + if ($_POST['submit']==t("Update")){ + $r = q("UPDATE oauth_clients SET + client_id = '%s', + client_secret = '%s', + redirect_uri = '%s', + grant_types = '%s', + scope = '%s', + user_id = %d + WHERE client_id='%s' and user_id = %s", + dbesc($name), + dbesc($secret), + dbesc($redirect), + dbesc($grant), + dbesc($scope), + intval(local_channel()), + dbesc($name), + intval(local_channel())); + } else { + $r = q("INSERT INTO oauth_clients (client_id, client_secret, redirect_uri, grant_types, scope, user_id) + VALUES ('%s','%s','%s','%s','%s',%d)", + dbesc($name), + dbesc($secret), + dbesc($redirect), + dbesc($grant), + dbesc($scope), + intval(local_channel()) + ); + $r = q("INSERT INTO xperm (xp_client, xp_channel, xp_perm) VALUES ('%s', %d, '%s') ", + dbesc($name), + intval(local_channel()), + dbesc('all') + ); + } + } + goaway(z_root()."/oauth2"); + return; + } + } + + function get() { + + if(! Apps::system_app_installed(local_channel(), 'OAuth2 Apps Manager')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = 'OAuth2 App (Not Installed):
'; + $o .= t('An OAuth2 apps manager'); + return $o; + } + + if((argc() > 1) && (argv(1) === 'add')) { + $tpl = get_markup_template("oauth2_edit.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("oauth2"), + '$title' => t('Add OAuth2 application'), + '$submit' => t('Submit'), + '$cancel' => t('Cancel'), + '$name' => array('name', t('Name'), '', t('Name of application')), + '$secret' => array('secret', t('Consumer Secret'), random_string(16), t('Automatically generated - change if desired. Max length 20')), + '$redirect' => array('redirect', t('Redirect'), '', t('Redirect URI - leave blank unless your application specifically requires this')), + '$grant' => array('grant', t('Grant Types'), '', t('leave blank unless your application sepcifically requires this')), + '$scope' => array('scope', t('Authorization scope'), '', t('leave blank unless your application sepcifically requires this')), + )); + return $o; + } + + if((argc() > 2) && (argv(1) === 'edit')) { + $r = q("SELECT * FROM oauth_clients WHERE client_id='%s' AND user_id= %d", + dbesc(argv(2)), + intval(local_channel()) + ); + + if (! $r){ + notice(t('OAuth2 Application not found.')); + return; + } + + $app = $r[0]; + + $tpl = get_markup_template("oauth2_edit.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("oauth2"), + '$title' => t('Add application'), + '$submit' => t('Update'), + '$cancel' => t('Cancel'), + '$name' => array('name', t('Name'), $app['client_id'], t('Name of application')), + '$secret' => array('secret', t('Consumer Secret'), $app['client_secret'], t('Automatically generated - change if desired. Max length 20')), + '$redirect' => array('redirect', t('Redirect'), $app['redirect_uri'], t('Redirect URI - leave blank unless your application specifically requires this')), + '$grant' => array('grant', t('Grant Types'), $app['grant_types'], t('leave blank unless your application specifically requires this')), + '$scope' => array('scope', t('Authorization scope'), $app['scope'], t('leave blank unless your application specifically requires this')), + )); + return $o; + } + + if((argc() > 2) && (argv(1) === 'delete')) { + check_form_security_token_redirectOnErr('oauth2', 'oauth2', 't'); + + $r = q("DELETE FROM oauth_clients WHERE client_id = '%s' AND user_id = %d", + dbesc(argv(2)), + intval(local_channel()) + ); + $r = q("DELETE FROM oauth_access_tokens WHERE client_id = '%s' AND user_id = %d", + dbesc(argv(2)), + intval(local_channel()) + ); + $r = q("DELETE FROM oauth_authorization_codes WHERE client_id = '%s' AND user_id = %d", + dbesc(argv(2)), + intval(local_channel()) + ); + $r = q("DELETE FROM oauth_refresh_tokens WHERE client_id = '%s' AND user_id = %d", + dbesc(argv(2)), + intval(local_channel()) + ); + goaway(z_root()."/oauth2"); + return; + } + + + $r = q("SELECT oauth_clients.*, oauth_access_tokens.access_token as oauth_token, (oauth_clients.user_id = %d) AS my + FROM oauth_clients + LEFT JOIN oauth_access_tokens ON oauth_clients.client_id=oauth_access_tokens.client_id AND + oauth_clients.user_id=oauth_access_tokens.user_id + WHERE oauth_clients.user_id IN (%d,0)", + intval(local_channel()), + intval(local_channel()) + ); + + $tpl = get_markup_template("oauth2.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("oauth2"), + '$baseurl' => z_root(), + '$title' => t('Connected OAuth2 Apps'), + '$add' => t('Add application'), + '$edit' => t('Edit'), + '$delete' => t('Delete'), + '$consumerkey' => t('Client key starts with'), + '$noname' => t('No name'), + '$remove' => t('Remove authorization'), + '$apps' => $r, + )); + return $o; + + } + +} diff --git a/Zotlabs/Module/Settings/Oauth.php b/Zotlabs/Module/Settings/Oauth.php deleted file mode 100644 index d6576c6de..000000000 --- a/Zotlabs/Module/Settings/Oauth.php +++ /dev/null @@ -1,161 +0,0 @@ - 2) && (argv(2) === 'edit' || argv(2) === 'add') && x($_POST,'submit')) { - - check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth'); - - $name = ((x($_POST,'name')) ? escape_tags($_POST['name']) : ''); - $key = ((x($_POST,'key')) ? escape_tags($_POST['key']) : ''); - $secret = ((x($_POST,'secret')) ? escape_tags($_POST['secret']) : ''); - $redirect = ((x($_POST,'redirect')) ? escape_tags($_POST['redirect']) : ''); - $icon = ((x($_POST,'icon')) ? escape_tags($_POST['icon']) : ''); - $oauth2 = ((x($_POST,'oauth2')) ? intval($_POST['oauth2']) : 0); - $ok = true; - if($name == '') { - $ok = false; - notice( t('Name is required') . EOL); - } - if($key == '' || $secret == '') { - $ok = false; - notice( t('Key and Secret are required') . EOL); - } - - if($ok) { - if ($_POST['submit']==t("Update")){ - $r = q("UPDATE clients SET - client_id='%s', - pw='%s', - clname='%s', - redirect_uri='%s', - icon='%s', - uid=%d - WHERE client_id='%s'", - dbesc($key), - dbesc($secret), - dbesc($name), - dbesc($redirect), - dbesc($icon), - intval(local_channel()), - dbesc($key)); - } else { - $r = q("INSERT INTO clients (client_id, pw, clname, redirect_uri, icon, uid) - VALUES ('%s','%s','%s','%s','%s',%d)", - dbesc($key), - dbesc($secret), - dbesc($name), - dbesc($redirect), - dbesc($icon), - intval(local_channel()) - ); - $r = q("INSERT INTO xperm (xp_client, xp_channel, xp_perm) VALUES ('%s', %d, '%s') ", - dbesc($key), - intval(local_channel()), - dbesc('all') - ); - } - } - goaway(z_root()."/settings/oauth/"); - return; - } - } - - function get() { - - if((argc() > 2) && (argv(2) === 'add')) { - $tpl = get_markup_template("settings_oauth_edit.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_oauth"), - '$title' => t('Add application'), - '$submit' => t('Submit'), - '$cancel' => t('Cancel'), - '$name' => array('name', t('Name'), '', t('Name of application')), - '$key' => array('key', t('Consumer Key'), random_string(16), t('Automatically generated - change if desired. Max length 20')), - '$secret' => array('secret', t('Consumer Secret'), random_string(16), t('Automatically generated - change if desired. Max length 20')), - '$redirect' => array('redirect', t('Redirect'), '', t('Redirect URI - leave blank unless your application specifically requires this')), - '$icon' => array('icon', t('Icon url'), '', t('Optional')), - )); - return $o; - } - - if((argc() > 3) && (argv(2) === 'edit')) { - $r = q("SELECT * FROM clients WHERE client_id='%s' AND uid=%d", - dbesc(argv(3)), - local_channel()); - - if (!count($r)){ - notice(t('Application not found.')); - return; - } - $app = $r[0]; - - $tpl = get_markup_template("settings_oauth_edit.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_oauth"), - '$title' => t('Add application'), - '$submit' => t('Update'), - '$cancel' => t('Cancel'), - '$name' => array('name', t('Name'), $app['clname'] , ''), - '$key' => array('key', t('Consumer Key'), $app['client_id'], ''), - '$secret' => array('secret', t('Consumer Secret'), $app['pw'], ''), - '$redirect' => array('redirect', t('Redirect'), $app['redirect_uri'], ''), - '$icon' => array('icon', t('Icon url'), $app['icon'], ''), - )); - return $o; - } - - if((argc() > 3) && (argv(2) === 'delete')) { - check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth', 't'); - - $r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d", - dbesc(argv(3)), - local_channel()); - goaway(z_root()."/settings/oauth/"); - return; - } - - - $r = q("SELECT clients.*, tokens.id as oauth_token, (clients.uid=%d) AS my - FROM clients - LEFT JOIN tokens ON clients.client_id=tokens.client_id - WHERE clients.uid IN (%d,0)", - local_channel(), - local_channel()); - - - $tpl = get_markup_template("settings_oauth.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_oauth"), - '$baseurl' => z_root(), - '$title' => t('Connected Apps'), - '$add' => t('Add application'), - '$edit' => t('Edit'), - '$delete' => t('Delete'), - '$consumerkey' => t('Client key starts with'), - '$noname' => t('No name'), - '$remove' => t('Remove authorization'), - '$apps' => $r, - )); - return $o; - - } - -} \ No newline at end of file diff --git a/Zotlabs/Module/Settings/Oauth2.php b/Zotlabs/Module/Settings/Oauth2.php deleted file mode 100644 index 70fd3a5c3..000000000 --- a/Zotlabs/Module/Settings/Oauth2.php +++ /dev/null @@ -1,184 +0,0 @@ - 2) && (argv(2) === 'edit' || argv(2) === 'add') && x($_POST,'submit')) { - - check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2'); - - $name = ((x($_POST,'name')) ? escape_tags(trim($_POST['name'])) : ''); - $secret = ((x($_POST,'secret')) ? escape_tags(trim($_POST['secret'])) : ''); - $redirect = ((x($_POST,'redirect')) ? escape_tags(trim($_POST['redirect'])) : ''); - $grant = ((x($_POST,'grant')) ? escape_tags(trim($_POST['grant'])) : ''); - $scope = ((x($_POST,'scope')) ? escape_tags(trim($_POST['scope'])) : ''); - - $ok = true; - if($name == '' || $secret == '') { - $ok = false; - notice( t('Name and Secret are required') . EOL); - } - - if($ok) { - if ($_POST['submit']==t("Update")){ - $r = q("UPDATE oauth_clients SET - client_id = '%s', - client_secret = '%s', - redirect_uri = '%s', - grant_types = '%s', - scope = '%s', - user_id = %d - WHERE client_id='%s' and user_id = %s", - dbesc($name), - dbesc($secret), - dbesc($redirect), - dbesc($grant), - dbesc($scope), - intval(local_channel()), - dbesc($name), - intval(local_channel())); - } else { - $r = q("INSERT INTO oauth_clients (client_id, client_secret, redirect_uri, grant_types, scope, user_id) - VALUES ('%s','%s','%s','%s','%s',%d)", - dbesc($name), - dbesc($secret), - dbesc($redirect), - dbesc($grant), - dbesc($scope), - intval(local_channel()) - ); - $r = q("INSERT INTO xperm (xp_client, xp_channel, xp_perm) VALUES ('%s', %d, '%s') ", - dbesc($name), - intval(local_channel()), - dbesc('all') - ); - } - } - goaway(z_root()."/settings/oauth2/"); - return; - } - } - - function get() { - - if((argc() > 2) && (argv(2) === 'add')) { - $tpl = get_markup_template("settings_oauth2_edit.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_oauth2"), - '$title' => t('Add OAuth2 application'), - '$submit' => t('Submit'), - '$cancel' => t('Cancel'), - '$name' => array('name', t('Name'), '', t('Name of application')), - '$secret' => array('secret', t('Consumer Secret'), random_string(16), t('Automatically generated - change if desired. Max length 20')), - '$redirect' => array('redirect', t('Redirect'), '', t('Redirect URI - leave blank unless your application specifically requires this')), - '$grant' => array('grant', t('Grant Types'), '', t('leave blank unless your application sepcifically requires this')), - '$scope' => array('scope', t('Authorization scope'), '', t('leave blank unless your application sepcifically requires this')), - )); - return $o; - } - - if((argc() > 3) && (argv(2) === 'edit')) { - $r = q("SELECT * FROM oauth_clients WHERE client_id='%s' AND user_id= %d", - dbesc(argv(3)), - intval(local_channel()) - ); - - if (! $r){ - notice(t('OAuth2 Application not found.')); - return; - } - - $app = $r[0]; - - $tpl = get_markup_template("settings_oauth2_edit.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_oauth2"), - '$title' => t('Add application'), - '$submit' => t('Update'), - '$cancel' => t('Cancel'), - '$name' => array('name', t('Name'), $app['client_id'], t('Name of application')), - '$secret' => array('secret', t('Consumer Secret'), $app['client_secret'], t('Automatically generated - change if desired. Max length 20')), - '$redirect' => array('redirect', t('Redirect'), $app['redirect_uri'], t('Redirect URI - leave blank unless your application specifically requires this')), - '$grant' => array('grant', t('Grant Types'), $app['grant_types'], t('leave blank unless your application specifically requires this')), - '$scope' => array('scope', t('Authorization scope'), $app['scope'], t('leave blank unless your application specifically requires this')), - )); - return $o; - } - - if((argc() > 3) && (argv(2) === 'delete')) { - check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2', 't'); - - $r = q("DELETE FROM oauth_clients WHERE client_id = '%s' AND user_id = %d", - dbesc(argv(3)), - intval(local_channel()) - ); - $r = q("DELETE FROM oauth_access_tokens WHERE client_id = '%s' AND user_id = %d", - dbesc(argv(3)), - intval(local_channel()) - ); - $r = q("DELETE FROM oauth_authorization_codes WHERE client_id = '%s' AND user_id = %d", - dbesc(argv(3)), - intval(local_channel()) - ); - $r = q("DELETE FROM oauth_refresh_tokens WHERE client_id = '%s' AND user_id = %d", - dbesc(argv(3)), - intval(local_channel()) - ); - goaway(z_root()."/settings/oauth2/"); - return; - } - - - $r = q("SELECT oauth_clients.*, oauth_access_tokens.access_token as oauth_token, (oauth_clients.user_id = %d) AS my - FROM oauth_clients - LEFT JOIN oauth_access_tokens ON oauth_clients.client_id=oauth_access_tokens.client_id AND - oauth_clients.user_id=oauth_access_tokens.user_id - WHERE oauth_clients.user_id IN (%d,0)", - intval(local_channel()), - intval(local_channel()) - ); - - $tpl = get_markup_template("settings_oauth2.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_oauth2"), - '$baseurl' => z_root(), - '$title' => t('Connected OAuth2 Apps'), - '$add' => t('Add application'), - '$edit' => t('Edit'), - '$delete' => t('Delete'), - '$consumerkey' => t('Client key starts with'), - '$noname' => t('No name'), - '$remove' => t('Remove authorization'), - '$apps' => $r, - )); - return $o; - - } - -} -- cgit v1.2.3 From d7ec36e3da017bff3bed64d2714e9cdf460e0c18 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 16:23:12 +0200 Subject: wrong app name --- Zotlabs/Module/Oauth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Oauth.php b/Zotlabs/Module/Oauth.php index 196209308..9297eb65d 100644 --- a/Zotlabs/Module/Oauth.php +++ b/Zotlabs/Module/Oauth.php @@ -11,7 +11,7 @@ class Oauth extends Controller { function post() { - if(! Apps::system_app_installed(local_channel(), 'OAuth')) + if(! Apps::system_app_installed(local_channel(), 'OAuth Apps Manager')) return; if(x($_POST,'remove')){ -- cgit v1.2.3 From 9af1b62beef76781e3384a536377d9f8123aab07 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 16:26:36 +0200 Subject: change wording --- Zotlabs/Module/Oauth.php | 4 ++-- Zotlabs/Module/Oauth2.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Oauth.php b/Zotlabs/Module/Oauth.php index 9297eb65d..d087ecec4 100644 --- a/Zotlabs/Module/Oauth.php +++ b/Zotlabs/Module/Oauth.php @@ -90,8 +90,8 @@ class Oauth extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'OAuth App (Not Installed):
'; - $o .= t('An OAuth apps manager'); + $o = 'OAuth Apps Manager App (Not Installed):
'; + $o .= t('OAuth authenticatication tokens for mobile and remote apps'); return $o; } diff --git a/Zotlabs/Module/Oauth2.php b/Zotlabs/Module/Oauth2.php index 2302d1b10..4c34b499f 100644 --- a/Zotlabs/Module/Oauth2.php +++ b/Zotlabs/Module/Oauth2.php @@ -97,8 +97,8 @@ class Oauth2 extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'OAuth2 App (Not Installed):
'; - $o .= t('An OAuth2 apps manager'); + $o = 'OAuth2 Apps Manager App (Not Installed):
'; + $o .= t('OAuth2 authenticatication tokens for mobile and remote apps'); return $o; } -- cgit v1.2.3 From 1353c291e9d6fbe4cdbe8e4911f99d51e1da9198 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 16:32:06 +0200 Subject: add check for local_channel() --- Zotlabs/Module/Oauth.php | 7 +++++++ Zotlabs/Module/Oauth2.php | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Oauth.php b/Zotlabs/Module/Oauth.php index d087ecec4..5aae71ae7 100644 --- a/Zotlabs/Module/Oauth.php +++ b/Zotlabs/Module/Oauth.php @@ -11,6 +11,10 @@ class Oauth extends Controller { function post() { + if(! local_channel()) + return; + + if(! Apps::system_app_installed(local_channel(), 'OAuth Apps Manager')) return; @@ -86,6 +90,9 @@ class Oauth extends Controller { function get() { + if(! local_channel()) + return; + if(! Apps::system_app_installed(local_channel(), 'OAuth Apps Manager')) { //Do not display any associated widgets at this point App::$pdl = ''; diff --git a/Zotlabs/Module/Oauth2.php b/Zotlabs/Module/Oauth2.php index 4c34b499f..c27d7534b 100644 --- a/Zotlabs/Module/Oauth2.php +++ b/Zotlabs/Module/Oauth2.php @@ -11,6 +11,9 @@ class Oauth2 extends Controller { function post() { + if(! local_channel()) + return; + if(! Apps::system_app_installed(local_channel(), 'OAuth2 Apps Manager')) return; @@ -93,6 +96,9 @@ class Oauth2 extends Controller { function get() { + if(! local_channel()) + return; + if(! Apps::system_app_installed(local_channel(), 'OAuth2 Apps Manager')) { //Do not display any associated widgets at this point App::$pdl = ''; -- cgit v1.2.3 From 505782f224d232acd57f7a5986adfc9bf8a7bb79 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 16:35:05 +0200 Subject: remove oauth from features --- Zotlabs/Widget/Settings_menu.php | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 1b96e4d14..041ca312f 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -79,22 +79,6 @@ class Settings_menu { 'selected' => '' ); - if(feature_enabled(local_channel(),'oauth_clients')) { - $tabs[] = array( - 'label' => t('OAuth1 apps'), - 'url' => z_root() . '/settings/oauth', - 'selected' => ((argv(1) === 'oauth') ? 'active' : ''), - ); - } - - if(feature_enabled(local_channel(),'oauth2_clients')) { - $tabs[] = array( - 'label' => t('OAuth2 apps'), - 'url' => z_root() . '/settings/oauth2', - 'selected' => ((argv(1) === 'oauth2') ? 'active' : ''), - ); - } - if(feature_enabled(local_channel(),'access_tokens')) { $tabs[] = array( 'label' => t('Guest Access Tokens'), -- cgit v1.2.3 From a7948d7bfee1c0c8c9f1a731aabdc636c280bff0 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 22:02:50 +0200 Subject: permcats app --- Zotlabs/Module/Connedit.php | 3 +- Zotlabs/Module/Defperms.php | 3 +- Zotlabs/Module/Permcats.php | 135 +++++++++++++++++++++++++++++++++++ Zotlabs/Module/Settings/Permcats.php | 120 ------------------------------- Zotlabs/Widget/Settings_menu.php | 8 --- 5 files changed, 139 insertions(+), 130 deletions(-) create mode 100644 Zotlabs/Module/Permcats.php delete mode 100644 Zotlabs/Module/Settings/Permcats.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Connedit.php b/Zotlabs/Module/Connedit.php index 712215bc3..3d7ee449a 100644 --- a/Zotlabs/Module/Connedit.php +++ b/Zotlabs/Module/Connedit.php @@ -7,6 +7,7 @@ namespace Zotlabs\Module; * */ +use Zotlabs\Lib\Apps; require_once('include/socgraph.php'); require_once('include/selectors.php'); @@ -851,7 +852,7 @@ class Connedit extends \Zotlabs\Web\Controller { '$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('Connection requests will be approved without your interaction'), $yes_no), '$permcat' => [ 'permcat', t('Permission role'), '', '',$permcats ], '$permcat_new' => t('Add permission role'), - '$permcat_enable' => feature_enabled(local_channel(),'permcats'), + '$permcat_enable' => Apps::system_app_installed(local_channel(), 'Permission Categories'), '$addr' => unpunify($contact['xchan_addr']), '$primeurl' => unpunify($contact['xchan_url']), '$section' => $section, diff --git a/Zotlabs/Module/Defperms.php b/Zotlabs/Module/Defperms.php index 63acc9795..2e886aa64 100644 --- a/Zotlabs/Module/Defperms.php +++ b/Zotlabs/Module/Defperms.php @@ -1,6 +1,7 @@ array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), t('If enabled, connection requests will be approved without your interaction'), $yes_no), '$permcat' => [ 'permcat', t('Permission role'), '', '',$permcats ], '$permcat_new' => t('Add permission role'), - '$permcat_enable' => feature_enabled(local_channel(),'permcats'), + '$permcat_enable' => Apps::system_app_installed(local_channel(), 'Permission Categories'), '$section' => $section, '$sections' => $sections, '$autolbl' => t('The permissions indicated on this page will be applied to all new connections.'), diff --git a/Zotlabs/Module/Permcats.php b/Zotlabs/Module/Permcats.php new file mode 100644 index 000000000..97090067b --- /dev/null +++ b/Zotlabs/Module/Permcats.php @@ -0,0 +1,135 @@ + $desc) { + if(array_key_exists('perms_' . $perm, $_POST)) { + $pcarr[] = $perm; + } + } + } + + \Zotlabs\Lib\Permcat::update(local_channel(),$name,$pcarr); + + build_sync_packet(); + + info( t('Permission category saved.') . EOL); + + return; + } + + + function get() { + + if(! local_channel()) + return; + + if(! Apps::system_app_installed(local_channel(), 'Permission Categories')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = 'Permission Categories App (Not Installed):
'; + $o .= t('Create custom connection permission limits'); + return $o; + } + + $channel = App::get_channel(); + + + if(argc() > 1) + $name = hex2bin(argv(1)); + + if(argc() > 2 && argv(2) === 'drop') { + \Zotlabs\Lib\Permcat::delete(local_channel(),$name); + build_sync_packet(); + json_return_and_die([ 'success' => true ]); + } + + + $desc = t('Use this form to create permission rules for various classes of people or connections.'); + + $existing = []; + + $pcat = new \Zotlabs\Lib\Permcat(local_channel()); + $pcatlist = $pcat->listing(); + $permcats = []; + if($pcatlist) { + foreach($pcatlist as $pc) { + if(($pc['name']) && ($name) && ($pc['name'] == $name)) + $existing = $pc['perms']; + if(! $pc['system']) + $permcats[bin2hex($pc['name'])] = $pc['localname']; + } + } + + $global_perms = \Zotlabs\Access\Permissions::Perms(); + + foreach($global_perms as $k => $v) { + $thisperm = \Zotlabs\Lib\Permcat::find_permcat($existing,$k); + $checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k); + + if($existing[$k]) + $thisperm = "1"; + + $perms[] = array('perms_' . $k, $v, '',$thisperm, 1, (($checkinherited & PERMS_SPECIFIC) ? '' : '1'), '', $checkinherited); + } + + + + $tpl = get_markup_template("permcats.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("permcats"), + '$title' => t('Permission Categories'), + '$desc' => $desc, + '$desc2' => $desc2, + '$tokens' => $t, + '$permcats' => $permcats, + '$atoken' => $atoken, + '$url1' => z_root() . '/channel/' . $channel['channel_address'], + '$url2' => z_root() . '/photos/' . $channel['channel_address'], + '$name' => array('name', t('Permission Name') . ' *', (($name) ? $name : ''), ''), + '$me' => t('My Settings'), + '$perms' => $perms, + '$inherited' => t('inherited'), + '$notself' => 0, + '$self' => 1, + '$permlbl' => t('Individual Permissions'), + '$permnote' => t('Some permissions may be inherited from your channel\'s privacy settings, which have higher priority than individual settings. You can not change those settings here.'), + '$submit' => t('Submit') + )); + return $o; + } + +} diff --git a/Zotlabs/Module/Settings/Permcats.php b/Zotlabs/Module/Settings/Permcats.php deleted file mode 100644 index 40641c3f2..000000000 --- a/Zotlabs/Module/Settings/Permcats.php +++ /dev/null @@ -1,120 +0,0 @@ - $desc) { - if(array_key_exists('perms_' . $perm, $_POST)) { - $pcarr[] = $perm; - } - } - } - - \Zotlabs\Lib\Permcat::update(local_channel(),$name,$pcarr); - - build_sync_packet(); - - info( t('Permission category saved.') . EOL); - - return; - } - - - function get() { - - if(! local_channel()) - return; - - $channel = \App::get_channel(); - - - if(argc() > 2) - $name = hex2bin(argv(2)); - - if(argc() > 3 && argv(3) === 'drop') { - \Zotlabs\Lib\Permcat::delete(local_channel(),$name); - build_sync_packet(); - json_return_and_die([ 'success' => true ]); - } - - - $desc = t('Use this form to create permission rules for various classes of people or connections.'); - - $existing = []; - - $pcat = new \Zotlabs\Lib\Permcat(local_channel()); - $pcatlist = $pcat->listing(); - $permcats = []; - if($pcatlist) { - foreach($pcatlist as $pc) { - if(($pc['name']) && ($name) && ($pc['name'] == $name)) - $existing = $pc['perms']; - if(! $pc['system']) - $permcats[bin2hex($pc['name'])] = $pc['localname']; - } - } - - $global_perms = \Zotlabs\Access\Permissions::Perms(); - - foreach($global_perms as $k => $v) { - $thisperm = \Zotlabs\Lib\Permcat::find_permcat($existing,$k); - $checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k); - - if($existing[$k]) - $thisperm = "1"; - - $perms[] = array('perms_' . $k, $v, '',$thisperm, 1, (($checkinherited & PERMS_SPECIFIC) ? '' : '1'), '', $checkinherited); - } - - - - $tpl = get_markup_template("settings_permcats.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_permcats"), - '$title' => t('Permission Categories'), - '$desc' => $desc, - '$desc2' => $desc2, - '$tokens' => $t, - '$permcats' => $permcats, - '$atoken' => $atoken, - '$url1' => z_root() . '/channel/' . $channel['channel_address'], - '$url2' => z_root() . '/photos/' . $channel['channel_address'], - '$name' => array('name', t('Permission Name') . ' *', (($name) ? $name : ''), ''), - '$me' => t('My Settings'), - '$perms' => $perms, - '$inherited' => t('inherited'), - '$notself' => 0, - '$self' => 1, - '$permlbl' => t('Individual Permissions'), - '$permnote' => t('Some permissions may be inherited from your channel\'s privacy settings, which have higher priority than individual settings. You can not change those settings here.'), - '$submit' => t('Submit') - )); - return $o; - } - -} diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 041ca312f..781f3b145 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -87,14 +87,6 @@ class Settings_menu { ); } - if(feature_enabled(local_channel(),'permcats')) { - $tabs[] = array( - 'label' => t('Permission Categories'), - 'url' => z_root() . '/settings/permcats', - 'selected' => ((argv(1) === 'permcats') ? 'active' : ''), - ); - } - if($role === false || $role === 'custom') { $tabs[] = array( 'label' => t('Connection Default Permissions'), -- cgit v1.2.3 From e3c04b1fd0f441e0042e218f47696b1bfad26c73 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 22:24:36 +0200 Subject: guest access app --- Zotlabs/Module/Permcats.php | 4 +- Zotlabs/Module/Settings/Tokens.php | 173 --------------------------------- Zotlabs/Module/Tokens.php | 193 +++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Settings_menu.php | 8 -- 4 files changed, 194 insertions(+), 184 deletions(-) delete mode 100644 Zotlabs/Module/Settings/Tokens.php create mode 100644 Zotlabs/Module/Tokens.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Permcats.php b/Zotlabs/Module/Permcats.php index 97090067b..3d068862a 100644 --- a/Zotlabs/Module/Permcats.php +++ b/Zotlabs/Module/Permcats.php @@ -14,8 +14,7 @@ class Permcats extends Controller { return; if(! Apps::system_app_installed(local_channel(), 'Permission Categories')) - return - + return; $channel = App::get_channel(); @@ -67,7 +66,6 @@ class Permcats extends Controller { $channel = App::get_channel(); - if(argc() > 1) $name = hex2bin(argv(1)); diff --git a/Zotlabs/Module/Settings/Tokens.php b/Zotlabs/Module/Settings/Tokens.php deleted file mode 100644 index e59cf8d1c..000000000 --- a/Zotlabs/Module/Settings/Tokens.php +++ /dev/null @@ -1,173 +0,0 @@ -= $max_tokens) { - notice( sprintf( t('This channel is limited to %d tokens'), $max_tokens) . EOL); - return; - } - } - } - if($token_errs) { - notice( t('Name and Password are required.') . EOL); - return; - } - if($atoken_id) { - $r = q("update atoken set atoken_name = '%s', atoken_token = '%s', atoken_expires = '%s' - where atoken_id = %d and atoken_uid = %d", - dbesc($name), - dbesc($token), - dbesc($expires), - intval($atoken_id), - intval($channel['channel_id']) - ); - } - else { - $r = q("insert into atoken ( atoken_aid, atoken_uid, atoken_name, atoken_token, atoken_expires ) - values ( %d, %d, '%s', '%s', '%s' ) ", - intval($channel['channel_account_id']), - intval($channel['channel_id']), - dbesc($name), - dbesc($token), - dbesc($expires) - ); - } - - $atoken_xchan = substr($channel['channel_hash'],0,16) . '.' . $name; - - $all_perms = \Zotlabs\Access\Permissions::Perms(); - - if($all_perms) { - foreach($all_perms as $perm => $desc) { - if(array_key_exists('perms_' . $perm, $_POST)) { - set_abconfig($channel['channel_id'],$atoken_xchan,'my_perms',$perm,intval($_POST['perms_' . $perm])); - } - else { - set_abconfig($channel['channel_id'],$atoken_xchan,'my_perms',$perm,0); - } - } - } - - - info( t('Token saved.') . EOL); - return; - } - - - function get() { - - $channel = \App::get_channel(); - - $atoken = null; - $atoken_xchan = ''; - - if(argc() > 2) { - $id = argv(2); - - $atoken = q("select * from atoken where atoken_id = %d and atoken_uid = %d", - intval($id), - intval(local_channel()) - ); - - if($atoken) { - $atoken = $atoken[0]; - $atoken_xchan = substr($channel['channel_hash'],0,16) . '.' . $atoken['atoken_name']; - } - - if($atoken && argc() > 3 && argv(3) === 'drop') { - atoken_delete($id); - $atoken = null; - $atoken_xchan = ''; - } - } - - $t = q("select * from atoken where atoken_uid = %d", - intval(local_channel()) - ); - - $desc = t('Use this form to create temporary access identifiers to share things with non-members. These identities may be used in Access Control Lists and visitors may login using these credentials to access private content.'); - - $desc2 = t('You may also provide dropbox style access links to friends and associates by adding the Login Password to any specific site URL as shown. Examples:'); - - $global_perms = \Zotlabs\Access\Permissions::Perms(); - $their_perms = []; - - $existing = get_all_perms(local_channel(),(($atoken_xchan) ? $atoken_xchan : ''),false); - - if($atoken_xchan) { - $theirs = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'their_perms'", - intval(local_channel()), - dbesc($atoken_xchan) - ); - if($theirs) { - foreach($theirs as $t) { - $their_perms[$t['k']] = $t['v']; - } - } - } - foreach($global_perms as $k => $v) { - $thisperm = get_abconfig(local_channel(),$contact['abook_xchan'],'my_perms',$k); -//fixme - - $checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k); - - if($existing[$k]) - $thisperm = "1"; - - $perms[] = array('perms_' . $k, $v, ((array_key_exists($k,$their_perms)) ? intval($their_perms[$k]) : ''),$thisperm, 1, (($checkinherited & PERMS_SPECIFIC) ? '' : '1'), '', $checkinherited); - } - - - - $tpl = get_markup_template("settings_tokens.tpl"); - $o .= replace_macros($tpl, array( - '$form_security_token' => get_form_security_token("settings_tokens"), - '$title' => t('Guest Access Tokens'), - '$desc' => $desc, - '$desc2' => $desc2, - '$tokens' => $t, - '$atoken' => $atoken, - '$url1' => z_root() . '/channel/' . $channel['channel_address'], - '$url2' => z_root() . '/photos/' . $channel['channel_address'], - '$name' => array('name', t('Login Name') . ' *', (($atoken) ? $atoken['atoken_name'] : ''),''), - '$token'=> array('token', t('Login Password') . ' *',(($atoken) ? $atoken['atoken_token'] : autoname(8)), ''), - '$expires'=> array('expires', t('Expires (yyyy-mm-dd)'), (($atoken['atoken_expires'] && $atoken['atoken_expires'] > NULL_DATE) ? datetime_convert('UTC',date_default_timezone_get(),$atoken['atoken_expires']) : ''), ''), - '$them' => t('Their Settings'), - '$me' => t('My Settings'), - '$perms' => $perms, - '$inherited' => t('inherited'), - '$notself' => 1, - '$self' => 0, - '$permlbl' => t('Individual Permissions'), - '$permnote' => t('Some permissions may be inherited from your channel\'s privacy settings, which have higher priority than individual settings. You can not change those settings here.'), - '$submit' => t('Submit') - )); - return $o; - } - -} diff --git a/Zotlabs/Module/Tokens.php b/Zotlabs/Module/Tokens.php new file mode 100644 index 000000000..a791d3f63 --- /dev/null +++ b/Zotlabs/Module/Tokens.php @@ -0,0 +1,193 @@ += $max_tokens) { + notice( sprintf( t('This channel is limited to %d tokens'), $max_tokens) . EOL); + return; + } + } + } + if($token_errs) { + notice( t('Name and Password are required.') . EOL); + return; + } + if($atoken_id) { + $r = q("update atoken set atoken_name = '%s', atoken_token = '%s', atoken_expires = '%s' + where atoken_id = %d and atoken_uid = %d", + dbesc($name), + dbesc($token), + dbesc($expires), + intval($atoken_id), + intval($channel['channel_id']) + ); + } + else { + $r = q("insert into atoken ( atoken_aid, atoken_uid, atoken_name, atoken_token, atoken_expires ) + values ( %d, %d, '%s', '%s', '%s' ) ", + intval($channel['channel_account_id']), + intval($channel['channel_id']), + dbesc($name), + dbesc($token), + dbesc($expires) + ); + } + + $atoken_xchan = substr($channel['channel_hash'],0,16) . '.' . $name; + + $all_perms = \Zotlabs\Access\Permissions::Perms(); + + if($all_perms) { + foreach($all_perms as $perm => $desc) { + if(array_key_exists('perms_' . $perm, $_POST)) { + set_abconfig($channel['channel_id'],$atoken_xchan,'my_perms',$perm,intval($_POST['perms_' . $perm])); + } + else { + set_abconfig($channel['channel_id'],$atoken_xchan,'my_perms',$perm,0); + } + } + } + + + info( t('Token saved.') . EOL); + return; + } + + + function get() { + + if(! local_channel()) + return; + + if(! Apps::system_app_installed(local_channel(), 'Guest Access')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = 'Guest Access App (Not Installed):
'; + $o .= t('Create access tokens so that non-members can access private content'); + return $o; + } + + $channel = App::get_channel(); + + $atoken = null; + $atoken_xchan = ''; + + if(argc() > 2) { + $id = argv(2); + + $atoken = q("select * from atoken where atoken_id = %d and atoken_uid = %d", + intval($id), + intval(local_channel()) + ); + + if($atoken) { + $atoken = $atoken[0]; + $atoken_xchan = substr($channel['channel_hash'],0,16) . '.' . $atoken['atoken_name']; + } + + if($atoken && argc() > 3 && argv(3) === 'drop') { + atoken_delete($id); + $atoken = null; + $atoken_xchan = ''; + } + } + + $t = q("select * from atoken where atoken_uid = %d", + intval(local_channel()) + ); + + $desc = t('Use this form to create temporary access identifiers to share things with non-members. These identities may be used in Access Control Lists and visitors may login using these credentials to access private content.'); + + $desc2 = t('You may also provide dropbox style access links to friends and associates by adding the Login Password to any specific site URL as shown. Examples:'); + + $global_perms = \Zotlabs\Access\Permissions::Perms(); + $their_perms = []; + + $existing = get_all_perms(local_channel(),(($atoken_xchan) ? $atoken_xchan : ''),false); + + if($atoken_xchan) { + $theirs = q("select * from abconfig where chan = %d and xchan = '%s' and cat = 'their_perms'", + intval(local_channel()), + dbesc($atoken_xchan) + ); + if($theirs) { + foreach($theirs as $t) { + $their_perms[$t['k']] = $t['v']; + } + } + } + foreach($global_perms as $k => $v) { + $thisperm = get_abconfig(local_channel(),$contact['abook_xchan'],'my_perms',$k); +//fixme + + $checkinherited = \Zotlabs\Access\PermissionLimits::Get(local_channel(),$k); + + if($existing[$k]) + $thisperm = "1"; + + $perms[] = array('perms_' . $k, $v, ((array_key_exists($k,$their_perms)) ? intval($their_perms[$k]) : ''),$thisperm, 1, (($checkinherited & PERMS_SPECIFIC) ? '' : '1'), '', $checkinherited); + } + + + + $tpl = get_markup_template("tokens.tpl"); + $o .= replace_macros($tpl, array( + '$form_security_token' => get_form_security_token("tokens"), + '$title' => t('Guest Access Tokens'), + '$desc' => $desc, + '$desc2' => $desc2, + '$tokens' => $t, + '$atoken' => $atoken, + '$url1' => z_root() . '/channel/' . $channel['channel_address'], + '$url2' => z_root() . '/photos/' . $channel['channel_address'], + '$name' => array('name', t('Login Name') . ' *', (($atoken) ? $atoken['atoken_name'] : ''),''), + '$token'=> array('token', t('Login Password') . ' *',(($atoken) ? $atoken['atoken_token'] : autoname(8)), ''), + '$expires'=> array('expires', t('Expires (yyyy-mm-dd)'), (($atoken['atoken_expires'] && $atoken['atoken_expires'] > NULL_DATE) ? datetime_convert('UTC',date_default_timezone_get(),$atoken['atoken_expires']) : ''), ''), + '$them' => t('Their Settings'), + '$me' => t('My Settings'), + '$perms' => $perms, + '$inherited' => t('inherited'), + '$notself' => 1, + '$self' => 0, + '$permlbl' => t('Individual Permissions'), + '$permnote' => t('Some permissions may be inherited from your channel\'s privacy settings, which have higher priority than individual settings. You can not change those settings here.'), + '$submit' => t('Submit') + )); + return $o; + } + +} diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 781f3b145..ecf93ec78 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -79,14 +79,6 @@ class Settings_menu { 'selected' => '' ); - if(feature_enabled(local_channel(),'access_tokens')) { - $tabs[] = array( - 'label' => t('Guest Access Tokens'), - 'url' => z_root() . '/settings/tokens', - 'selected' => ((argv(1) === 'tokens') ? 'active' : ''), - ); - } - if($role === false || $role === 'custom') { $tabs[] = array( 'label' => t('Connection Default Permissions'), -- cgit v1.2.3 From bdf6289b323c26329087eb21911576239e0b6216 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 26 Sep 2018 22:32:06 +0200 Subject: tokens: add css file and fix argc and argv values --- Zotlabs/Module/Tokens.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Tokens.php b/Zotlabs/Module/Tokens.php index a791d3f63..ae03a499a 100644 --- a/Zotlabs/Module/Tokens.php +++ b/Zotlabs/Module/Tokens.php @@ -106,8 +106,8 @@ class Tokens extends Controller { $atoken = null; $atoken_xchan = ''; - if(argc() > 2) { - $id = argv(2); + if(argc() > 1) { + $id = argv(1); $atoken = q("select * from atoken where atoken_id = %d and atoken_uid = %d", intval($id), @@ -119,7 +119,7 @@ class Tokens extends Controller { $atoken_xchan = substr($channel['channel_hash'],0,16) . '.' . $atoken['atoken_name']; } - if($atoken && argc() > 3 && argv(3) === 'drop') { + if($atoken && argc() > 2 && argv(2) === 'drop') { atoken_delete($id); $atoken = null; $atoken_xchan = ''; -- cgit v1.2.3 From 6b23c3e1796b818ce893ed919f2e2bdd000c83fb Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 27 Sep 2018 14:56:47 +0200 Subject: implement conversation tools (settings/conversation), remove additional features from the settings menu and get rid of skill levels --- Zotlabs/Lib/ThreadItem.php | 7 ++-- Zotlabs/Module/Settings/Conversation.php | 60 ++++++++++++++++++++++++++++++++ Zotlabs/Module/Settings/Features.php | 35 +------------------ Zotlabs/Widget/Settings_menu.php | 8 ----- 4 files changed, 66 insertions(+), 44 deletions(-) create mode 100644 Zotlabs/Module/Settings/Conversation.php (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index f8a7366f8..ac24806a6 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -259,7 +259,7 @@ class ThreadItem { $forged = ((($item['sig']) && (! intval($item['item_verified']))) ? t('Message signature incorrect') : ''); $unverified = '' ; // (($this->is_wall_to_wall() && (! intval($item['item_verified']))) ? t('Message cannot be verified') : ''); - + $settings = ''; // FIXME - check this permission if($conv->get_profile_owner() == local_channel()) { @@ -267,6 +267,8 @@ class ThreadItem { 'tagit' => t("Add Tag"), 'classtagger' => "", ); + + $settings = t('Conversation Tools'); } $has_bookmarks = false; @@ -436,7 +438,8 @@ class ThreadItem { 'preview_lbl' => t('This is an unsaved preview'), 'wait' => t('Please wait'), 'submid' => str_replace(['+','='], ['',''], base64_encode($item['mid'])), - 'thread_level' => $thread_level + 'thread_level' => $thread_level, + 'settings' => $settings ); $arr = array('item' => $item, 'output' => $tmp_item); diff --git a/Zotlabs/Module/Settings/Conversation.php b/Zotlabs/Module/Settings/Conversation.php new file mode 100644 index 000000000..43e59a3c2 --- /dev/null +++ b/Zotlabs/Module/Settings/Conversation.php @@ -0,0 +1,60 @@ + 'settings/' . $module, + '$form_security_token' => get_form_security_token('settings_' . $module), + '$title' => t('Conversation Settings'), + '$features' => process_module_features_get(local_channel(), $features), + '$submit' => t('Submit') + )); + + if($aj) { + echo $o; + killme(); + } + else { + return $o; + } + } + +} diff --git a/Zotlabs/Module/Settings/Features.php b/Zotlabs/Module/Settings/Features.php index 888032c28..6a3ab104b 100644 --- a/Zotlabs/Module/Settings/Features.php +++ b/Zotlabs/Module/Settings/Features.php @@ -26,44 +26,14 @@ class Features { function get() { $arr = []; - $harr = []; - if(intval($_REQUEST['techlevel'])) - $level = intval($_REQUEST['techlevel']); - else { - $level = get_account_techlevel(); - } - - if(! intval($level)) { - notice( t('Permission denied.') . EOL); - return; - } - - $techlevels = \Zotlabs\Lib\Techlevels::levels(); - - // This page isn't accessible at techlevel 0 - - unset($techlevels[0]); - - $def_techlevel = (($level > 0) ? $level : 1); - $techlock = get_config('system','techlevel_lock'); - - $all_features_raw = get_features(false); - - foreach($all_features_raw as $fname => $fdata) { - foreach(array_slice($fdata,1) as $f) { - $harr[$f[0]] = ((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''); - } - } - - $features = get_features(true,$level); + $features = get_features(false); foreach($features as $fname => $fdata) { $arr[$fname] = array(); $arr[$fname][0] = $fdata[0]; foreach(array_slice($fdata,1) as $f) { $arr[$fname][1][] = array('feature_' . $f[0],$f[1],((intval(feature_enabled(local_channel(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On'))); - unset($harr[$f[0]]); } } @@ -71,10 +41,7 @@ class Features { $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_features"), '$title' => t('Additional Features'), - '$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, '$features' => $arr, - '$hiddens' => $harr, '$baseurl' => z_root(), '$submit' => t('Submit'), )); diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index ecf93ec78..92f615452 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -45,14 +45,6 @@ class Settings_menu { ); - if(get_account_techlevel() > 0 && get_features()) { - $tabs[] = array( - 'label' => t('Additional features'), - 'url' => z_root().'/settings/features', - 'selected' => ((argv(1) === 'features') ? 'active' : ''), - ); - } - $tabs[] = array( 'label' => t('Addon settings'), 'url' => z_root().'/settings/featured', -- cgit v1.2.3 From 6f98ca68af59e7c27179b5b9712a4fa015ad7f47 Mon Sep 17 00:00:00 2001 From: "M.Dent" Date: Thu, 27 Sep 2018 13:37:15 -0400 Subject: Translate system app names --- Zotlabs/Lib/Apps.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 4ee64f15e..519d5f35a 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -763,6 +763,7 @@ class Apps { call_hooks('app_list',$hookinfo); $r = $hookinfo['apps']; for($x = 0; $x < count($r); $x ++) { + $r[$x]['app_name']=t(trim($r[$x]['app_name'])); if(! $r[$x]['app_system']) $r[$x]['type'] = 'personal'; $r[$x]['term'] = q("select * from term where otype = %d and oid = %d", -- cgit v1.2.3 From 56fdc4f3febbc5a2242d8ce6ab6d51f83feae42d Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 27 Sep 2018 20:26:47 +0200 Subject: Missprint in Oauth.php fixed --- Zotlabs/Module/Oauth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Oauth.php b/Zotlabs/Module/Oauth.php index 5aae71ae7..fbcc48ead 100644 --- a/Zotlabs/Module/Oauth.php +++ b/Zotlabs/Module/Oauth.php @@ -98,7 +98,7 @@ class Oauth extends Controller { App::$pdl = ''; $o = 'OAuth Apps Manager App (Not Installed):
'; - $o .= t('OAuth authenticatication tokens for mobile and remote apps'); + $o .= t('OAuth authentication tokens for mobile and remote apps'); return $o; } -- cgit v1.2.3 From 78ed1ae44623f58c4e9e2d6fd4d6a4ff322309fd Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 27 Sep 2018 21:57:27 +0200 Subject: Add translation for new apps --- Zotlabs/Lib/Apps.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 519d5f35a..aef6756b5 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -337,7 +337,20 @@ class Apps { 'Profiles' => t('Profiles'), 'Privacy Groups' => t('Privacy Groups'), 'Notifications' => t('Notifications'), - 'Order Apps' => t('Order Apps') + 'Order Apps' => t('Order Apps'), + 'CalDAV' => t('CalDAV'), + 'CardDAV' => t('CardDAV'), + 'Channel Sources' => t('Channel Sources'), + 'Gallery' => t('Gallery'), + 'Guest Access' => t('Guest Access'), + 'Notes' => t('Notes'), + 'OAuth Apps Manager' => t('OAuth Apps Manager'), + 'OAuth2 Apps Manager' => t('OAuth2 Apps Manager'), + 'PDL Editor' => t('PDL Editor'), + 'Permission Categories' => t('Permission Categories'), + 'Premium Channel' => t('Premium Channel'), + 'Public Stream' => t('Public Stream'), + 'My Chatrooms' => t('My Chatrooms') ); if(array_key_exists('name',$arr)) { @@ -349,6 +362,9 @@ class Apps { for($x = 0; $x < count($arr); $x++) { if(array_key_exists($arr[$x]['name'],$apps)) { $arr[$x]['name'] = $apps[$arr[$x]['name']]; + } else { + // Try to guess by app name if not in list + $arr[$x]['name'] = t(trim($arr[$x]['name'])); } } } @@ -763,7 +779,6 @@ class Apps { call_hooks('app_list',$hookinfo); $r = $hookinfo['apps']; for($x = 0; $x < count($r); $x ++) { - $r[$x]['app_name']=t(trim($r[$x]['app_name'])); if(! $r[$x]['app_system']) $r[$x]['type'] = 'personal'; $r[$x]['term'] = q("select * from term where otype = %d and oid = %d", -- cgit v1.2.3 From 98b3946fca91fbacb662c14a1545e8eb1982ef3e Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 27 Sep 2018 23:42:11 +0200 Subject: rename groups and group_members tables for MySQL 8 compatibility --- Zotlabs/Update/_1221.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Zotlabs/Update/_1221.php (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1221.php b/Zotlabs/Update/_1221.php new file mode 100644 index 000000000..252fcaa90 --- /dev/null +++ b/Zotlabs/Update/_1221.php @@ -0,0 +1,20 @@ + Date: Fri, 28 Sep 2018 00:01:39 +0200 Subject: Update Activity_filter.php --- Zotlabs/Widget/Activity_filter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php index 912bfce49..c27a5d48b 100644 --- a/Zotlabs/Widget/Activity_filter.php +++ b/Zotlabs/Widget/Activity_filter.php @@ -47,7 +47,7 @@ class Activity_filter { } if(Apps::system_app_installed(local_channel(), 'Privacy Groups')) { - $groups = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", + $groups = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval(local_channel()) ); -- cgit v1.2.3 From 3379f6f79339b7e6b77cd2d8a84e484585a1785a Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:02:58 +0200 Subject: Update Channel.php --- Zotlabs/Module/Settings/Channel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php index 27a8e695d..73cb4decb 100644 --- a/Zotlabs/Module/Settings/Channel.php +++ b/Zotlabs/Module/Settings/Channel.php @@ -63,7 +63,7 @@ class Channel { } $hide_presence = 1 - (intval($role_permissions['online'])); if($role_permissions['default_collection']) { - $r = q("select hash from groups where uid = %d and gname = '%s' limit 1", + $r = q("select hash from pgrp where uid = %d and gname = '%s' limit 1", intval(local_channel()), dbesc( t('Friends') ) ); @@ -71,7 +71,7 @@ class Channel { require_once('include/group.php'); group_add(local_channel(), t('Friends')); group_add_member(local_channel(),t('Friends'),$channel['channel_hash']); - $r = q("select hash from groups where uid = %d and gname = '%s' limit 1", + $r = q("select hash from pgrp where uid = %d and gname = '%s' limit 1", intval(local_channel()), dbesc( t('Friends') ) ); -- cgit v1.2.3 From 07f82e4a148eb11188e3182b42ae5d683c37e298 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:05:43 +0200 Subject: Update Network.php --- Zotlabs/Module/Network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index ffe605538..e7b150faf 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -108,7 +108,7 @@ class Network extends \Zotlabs\Web\Controller { // filter by collection (e.g. group) if($gid) { - $r = q("SELECT * FROM groups WHERE id = %d AND uid = %d LIMIT 1", + $r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d LIMIT 1", intval($gid), intval(local_channel()) ); -- cgit v1.2.3 From 444ae51a3e34438f1d4863c76e114d102d4087a3 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:06:26 +0200 Subject: Update Lockview.php --- Zotlabs/Module/Lockview.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Lockview.php b/Zotlabs/Module/Lockview.php index 466d16997..d7ed07a53 100644 --- a/Zotlabs/Module/Lockview.php +++ b/Zotlabs/Module/Lockview.php @@ -118,7 +118,7 @@ class Lockview extends \Zotlabs\Web\Controller { } if(count($allowed_groups)) { - $r = q("SELECT gname FROM groups WHERE hash IN ( " . implode(', ', $allowed_groups) . " )"); + $r = q("SELECT gname FROM pgrp WHERE hash IN ( " . implode(', ', $allowed_groups) . " )"); if($r) foreach($r as $rr) $l[] = ''; @@ -156,7 +156,7 @@ class Lockview extends \Zotlabs\Web\Controller { if(count($deny_groups)) { - $r = q("SELECT gname FROM groups WHERE hash IN ( " . implode(', ', $deny_groups) . " )"); + $r = q("SELECT gname FROM pgrp WHERE hash IN ( " . implode(', ', $deny_groups) . " )"); if($r) foreach($r as $rr) $l[] = ''; -- cgit v1.2.3 From 4efa5cfa75ac7f6d7e09b049f4304e019083765a Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:10:20 +0200 Subject: Update Group.php --- Zotlabs/Module/Group.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index bf0edb1ed..bfe051d59 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -53,7 +53,7 @@ class Group extends Controller { if((argc() == 2) && (intval(argv(1)))) { check_form_security_token_redirectOnErr('/group', 'group_edit'); - $r = q("SELECT * FROM groups WHERE id = %d AND uid = %d LIMIT 1", + $r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d LIMIT 1", intval(argv(1)), intval(local_channel()) ); @@ -67,7 +67,7 @@ class Group extends Controller { $public = intval($_POST['public']); if((strlen($groupname)) && (($groupname != $group['gname']) || ($public != $group['visible']))) { - $r = q("UPDATE groups SET gname = '%s', visible = %d WHERE uid = %d AND id = %d", + $r = q("UPDATE pgrp SET gname = '%s', visible = %d WHERE uid = %d AND id = %d", dbesc($groupname), intval($public), intval(local_channel()), @@ -115,7 +115,7 @@ class Group extends Controller { $new = (((argc() == 2) && (argv(1) === 'new')) ? true : false); - $groups = q("SELECT id, gname FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", + $groups = q("SELECT id, gname FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval(local_channel()) ); @@ -160,7 +160,7 @@ class Group extends Controller { check_form_security_token_redirectOnErr('/group', 'group_drop', 't'); if(intval(argv(2))) { - $r = q("SELECT gname FROM groups WHERE id = %d AND uid = %d LIMIT 1", + $r = q("SELECT gname FROM pgrp WHERE id = %d AND uid = %d LIMIT 1", intval(argv(2)), intval(local_channel()) ); @@ -192,7 +192,7 @@ class Group extends Controller { if((argc() > 1) && (intval(argv(1)))) { require_once('include/acl_selectors.php'); - $r = q("SELECT * FROM groups WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1", + $r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1", intval(argv(1)), intval(local_channel()) ); -- cgit v1.2.3 From da7bce3470b547e56343d163eb914cc3ddf9339c Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:11:03 +0200 Subject: Update Contactgroup.php --- Zotlabs/Module/Contactgroup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Contactgroup.php b/Zotlabs/Module/Contactgroup.php index 2ba53517f..36aaf7da0 100644 --- a/Zotlabs/Module/Contactgroup.php +++ b/Zotlabs/Module/Contactgroup.php @@ -23,7 +23,7 @@ class Contactgroup extends \Zotlabs\Web\Controller { if((argc() > 1) && (intval(argv(1)))) { - $r = q("SELECT * FROM groups WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1", + $r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1", intval(argv(1)), intval(local_channel()) ); -- cgit v1.2.3 From 978e45911fcda8a607e776aedbdcfe343f32f7a9 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:12:00 +0200 Subject: Update Connections.php --- Zotlabs/Module/Connections.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Connections.php b/Zotlabs/Module/Connections.php index 0e5f1dfe2..967e9521d 100644 --- a/Zotlabs/Module/Connections.php +++ b/Zotlabs/Module/Connections.php @@ -220,7 +220,7 @@ class Connections extends \Zotlabs\Web\Controller { $sql_extra .= (($searching) ? protect_sprintf(" AND xchan_name like '%$search_txt%' ") : ""); if($_REQUEST['gid']) { - $sql_extra .= " and xchan_hash in ( select xchan from group_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_channel()) . " ) "; + $sql_extra .= " and xchan_hash in ( select xchan from pgrp_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_channel()) . " ) "; } $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash -- cgit v1.2.3 From 25e8d70786d44b382a5949c9a8b504a6b9ce6a07 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:14:21 +0200 Subject: Update Acl.php --- Zotlabs/Module/Acl.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php index 0c2ad7522..ea131e08c 100644 --- a/Zotlabs/Module/Acl.php +++ b/Zotlabs/Module/Acl.php @@ -81,7 +81,7 @@ class Acl extends \Zotlabs\Web\Controller { if($search) { - $sql_extra = " AND groups.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " "; + $sql_extra = " AND pgrp.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " "; $sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc(punify($search)) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") "; // This horrible mess is needed because position also returns 0 if nothing is found. @@ -128,13 +128,13 @@ class Acl extends \Zotlabs\Web\Controller { // Normal privacy groups - $r = q("SELECT groups.id, groups.hash, groups.gname - FROM groups, group_member - WHERE groups.deleted = 0 AND groups.uid = %d - AND group_member.gid = groups.id + $r = q("SELECT pgrp.id, pgrp.hash, pgrp.gname + FROM pgrp, pgrp_member + WHERE pgrp.deleted = 0 AND pgrp.uid = %d + AND pgrp_member.gid = pgrp.id $sql_extra - GROUP BY groups.id - ORDER BY groups.gname + GROUP BY pgrp.id + ORDER BY pgrp.gname LIMIT %d OFFSET %d", intval(local_channel()), intval($count), -- cgit v1.2.3 From 9afa6cc245184498824014d99f35682ed48af7c8 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:20:03 +0200 Subject: Update Libsync.php --- Zotlabs/Lib/Libsync.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index 938d484b7..d037a0058 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -122,13 +122,13 @@ class Libsync { } if($groups_changed) { - $r = q("select hash as collection, visible, deleted, gname as name from groups where uid = %d", + $r = q("select hash as collection, visible, deleted, gname as name from pgrp where uid = %d", intval($uid) ); if($r) $info['collections'] = $r; - $r = q("select groups.hash as collection, group_member.xchan as member from groups left join group_member on groups.id = group_member.gid where group_member.uid = %d", + $r = q("select pgrp.hash as collection, pgrp_member.xchan as member from pgrp left join pgrp_member on pgrp.id = pgrp_member.gid where pgrp_member.uid = %d", intval($uid) ); if($r) @@ -464,7 +464,7 @@ class Libsync { // sync collections (privacy groups) oh joy... if(array_key_exists('collections',$arr) && is_array($arr['collections']) && count($arr['collections'])) { - $x = q("select * from groups where uid = %d", + $x = q("select * from pgrp where uid = %d", intval($channel['channel_id']) ); foreach($arr['collections'] as $cl) { @@ -480,7 +480,7 @@ class Libsync { if(($y['gname'] != $cl['name']) || ($y['visible'] != $cl['visible']) || ($y['deleted'] != $cl['deleted'])) { - q("update groups set gname = '%s', visible = %d, deleted = %d where hash = '%s' and uid = %d", + q("update pgrp set gname = '%s', visible = %d, deleted = %d where hash = '%s' and uid = %d", dbesc($cl['name']), intval($cl['visible']), intval($cl['deleted']), @@ -489,14 +489,14 @@ class Libsync { ); } if(intval($cl['deleted']) && (! intval($y['deleted']))) { - q("delete from group_member where gid = %d", + q("delete from pgrp_member where gid = %d", intval($y['id']) ); } } } if(! $found) { - $r = q("INSERT INTO groups ( hash, uid, visible, deleted, gname ) + $r = q("INSERT INTO pgrp ( hash, uid, visible, deleted, gname ) VALUES( '%s', %d, %d, %d, '%s' ) ", dbesc($cl['collection']), intval($channel['channel_id']), @@ -520,10 +520,10 @@ class Libsync { } } if(! $found_local) { - q("delete from group_member where gid = %d", + q("delete from pgrp_member where gid = %d", intval($y['id']) ); - q("update groups set deleted = 1 where id = %d and uid = %d", + q("update pgrp set deleted = 1 where id = %d and uid = %d", intval($y['id']), intval($channel['channel_id']) ); @@ -533,7 +533,7 @@ class Libsync { } // reload the group list with any updates - $x = q("select * from groups where uid = %d", + $x = q("select * from pgrp where uid = %d", intval($channel['channel_id']) ); @@ -560,7 +560,7 @@ class Libsync { if(isset($y['hash']) && isset($members[$y['hash']])) { foreach($members[$y['hash']] as $member) { $found = false; - $z = q("select xchan from group_member where gid = %d and uid = %d and xchan = '%s' limit 1", + $z = q("select xchan from pgrp_member where gid = %d and uid = %d and xchan = '%s' limit 1", intval($y['id']), intval($channel['channel_id']), dbesc($member) @@ -571,7 +571,7 @@ class Libsync { // if somebody is in the group that wasn't before - add them if(! $found) { - q("INSERT INTO group_member (uid, gid, xchan) + q("INSERT INTO pgrp_member (uid, gid, xchan) VALUES( %d, %d, '%s' ) ", intval($channel['channel_id']), intval($y['id']), @@ -582,7 +582,7 @@ class Libsync { } // now retrieve a list of members we have on this site - $m = q("select xchan from group_member where gid = %d and uid = %d", + $m = q("select xchan from pgrp_member where gid = %d and uid = %d", intval($y['id']), intval($channel['channel_id']) ); @@ -590,7 +590,7 @@ class Libsync { foreach($m as $mm) { // if the local existing member isn't in the list we just received - remove them if(! in_array($mm['xchan'],$members[$y['hash']])) { - q("delete from group_member where xchan = '%s' and gid = %d and uid = %d", + q("delete from pgrp_member where xchan = '%s' and gid = %d and uid = %d", dbesc($mm['xchan']), intval($y['id']), intval($channel['channel_id']) -- cgit v1.2.3 From f4799b2ddb9d64a00a50b122c1a313c0985816d6 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:26:01 +0200 Subject: Update Group.php --- Zotlabs/Lib/Group.php | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Group.php b/Zotlabs/Lib/Group.php index f136a3614..a4ff4fced 100644 --- a/Zotlabs/Lib/Group.php +++ b/Zotlabs/Lib/Group.php @@ -20,11 +20,11 @@ class Group { // access lists. What we're doing here is reviving the dead group, but old content which // was restricted to this group may now be seen by the new group members. - $z = q("SELECT * FROM groups WHERE id = %d LIMIT 1", + $z = q("SELECT * FROM pgrp WHERE id = %d LIMIT 1", intval($r) ); if(($z) && $z[0]['deleted']) { - q('UPDATE groups SET deleted = 0 WHERE id = %d', intval($z[0]['id'])); + q('UPDATE pgrp SET deleted = 0 WHERE id = %d', intval($z[0]['id'])); notice( t('A deleted group with this name was revived. Existing item permissions may apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL); } return true; @@ -34,13 +34,13 @@ class Group { $dups = false; $hash = random_string(32) . str_replace(['<','>'],['.','.'], $name); - $r = q("SELECT id FROM groups WHERE hash = '%s' LIMIT 1", dbesc($hash)); + $r = q("SELECT id FROM pgrp WHERE hash = '%s' LIMIT 1", dbesc($hash)); if($r) $dups = true; } while($dups == true); - $r = q("INSERT INTO groups ( hash, uid, visible, gname ) + $r = q("INSERT INTO pgrp ( hash, uid, visible, gname ) VALUES( '%s', %d, %d, '%s' ) ", dbesc($hash), intval($uid), @@ -58,7 +58,7 @@ class Group { static function remove($uid,$name) { $ret = false; if(x($uid) && x($name)) { - $r = q("SELECT id, hash FROM groups WHERE uid = %d AND gname = '%s' LIMIT 1", + $r = q("SELECT id, hash FROM pgrp WHERE uid = %d AND gname = '%s' LIMIT 1", intval($uid), dbesc($name) ); @@ -103,13 +103,13 @@ class Group { } // remove all members - $r = q("DELETE FROM group_member WHERE uid = %d AND gid = %d ", + $r = q("DELETE FROM pgrp_member WHERE uid = %d AND gid = %d ", intval($uid), intval($group_id) ); // remove group - $r = q("UPDATE groups SET deleted = 1 WHERE uid = %d AND gname = '%s'", + $r = q("UPDATE pgrp SET deleted = 1 WHERE uid = %d AND gname = '%s'", intval($uid), dbesc($name) ); @@ -127,7 +127,7 @@ class Group { static function byname($uid,$name) { if((! $uid) || (! strlen($name))) return false; - $r = q("SELECT * FROM groups WHERE uid = %d AND gname = '%s' LIMIT 1", + $r = q("SELECT * FROM pgrp WHERE uid = %d AND gname = '%s' LIMIT 1", intval($uid), dbesc($name) ); @@ -140,7 +140,7 @@ class Group { static function rec_byhash($uid,$hash) { if((! $uid) || (! strlen($hash))) return false; - $r = q("SELECT * FROM groups WHERE uid = %d AND hash = '%s' LIMIT 1", + $r = q("SELECT * FROM pgrp WHERE uid = %d AND hash = '%s' LIMIT 1", intval($uid), dbesc($hash) ); @@ -156,7 +156,7 @@ class Group { return false; if(! ( $uid && $gid && $member)) return false; - $r = q("DELETE FROM group_member WHERE uid = %d AND gid = %d AND xchan = '%s' ", + $r = q("DELETE FROM pgrp_member WHERE uid = %d AND gid = %d AND xchan = '%s' ", intval($uid), intval($gid), dbesc($member) @@ -174,7 +174,7 @@ class Group { if((! $gid) || (! $uid) || (! $member)) return false; - $r = q("SELECT * FROM group_member WHERE uid = %d AND gid = %d AND xchan = '%s' LIMIT 1", + $r = q("SELECT * FROM pgrp_member WHERE uid = %d AND gid = %d AND xchan = '%s' LIMIT 1", intval($uid), intval($gid), dbesc($member) @@ -184,7 +184,7 @@ class Group { // we indicate success because the group member was in fact created // -- It was just created at another time if(! $r) - $r = q("INSERT INTO group_member (uid, gid, xchan) + $r = q("INSERT INTO pgrp_member (uid, gid, xchan) VALUES( %d, %d, '%s' ) ", intval($uid), intval($gid), @@ -200,9 +200,9 @@ class Group { static function members($gid) { $ret = array(); if(intval($gid)) { - $r = q("SELECT * FROM group_member - LEFT JOIN abook ON abook_xchan = group_member.xchan left join xchan on xchan_hash = abook_xchan - WHERE gid = %d AND abook_channel = %d and group_member.uid = %d and xchan_deleted = 0 and abook_self = 0 and abook_blocked = 0 and abook_pending = 0 ORDER BY xchan_name ASC ", + $r = q("SELECT * FROM pgrp_member + LEFT JOIN abook ON abook_xchan = pgrp_member.xchan left join xchan on xchan_hash = abook_xchan + WHERE gid = %d AND abook_channel = %d and pgrp_member.uid = %d and xchan_deleted = 0 and abook_self = 0 and abook_blocked = 0 and abook_pending = 0 ORDER BY xchan_name ASC ", intval($gid), intval(local_channel()), intval(local_channel()) @@ -216,7 +216,7 @@ class Group { static function members_xchan($gid) { $ret = []; if(intval($gid)) { - $r = q("SELECT xchan FROM group_member WHERE gid = %d AND uid = %d", + $r = q("SELECT xchan FROM pgrp_member WHERE gid = %d AND uid = %d", intval($gid), intval(local_channel()) ); @@ -254,7 +254,7 @@ class Group { $grps = []; $o = ''; - $r = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", + $r = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval($uid) ); $grps[] = array('name' => '', 'hash' => '0', 'selected' => ''); @@ -286,7 +286,7 @@ class Group { $groups = array(); - $r = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", + $r = q("SELECT * FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", intval($_SESSION['uid']) ); $member_of = array(); @@ -366,7 +366,7 @@ class Group { stringify_array_elms($x,true); $groups = implode(',', $x); if($groups) { - $r = q("SELECT xchan FROM group_member WHERE gid IN ( select id from groups where hash in ( $groups ))"); + $r = q("SELECT xchan FROM pgrp_member WHERE gid IN ( select id from pgrp where hash in ( $groups ))"); if($r) { foreach($r as $rr) { $ret[] = $rr['xchan']; @@ -379,7 +379,7 @@ class Group { static function member_of($c) { - $r = q("SELECT groups.gname, groups.id FROM groups LEFT JOIN group_member ON group_member.gid = groups.id WHERE group_member.xchan = '%s' AND groups.deleted = 0 ORDER BY groups.gname ASC ", + $r = q("SELECT pgrp.gname, pgrp.id FROM pgrp LEFT JOIN pgrp_member ON pgrp_member.gid = pgrp.id WHERE pgrp_member.xchan = '%s' AND pgrp.deleted = 0 ORDER BY pgrp.gname ASC ", dbesc($c) ); @@ -389,7 +389,7 @@ class Group { static function containing($uid,$c) { - $r = q("SELECT gid FROM group_member WHERE uid = %d AND group_member.xchan = '%s' ", + $r = q("SELECT gid FROM pgrp_member WHERE uid = %d AND pgrp_member.xchan = '%s' ", intval($uid), dbesc($c) ); -- cgit v1.2.3 From 5d6c8fd807de99bb3364f7b1aca332e6fa0e84f9 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 00:28:15 +0200 Subject: Update Import.php --- Zotlabs/Module/Import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index d031bf16b..c5c52674a 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -428,7 +428,7 @@ class Import extends \Zotlabs\Web\Controller { create_table_from_array('groups', $group); } - $r = q("select * from groups where uid = %d", + $r = q("select * from pgrp where uid = %d", intval($channel['channel_id']) ); if($r) { -- cgit v1.2.3 From fe8b72362286ce55044e38524179e6694acda014 Mon Sep 17 00:00:00 2001 From: "M.Dent" Date: Thu, 27 Sep 2018 22:42:42 -0400 Subject: Hide form when at or over service_class['limit_identities'] --- Zotlabs/Module/New_channel.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/New_channel.php b/Zotlabs/Module/New_channel.php index 97a46a43e..ebdd6c37f 100644 --- a/Zotlabs/Module/New_channel.php +++ b/Zotlabs/Module/New_channel.php @@ -142,9 +142,12 @@ class New_channel extends \Zotlabs\Web\Controller { } $limit = account_service_class_fetch(get_account_id(),'total_identities'); - + $canadd = true; if($r && ($limit !== false)) { $channel_usage_message = sprintf( t("You have created %1$.0f of %2$.0f allowed channels."), $r[0]['total'], $limit); + if ($r[0]['total'] >= $limit) { + $canadd = false; + } } else { $channel_usage_message = ''; @@ -186,7 +189,8 @@ class New_channel extends \Zotlabs\Web\Controller { '$nickname' => $nickname, '$validate' => t('Validate'), '$submit' => t('Create'), - '$channel_usage_message' => $channel_usage_message + '$channel_usage_message' => $channel_usage_message, + '$canadd' => $canadd )); return $o; -- cgit v1.2.3 From 44bb0702030e0c7d6c15e1052b8c49d4cb109157 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 28 Sep 2018 09:55:10 +0200 Subject: add transaction, commit and rollback to update 1221 --- Zotlabs/Update/_1221.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Update/_1221.php b/Zotlabs/Update/_1221.php index 252fcaa90..75b400adc 100644 --- a/Zotlabs/Update/_1221.php +++ b/Zotlabs/Update/_1221.php @@ -6,13 +6,18 @@ class _1221 { function run() { + q("START TRANSACTION"); + $r1 = q("ALTER table " . TQUOT . 'groups' . TQUOT . " rename to pgrp "); $r2 = q("ALTER table " . TQUOT . 'group_member' . TQUOT . " rename to pgrp_member "); if($r1 && $r2) { + q("COMMIT"); return UPDATE_SUCCESS; } + + q("ROLLBACK"); return UPDATE_FAILED; } -- cgit v1.2.3 From 20285d076b789f2e08d83e2fb7c89d017a4135ed Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 28 Sep 2018 11:29:05 +0200 Subject: settings for channel home --- Zotlabs/Module/Settings/Channel_home.php | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Zotlabs/Module/Settings/Channel_home.php (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Channel_home.php b/Zotlabs/Module/Settings/Channel_home.php new file mode 100644 index 000000000..1d1cc370b --- /dev/null +++ b/Zotlabs/Module/Settings/Channel_home.php @@ -0,0 +1,43 @@ + $rpath, + '$action_url' => 'settings/' . $module, + '$form_security_token' => get_form_security_token('settings_' . $module), + '$title' => t('Channel Home Settings'), + '$features' => process_module_features_get(local_channel(), $features), + '$submit' => t('Submit') + )); + + return $o; + } + +} -- cgit v1.2.3 From d7a20821c3b5920715384e1256315fdddd4ba96b Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 28 Sep 2018 11:32:00 +0200 Subject: move display settings up --- Zotlabs/Widget/Settings_menu.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 92f615452..238b8071e 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -45,11 +45,6 @@ class Settings_menu { ); - $tabs[] = array( - 'label' => t('Addon settings'), - 'url' => z_root().'/settings/featured', - 'selected' => ((argv(1) === 'featured') ? 'active' : ''), - ); $tabs[] = array( 'label' => t('Display settings'), @@ -57,6 +52,12 @@ class Settings_menu { 'selected' => ((argv(1) === 'display') ? 'active' : ''), ); + $tabs[] = array( + 'label' => t('Addon settings'), + 'url' => z_root().'/settings/featured', + 'selected' => ((argv(1) === 'featured') ? 'active' : ''), + ); + if($hublocs) { $tabs[] = array( 'label' => t('Manage locations'), -- cgit v1.2.3 From 52fea09c53883cf1d9ca96a642acf7b2caa79cb2 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:23:38 +0200 Subject: add translations --- Zotlabs/Module/Oauth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Oauth.php b/Zotlabs/Module/Oauth.php index fbcc48ead..a0a6f37cb 100644 --- a/Zotlabs/Module/Oauth.php +++ b/Zotlabs/Module/Oauth.php @@ -97,7 +97,7 @@ class Oauth extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'OAuth Apps Manager App (Not Installed):
'; + $o = '' . t('OAuth Apps Manager App (Not Installed):') . '
'; $o .= t('OAuth authentication tokens for mobile and remote apps'); return $o; } -- cgit v1.2.3 From 21272735ae92f58f9af78c00363d66199d96bb19 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:24:45 +0200 Subject: Update Oauth2.php --- Zotlabs/Module/Oauth2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Oauth2.php b/Zotlabs/Module/Oauth2.php index c27d7534b..608da6d51 100644 --- a/Zotlabs/Module/Oauth2.php +++ b/Zotlabs/Module/Oauth2.php @@ -103,7 +103,7 @@ class Oauth2 extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'OAuth2 Apps Manager App (Not Installed):
'; + $o = '' . t('OAuth2 Apps Manager App (Not Installed):') . '
'; $o .= t('OAuth2 authenticatication tokens for mobile and remote apps'); return $o; } -- cgit v1.2.3 From 598fe914647616a9ad3c8567b462e9f26cc190ef Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:25:38 +0200 Subject: Update Pdledit.php --- Zotlabs/Module/Pdledit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php index d0bde7715..cd5ec3709 100644 --- a/Zotlabs/Module/Pdledit.php +++ b/Zotlabs/Module/Pdledit.php @@ -39,7 +39,7 @@ class Pdledit extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'PDL Editor App (Not Installed):
'; + $o = '' . t('PDL Editor App (Not Installed):') . '
'; $o .= t('Provides the ability to edit system page layouts'); return $o; } -- cgit v1.2.3 From 02a16050d9fd05ef36a47b004b8d99760e0b19dc Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:26:09 +0200 Subject: Update Permcats.php --- Zotlabs/Module/Permcats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Permcats.php b/Zotlabs/Module/Permcats.php index 3d068862a..f966be147 100644 --- a/Zotlabs/Module/Permcats.php +++ b/Zotlabs/Module/Permcats.php @@ -59,7 +59,7 @@ class Permcats extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Permission Categories App (Not Installed):
'; + $o = '' . t('Permission Categories App (Not Installed):') . '
'; $o .= t('Create custom connection permission limits'); return $o; } -- cgit v1.2.3 From f7e94546977f8e38b69bf27515ed2dc0cdc93b86 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:26:46 +0200 Subject: Update Poke.php --- Zotlabs/Module/Poke.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Poke.php b/Zotlabs/Module/Poke.php index 46dcf6dd3..4074663ae 100644 --- a/Zotlabs/Module/Poke.php +++ b/Zotlabs/Module/Poke.php @@ -162,7 +162,7 @@ class Poke extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Poke App (Not Installed):
'; + $o = '' . t('Poke App (Not Installed):') . '
'; $o .= t('Poke somebody in your addressbook'); return $o; } -- cgit v1.2.3 From 86fc5b5ed82d8a764699929e477ef104d540d802 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:27:16 +0200 Subject: Update Sources.php --- Zotlabs/Module/Sources.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Sources.php b/Zotlabs/Module/Sources.php index 5d05244a7..f761d5666 100644 --- a/Zotlabs/Module/Sources.php +++ b/Zotlabs/Module/Sources.php @@ -85,7 +85,7 @@ class Sources extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Sources App (Not Installed):
'; + $o = '' . t('Sources App (Not Installed):') . '
'; $o .= t('Automatically import channel content from other channels or feeds'); return $o; } -- cgit v1.2.3 From eb2c2b94005b70686e683a8bee59fa6a3db0ed57 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:27:54 +0200 Subject: Update Tokens.php --- Zotlabs/Module/Tokens.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Tokens.php b/Zotlabs/Module/Tokens.php index ae03a499a..d2198331a 100644 --- a/Zotlabs/Module/Tokens.php +++ b/Zotlabs/Module/Tokens.php @@ -96,7 +96,7 @@ class Tokens extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Guest Access App (Not Installed):
'; + $o = '' . t('Guest Access App (Not Installed):') . '
'; $o .= t('Create access tokens so that non-members can access private content'); return $o; } -- cgit v1.2.3 From db006b911accbada8a241d8c981ce46881f6e488 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:28:57 +0200 Subject: Update Webpages.php --- Zotlabs/Module/Webpages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index c6599db3b..79fd51d33 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -45,7 +45,7 @@ class Webpages extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Webpages App (Not Installed):
'; + $o = '' . t('Webpages App (Not Installed):') . '
'; $o .= t('Provide managed web pages on your channel'); return $o; } -- cgit v1.2.3 From 90e9948dbe98f96e17de25a942361e1f170b9568 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:29:33 +0200 Subject: Update Wiki.php --- Zotlabs/Module/Wiki.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 0fb5a4605..80824b7d5 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -49,7 +49,7 @@ class Wiki extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Wiki App (Not Installed):
'; + $o = '' . t('Wiki App (Not Installed):') . '
'; $o .= t('Provide a wiki for your channel'); return $o; } -- cgit v1.2.3 From 24c7bb600e9d22269243ac229a94438b093e8716 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:30:03 +0200 Subject: Update Articles.php --- Zotlabs/Module/Articles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index 7af1ab6b8..1a9691b6a 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -40,7 +40,7 @@ class Articles extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Articles App (Not Installed):
'; + $o = '' . t('Articles App (Not Installed):') . '
'; $o .= t('Create interactive articles'); return $o; } -- cgit v1.2.3 From 134529a09d1894280f33241355e385b9eddb95f0 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:30:30 +0200 Subject: Update Cards.php --- Zotlabs/Module/Cards.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php index 78cbad5fd..8aca60e57 100644 --- a/Zotlabs/Module/Cards.php +++ b/Zotlabs/Module/Cards.php @@ -43,7 +43,7 @@ class Cards extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Cards App (Not Installed):
'; + $o = '' . t('Cards App (Not Installed):') . '
'; $o .= t('Create personal planning cards'); return $o; } -- cgit v1.2.3 From d8c6d93c6e564b166275bdcd730a5251dfdd7304 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:31:22 +0200 Subject: Update Cdav.php --- Zotlabs/Module/Cdav.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php index 7142615d5..860864e99 100644 --- a/Zotlabs/Module/Cdav.php +++ b/Zotlabs/Module/Cdav.php @@ -836,7 +836,7 @@ class Cdav extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'CalDAV App (Not Installed):
'; + $o = '' . t('CalDAV App (Not Installed):') . '
'; $o .= t('CalDAV capable calendar'); return $o; } @@ -845,7 +845,7 @@ class Cdav extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'CardDAV App (Not Installed):
'; + $o = '' . t('CardDAV App (Not Installed):') . '
'; $o .= t('CalDAV capable addressbook'); return $o; } -- cgit v1.2.3 From 2811d6ae53b32c132d2589871ba8b0a267675eef Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:32:27 +0200 Subject: Update Chat.php --- Zotlabs/Module/Chat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Chat.php b/Zotlabs/Module/Chat.php index 551dc5e2a..d007ec407 100644 --- a/Zotlabs/Module/Chat.php +++ b/Zotlabs/Module/Chat.php @@ -99,7 +99,7 @@ class Chat extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Chatrooms App (Not Installed):
'; + $o = '' . t('Chatrooms App (Not Installed):') . '
'; $o .= t('Access Controlled Chatrooms'); return $o; } -- cgit v1.2.3 From 7fd332f8cf2ba77fe16192f4e02d657283a3c25c Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:33:17 +0200 Subject: Update Connect.php --- Zotlabs/Module/Connect.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Connect.php b/Zotlabs/Module/Connect.php index 7194e7039..83f0f455d 100644 --- a/Zotlabs/Module/Connect.php +++ b/Zotlabs/Module/Connect.php @@ -101,7 +101,7 @@ class Connect extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Premium Channel App (Not Installed):
'; + $o = '' . t('Premium Channel App (Not Installed):') . '
'; $o .= t('Allows you to set restrictions and terms on those that connect with your channel'); return $o; } -- cgit v1.2.3 From a23724838813cfa82007dbff78b8edcd5c95381f Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:33:50 +0200 Subject: Update Group.php --- Zotlabs/Module/Group.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index bfe051d59..c544f95a0 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -98,7 +98,7 @@ class Group extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Privacy Groups App (Not Installed):
'; + $o = '' . t('Privacy Groups App (Not Installed):') . '
'; $o .= t('Management of privacy groups'); return $o; } -- cgit v1.2.3 From ba417894edcfafd6d625ed9e27835362471b1e3a Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:34:20 +0200 Subject: Update Invite.php --- Zotlabs/Module/Invite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Invite.php b/Zotlabs/Module/Invite.php index 234802746..8640c5b23 100644 --- a/Zotlabs/Module/Invite.php +++ b/Zotlabs/Module/Invite.php @@ -107,7 +107,7 @@ class Invite extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Invite App (Not Installed):
'; + $o = '' . t('Invite App (Not Installed):') . '
'; $o .= t('Send email invitations to join this network'); return $o; } -- cgit v1.2.3 From e2115e8ea5b7de6cde8f0dd0bef941448fae9b09 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:34:45 +0200 Subject: Update Lang.php --- Zotlabs/Module/Lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Lang.php b/Zotlabs/Module/Lang.php index 9858beecd..a163da102 100644 --- a/Zotlabs/Module/Lang.php +++ b/Zotlabs/Module/Lang.php @@ -14,7 +14,7 @@ class Lang extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Language App (Not Installed):
'; + $o = '' . t('Language App (Not Installed):') . '
'; $o .= t('Change UI language'); return $o; } -- cgit v1.2.3 From 58d9ca1bfd5a9e696a0e7d13d915dde4db5a67a2 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:35:14 +0200 Subject: Update Mood.php --- Zotlabs/Module/Mood.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Mood.php b/Zotlabs/Module/Mood.php index cceef5ffa..4ffb35ca8 100644 --- a/Zotlabs/Module/Mood.php +++ b/Zotlabs/Module/Mood.php @@ -129,7 +129,7 @@ class Mood extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = 'Mood App (Not Installed):
'; + $o = '' . t('Mood App (Not Installed):') . '
'; $o .= t('Set your current mood and tell your friends'); return $o; } -- cgit v1.2.3 From c13d7e29ef9676b0f0e4ae23aa52e203f4ad8895 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 15:35:39 +0200 Subject: Update Notes.php --- Zotlabs/Module/Notes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Notes.php b/Zotlabs/Module/Notes.php index cd383a6c2..2916925e2 100644 --- a/Zotlabs/Module/Notes.php +++ b/Zotlabs/Module/Notes.php @@ -52,7 +52,7 @@ class Notes extends Controller { //Do not display any associated widgets at this point App::$pdl = EMPTY_STR; - $o = 'Notes App (Not Installed):
'; + $o = '' . t('Notes App (Not Installed):') . '
'; $o .= t('A simple notes app with a widget (note: notes are not encrypted)'); return $o; } -- cgit v1.2.3 From 5f7d83bd4d1a5e9e22d05ebda8ed1e82492d0094 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:44:10 +0200 Subject: Update Articles.php --- Zotlabs/Module/Articles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index 1a9691b6a..ad4d67c4e 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -40,7 +40,7 @@ class Articles extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Articles App (Not Installed):') . '
'; + $o = '' . t('Articles App') . ' (' . t('Not Installed') . '):
'; $o .= t('Create interactive articles'); return $o; } -- cgit v1.2.3 From 5c8e1169cd3be8c569bf54c58a6a4f473dd6b6f3 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:45:11 +0200 Subject: Update Cards.php --- Zotlabs/Module/Cards.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php index 8aca60e57..3656860a5 100644 --- a/Zotlabs/Module/Cards.php +++ b/Zotlabs/Module/Cards.php @@ -43,7 +43,7 @@ class Cards extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Cards App (Not Installed):') . '
'; + $o = '' . t('Cards App') . ' (' . t('Not Installed') . '):
'; $o .= t('Create personal planning cards'); return $o; } -- cgit v1.2.3 From c6fce5de24df96cb8048543fb6b8a6907ecaa610 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:46:04 +0200 Subject: Update Cdav.php --- Zotlabs/Module/Cdav.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Cdav.php b/Zotlabs/Module/Cdav.php index 860864e99..d644e48b1 100644 --- a/Zotlabs/Module/Cdav.php +++ b/Zotlabs/Module/Cdav.php @@ -836,7 +836,7 @@ class Cdav extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('CalDAV App (Not Installed):') . '
'; + $o = '' . t('CalDAV App') . ' (' . t('Not Installed') . '):
'; $o .= t('CalDAV capable calendar'); return $o; } @@ -845,7 +845,7 @@ class Cdav extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('CardDAV App (Not Installed):') . '
'; + $o = '' . t('CardDAV App') . ' (' . t('Not Installed') . '):
'; $o .= t('CalDAV capable addressbook'); return $o; } -- cgit v1.2.3 From b3249c10c24cb2b06a1d43581d270f78183e8d61 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:46:20 +0200 Subject: Update Chat.php --- Zotlabs/Module/Chat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Chat.php b/Zotlabs/Module/Chat.php index d007ec407..db77e2612 100644 --- a/Zotlabs/Module/Chat.php +++ b/Zotlabs/Module/Chat.php @@ -99,7 +99,7 @@ class Chat extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Chatrooms App (Not Installed):') . '
'; + $o = '' . t('Chatrooms App') . ' (' . t('Not Installed') . '):
'; $o .= t('Access Controlled Chatrooms'); return $o; } -- cgit v1.2.3 From cb768ea23f81d35b18204ae1747240a586541d45 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:46:36 +0200 Subject: Update Connect.php --- Zotlabs/Module/Connect.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Connect.php b/Zotlabs/Module/Connect.php index 83f0f455d..62d3af840 100644 --- a/Zotlabs/Module/Connect.php +++ b/Zotlabs/Module/Connect.php @@ -101,7 +101,7 @@ class Connect extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Premium Channel App (Not Installed):') . '
'; + $o = '' . t('Premium Channel App') . ' (' . t('Not Installed') . '):
'; $o .= t('Allows you to set restrictions and terms on those that connect with your channel'); return $o; } -- cgit v1.2.3 From f07a4667b6168c26ec09d34a14b1dafa00d69a58 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:47:20 +0200 Subject: Update Invite.php --- Zotlabs/Module/Invite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Invite.php b/Zotlabs/Module/Invite.php index 8640c5b23..6359da54c 100644 --- a/Zotlabs/Module/Invite.php +++ b/Zotlabs/Module/Invite.php @@ -107,7 +107,7 @@ class Invite extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Invite App (Not Installed):') . '
'; + $o = '' . t('Invite App') . ' (' . t('Not Installed') . '):
'; $o .= t('Send email invitations to join this network'); return $o; } -- cgit v1.2.3 From accb21128008dd4a9114159eec0fd6e872873b16 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:47:37 +0200 Subject: Update Lang.php --- Zotlabs/Module/Lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Lang.php b/Zotlabs/Module/Lang.php index a163da102..a32f933a6 100644 --- a/Zotlabs/Module/Lang.php +++ b/Zotlabs/Module/Lang.php @@ -14,7 +14,7 @@ class Lang extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Language App (Not Installed):') . '
'; + $o = '' . t('Language App') . ' (' . t('Not Installed') . '):
'; $o .= t('Change UI language'); return $o; } -- cgit v1.2.3 From e3e96e59d2e15b655931ecb5168eda059582ab8a Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:47:52 +0200 Subject: Update Mood.php --- Zotlabs/Module/Mood.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Mood.php b/Zotlabs/Module/Mood.php index 4ffb35ca8..16ef0b171 100644 --- a/Zotlabs/Module/Mood.php +++ b/Zotlabs/Module/Mood.php @@ -129,7 +129,7 @@ class Mood extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Mood App (Not Installed):') . '
'; + $o = '' . t('Mood App') . ' (' . t('Not Installed') . '):
'; $o .= t('Set your current mood and tell your friends'); return $o; } -- cgit v1.2.3 From c34c0c671883385145b6cda7bb84ace143b55bd6 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:48:09 +0200 Subject: Update Notes.php --- Zotlabs/Module/Notes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Notes.php b/Zotlabs/Module/Notes.php index 2916925e2..178a6bce0 100644 --- a/Zotlabs/Module/Notes.php +++ b/Zotlabs/Module/Notes.php @@ -52,7 +52,7 @@ class Notes extends Controller { //Do not display any associated widgets at this point App::$pdl = EMPTY_STR; - $o = '' . t('Notes App (Not Installed):') . '
'; + $o = '' . t('Notes App') . ' (' . t('Not Installed') . '):
'; $o .= t('A simple notes app with a widget (note: notes are not encrypted)'); return $o; } -- cgit v1.2.3 From 423e1422ef00f69a54322836f3b6df671b054e77 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:48:25 +0200 Subject: Update Oauth.php --- Zotlabs/Module/Oauth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Oauth.php b/Zotlabs/Module/Oauth.php index a0a6f37cb..27c062df2 100644 --- a/Zotlabs/Module/Oauth.php +++ b/Zotlabs/Module/Oauth.php @@ -97,7 +97,7 @@ class Oauth extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('OAuth Apps Manager App (Not Installed):') . '
'; + $o = '' . t('OAuth Apps Manager App') . ' (' . t('Not Installed') . '):
'; $o .= t('OAuth authentication tokens for mobile and remote apps'); return $o; } -- cgit v1.2.3 From c8399e8104b44273052581c5bbdb77debbe5b75e Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:48:44 +0200 Subject: Update Oauth2.php --- Zotlabs/Module/Oauth2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Oauth2.php b/Zotlabs/Module/Oauth2.php index 608da6d51..db2687b4c 100644 --- a/Zotlabs/Module/Oauth2.php +++ b/Zotlabs/Module/Oauth2.php @@ -103,7 +103,7 @@ class Oauth2 extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('OAuth2 Apps Manager App (Not Installed):') . '
'; + $o = '' . t('OAuth2 Apps Manager App') . ' (' . t('Not Installed') . '):
'; $o .= t('OAuth2 authenticatication tokens for mobile and remote apps'); return $o; } -- cgit v1.2.3 From 5500473387e16772cc4feb7c3821b733b0b08157 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:49:02 +0200 Subject: Update Pdledit.php --- Zotlabs/Module/Pdledit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Pdledit.php b/Zotlabs/Module/Pdledit.php index cd5ec3709..5cedb29a8 100644 --- a/Zotlabs/Module/Pdledit.php +++ b/Zotlabs/Module/Pdledit.php @@ -39,7 +39,7 @@ class Pdledit extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('PDL Editor App (Not Installed):') . '
'; + $o = '' . t('PDL Editor App') . ' (' . t('Not Installed') . '):
'; $o .= t('Provides the ability to edit system page layouts'); return $o; } -- cgit v1.2.3 From 23d5e15f0f9d3502f6c5c4163f93de5c9618cda1 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:49:20 +0200 Subject: Update Permcats.php --- Zotlabs/Module/Permcats.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Permcats.php b/Zotlabs/Module/Permcats.php index f966be147..262a14fe4 100644 --- a/Zotlabs/Module/Permcats.php +++ b/Zotlabs/Module/Permcats.php @@ -59,7 +59,7 @@ class Permcats extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Permission Categories App (Not Installed):') . '
'; + $o = '' . t('Permission Categories App') . ' (' . t('Not Installed') . '):
'; $o .= t('Create custom connection permission limits'); return $o; } -- cgit v1.2.3 From 01043fa790116a89619c0a0fe9c12bd566db8cc7 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:49:42 +0200 Subject: Update Poke.php --- Zotlabs/Module/Poke.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Poke.php b/Zotlabs/Module/Poke.php index 4074663ae..1f1edfa18 100644 --- a/Zotlabs/Module/Poke.php +++ b/Zotlabs/Module/Poke.php @@ -162,7 +162,7 @@ class Poke extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Poke App (Not Installed):') . '
'; + $o = '' . t('Poke App') . ' (' . t('Not Installed') . '):
'; $o .= t('Poke somebody in your addressbook'); return $o; } -- cgit v1.2.3 From 6d3c1fb7fcc5bfb56bbcf846bf939c1a6aeff3c4 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:49:56 +0200 Subject: Update Sources.php --- Zotlabs/Module/Sources.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Sources.php b/Zotlabs/Module/Sources.php index f761d5666..e535f6ebf 100644 --- a/Zotlabs/Module/Sources.php +++ b/Zotlabs/Module/Sources.php @@ -85,7 +85,7 @@ class Sources extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Sources App (Not Installed):') . '
'; + $o = '' . t('Sources App') . ' (' . t('Not Installed') . '):
'; $o .= t('Automatically import channel content from other channels or feeds'); return $o; } -- cgit v1.2.3 From 8e673a6cdf9305b0b93313b568759fbde655ee36 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:50:15 +0200 Subject: Update Tokens.php --- Zotlabs/Module/Tokens.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Tokens.php b/Zotlabs/Module/Tokens.php index d2198331a..1ba41dcc5 100644 --- a/Zotlabs/Module/Tokens.php +++ b/Zotlabs/Module/Tokens.php @@ -96,7 +96,7 @@ class Tokens extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Guest Access App (Not Installed):') . '
'; + $o = '' . t('Guest Access App') . ' (' . t('Not Installed') . '):
'; $o .= t('Create access tokens so that non-members can access private content'); return $o; } -- cgit v1.2.3 From 9b0d12321703cefa37d9e89c3014ceb477074fab Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:50:29 +0200 Subject: Update Webpages.php --- Zotlabs/Module/Webpages.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index 79fd51d33..c9b2264bf 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -45,7 +45,7 @@ class Webpages extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Webpages App (Not Installed):') . '
'; + $o = '' . t('Webpages App') . ' (' . t('Not Installed') . '):
'; $o .= t('Provide managed web pages on your channel'); return $o; } -- cgit v1.2.3 From 403ead44f92a52f2dce6b79e5d2d79ffe167e1a4 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:50:45 +0200 Subject: Update Wiki.php --- Zotlabs/Module/Wiki.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 80824b7d5..6be39214e 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -49,7 +49,7 @@ class Wiki extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Wiki App (Not Installed):') . '
'; + $o = '' . t('Wiki App') . ' (' . t('Not Installed') . '):
'; $o .= t('Provide a wiki for your channel'); return $o; } -- cgit v1.2.3 From c45a9504e7c4fe8add92276deecb1866c2a388bf Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 28 Sep 2018 19:52:11 +0200 Subject: Update Group.php --- Zotlabs/Module/Group.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php index c544f95a0..c8ccaa2cb 100644 --- a/Zotlabs/Module/Group.php +++ b/Zotlabs/Module/Group.php @@ -98,7 +98,7 @@ class Group extends Controller { //Do not display any associated widgets at this point App::$pdl = ''; - $o = '' . t('Privacy Groups App (Not Installed):') . '
'; + $o = '' . t('Privacy Groups App') . ' (' . t('Not Installed') . '):
'; $o .= t('Management of privacy groups'); return $o; } -- cgit v1.2.3 From 5f992ffe154ed9e2b225c9a1b3d7c47d39e41d34 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Sat, 29 Sep 2018 00:17:55 +0200 Subject: Remove servicelevel logic --- Zotlabs/Lib/ThreadItem.php | 2 +- Zotlabs/Module/Admin/Account_edit.php | 5 ++--- Zotlabs/Module/Admin/Site.php | 24 ------------------------ Zotlabs/Module/Item.php | 22 ---------------------- Zotlabs/Module/Mail.php | 2 +- Zotlabs/Module/New_channel.php | 2 -- Zotlabs/Module/Register.php | 5 ----- Zotlabs/Module/Settings/Account.php | 15 --------------- Zotlabs/Module/Settings/Channel.php | 7 +------ 9 files changed, 5 insertions(+), 79 deletions(-) (limited to 'Zotlabs') 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'); -- cgit v1.2.3 From 7ca8f7b5ccd8f0526d7b96676a15440d8068d58d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 29 Sep 2018 15:42:22 +0200 Subject: allow to install apps by name --- Zotlabs/Lib/Apps.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index aef6756b5..c54a5a111 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -546,6 +546,17 @@ class Apps { } static public function app_install($uid,$app) { + + if(! is_array($app)) { + $r = q("select * from app where app_name = '%s' and app_channel = 0", + dbesc($app) + ); + if(! $r) + return false; + + $app = self::app_encode($r[0]); + } + $app['uid'] = $uid; if(self::app_installed($uid,$app,true)) -- cgit v1.2.3 From 6eeac03a0e42ae88218b76948aedfa541022718c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 29 Sep 2018 16:00:34 +0200 Subject: appman: query terms also by uid to prevent double entries --- Zotlabs/Module/Appman.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Appman.php b/Zotlabs/Module/Appman.php index 3ebafafa4..f50dcc2ab 100644 --- a/Zotlabs/Module/Appman.php +++ b/Zotlabs/Module/Appman.php @@ -113,10 +113,12 @@ class Appman extends \Zotlabs\Web\Controller { if($r) { $app = $r[0]; - $term = q("select * from term where otype = %d and oid = %d", + $term = q("select * from term where otype = %d and oid = %d and uid = %d", intval(TERM_OBJ_APP), - intval($r[0]['id']) + intval($r[0]['id']), + intval(local_channel()) ); + if($term) { $app['categories'] = ''; foreach($term as $t) { -- cgit v1.2.3 From 5906d6cce373df81458bf16d461bee9705fed3a6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 29 Sep 2018 18:00:14 +0200 Subject: improve network search --- Zotlabs/Module/Network.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index e7b150faf..73f09f90b 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -84,18 +84,7 @@ class Network extends \Zotlabs\Web\Controller { $search = (($_GET['search']) ? $_GET['search'] : ''); if($search) { - $_GET['netsearch'] = escape_tags($search); - if(strpos($search,'@') === 0) { - $r = q("select abook_id from abook left join xchan on abook_xchan = xchan_hash where xchan_name = '%s' and abook_channel = %d limit 1", - dbesc(substr($search,1)), - intval(local_channel()) - ); - if($r) { - $_GET['cid'] = $r[0]['abook_id']; - $search = $_GET['search'] = ''; - } - } - elseif(strpos($search,'#') === 0) { + if(strpos($search,'#') === 0) { $hashtags = substr($search,1); $search = $_GET['search'] = ''; } @@ -143,7 +132,7 @@ class Network extends \Zotlabs\Web\Controller { $deftag = ''; - if(x($_GET,'search') || $file || (!$pf && $cid)) + if(x($_GET,'search') || $file || (!$pf && $cid) || $hashtags || $verb || $category) $nouveau = true; if($cid) { @@ -169,9 +158,9 @@ class Network extends \Zotlabs\Web\Controller { if(! $update) { // search terms header - if($search) { + if($search || $hashtags) { $o .= replace_macros(get_markup_template("section_title.tpl"),array( - '$title' => t('Search Results For:') . ' ' . htmlspecialchars($search, ENT_COMPAT,'UTF-8') + '$title' => t('Search Results For:') . ' ' . (($search) ? htmlspecialchars($search, ENT_COMPAT,'UTF-8') : '#' . htmlspecialchars($hashtags, ENT_COMPAT,'UTF-8')) )); } -- cgit v1.2.3 From cc9ca8bbffaceb7273b4999e538a3d211ae3cf09 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 29 Sep 2018 18:38:19 +0200 Subject: do not unset $_GET[search] and adjust activity_order widget --- Zotlabs/Module/Network.php | 2 +- Zotlabs/Widget/Activity_order.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 73f09f90b..21507752d 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -86,7 +86,7 @@ class Network extends \Zotlabs\Web\Controller { if($search) { if(strpos($search,'#') === 0) { $hashtags = substr($search,1); - $search = $_GET['search'] = ''; + $search = ''; } } diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php index 2dceee70e..d9dbcc91f 100644 --- a/Zotlabs/Widget/Activity_order.php +++ b/Zotlabs/Widget/Activity_order.php @@ -55,7 +55,7 @@ class Activity_order { } // override order for search, filer and cid results - if(x($_GET,'search') || x($_GET,'file') || (! x($_GET,'pf') && x($_GET,'cid'))) { + if(x($_GET,'search') || x($_GET,'file') || (! x($_GET,'pf') && x($_GET,'cid')) || x($_GET,'verb') || x($_GET,'tag') || x($_GET,'cat')) { $unthreaded_active = 'active'; $commentord_active = $postord_active = 'disabled'; } -- cgit v1.2.3 From ff20370d0bd8c08942c062ab105bc839969a3902 Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Sat, 29 Sep 2018 20:22:27 +0200 Subject: Status editor hook --- Zotlabs/Module/Article_edit.php | 2 +- Zotlabs/Module/Articles.php | 2 +- Zotlabs/Module/Blocks.php | 2 +- Zotlabs/Module/Card_edit.php | 2 +- Zotlabs/Module/Cards.php | 2 +- Zotlabs/Module/Channel.php | 2 +- Zotlabs/Module/Display.php | 2 +- Zotlabs/Module/Editblock.php | 2 +- Zotlabs/Module/Editlayout.php | 2 +- Zotlabs/Module/Editpost.php | 2 +- Zotlabs/Module/Editwebpage.php | 2 +- Zotlabs/Module/Hq.php | 2 +- Zotlabs/Module/Layouts.php | 2 +- Zotlabs/Module/Network.php | 2 +- Zotlabs/Module/Pubstream.php | 2 +- Zotlabs/Module/Rpost.php | 2 +- Zotlabs/Module/Webpages.php | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Article_edit.php b/Zotlabs/Module/Article_edit.php index 89abccc40..d3cce343f 100644 --- a/Zotlabs/Module/Article_edit.php +++ b/Zotlabs/Module/Article_edit.php @@ -122,7 +122,7 @@ class Article_edit extends \Zotlabs\Web\Controller { 'bbcode' => (($mimetype == 'text/bbcode') ? true : false) ); - $editor = status_editor($a, $x); + $editor = status_editor($a, $x, false, 'Article_edit'); $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit Article'), diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index ad4d67c4e..58c16be45 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -132,7 +132,7 @@ class Articles extends Controller { $x['title'] = $_REQUEST['title']; if($_REQUEST['body']) $x['body'] = $_REQUEST['body']; - $editor = status_editor($a,$x); + $editor = status_editor($a,$x,false,'Articles'); } else { diff --git a/Zotlabs/Module/Blocks.php b/Zotlabs/Module/Blocks.php index e6a97794d..fde30a6dd 100644 --- a/Zotlabs/Module/Blocks.php +++ b/Zotlabs/Module/Blocks.php @@ -109,7 +109,7 @@ class Blocks extends \Zotlabs\Web\Controller { if($_REQUEST['pagetitle']) $x['pagetitle'] = $_REQUEST['pagetitle']; - $editor = status_editor($a,$x); + $editor = status_editor($a,$x,false,'Blocks'); $r = q("select iconfig.iid, iconfig.k, iconfig.v, mid, title, body, mimetype, created, edited from iconfig diff --git a/Zotlabs/Module/Card_edit.php b/Zotlabs/Module/Card_edit.php index 694bdc4ea..e01e70fdb 100644 --- a/Zotlabs/Module/Card_edit.php +++ b/Zotlabs/Module/Card_edit.php @@ -122,7 +122,7 @@ class Card_edit extends \Zotlabs\Web\Controller { 'bbcode' => (($mimetype == 'text/bbcode') ? true : false) ); - $editor = status_editor($a, $x); + $editor = status_editor($a, $x, false, 'Card_edit'); $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit Card'), diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php index 3656860a5..b66de158b 100644 --- a/Zotlabs/Module/Cards.php +++ b/Zotlabs/Module/Cards.php @@ -133,7 +133,7 @@ class Cards extends Controller { if($_REQUEST['body']) $x['body'] = $_REQUEST['body']; - $editor = status_editor($a, $x); + $editor = status_editor($a, $x, false, 'Cards'); } else { $editor = ''; diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 74fdc1cb4..8b2e35709 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -168,7 +168,7 @@ class Channel extends Controller { 'reset' => t('Reset form') ); - $o .= status_editor($a,$x); + $o .= status_editor($a,$x,false,'Channel'); } } diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index 1d21b64ac..8b46ebb79 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -81,7 +81,7 @@ class Display extends \Zotlabs\Web\Controller { ); $o = '
'; - $o .= status_editor($a,$x); + $o .= status_editor($a,$x,false,'Display'); $o .= '
'; } diff --git a/Zotlabs/Module/Editblock.php b/Zotlabs/Module/Editblock.php index 563ad9ca2..c031f32a1 100644 --- a/Zotlabs/Module/Editblock.php +++ b/Zotlabs/Module/Editblock.php @@ -132,7 +132,7 @@ class Editblock extends \Zotlabs\Web\Controller { 'bbcode' => (($mimetype == 'text/bbcode') ? true : false) ); - $editor = status_editor($a, $x); + $editor = status_editor($a, $x, false, 'Editblock'); $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit Block'), diff --git a/Zotlabs/Module/Editlayout.php b/Zotlabs/Module/Editlayout.php index 67e0bcd32..50096f1a1 100644 --- a/Zotlabs/Module/Editlayout.php +++ b/Zotlabs/Module/Editlayout.php @@ -131,7 +131,7 @@ class Editlayout extends \Zotlabs\Web\Controller { 'profile_uid' => intval($owner), ); - $editor = status_editor($a, $x); + $editor = status_editor($a, $x, false, 'Editlayout'); $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit Layout'), diff --git a/Zotlabs/Module/Editpost.php b/Zotlabs/Module/Editpost.php index 45d8e7644..1c9068e07 100644 --- a/Zotlabs/Module/Editpost.php +++ b/Zotlabs/Module/Editpost.php @@ -102,7 +102,7 @@ class Editpost extends \Zotlabs\Web\Controller { 'bbcode' => true ); - $editor = status_editor($a, $x); + $editor = status_editor($a, $x, false, 'Editpost'); $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit post'), diff --git a/Zotlabs/Module/Editwebpage.php b/Zotlabs/Module/Editwebpage.php index b67421cd5..785eeb4ec 100644 --- a/Zotlabs/Module/Editwebpage.php +++ b/Zotlabs/Module/Editwebpage.php @@ -160,7 +160,7 @@ class Editwebpage extends \Zotlabs\Web\Controller { 'bbcode' => (($mimetype == 'text/bbcode') ? true : false) ); - $editor = status_editor($a, $x); + $editor = status_editor($a, $x, false, 'Editwebpage'); $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit Webpage'), diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index fee4246c0..3535ac71a 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -138,7 +138,7 @@ class Hq extends \Zotlabs\Web\Controller { [ '$no_messages' => (($target_item) ? false : true), '$no_messages_label' => [ t('Welcome to Hubzilla!'), t('You have got no unseen posts...') ], - '$editor' => status_editor($a,$x) + '$editor' => status_editor($a,$x,false,'Hq') ] ); diff --git a/Zotlabs/Module/Layouts.php b/Zotlabs/Module/Layouts.php index 19efb37fd..25e27d226 100644 --- a/Zotlabs/Module/Layouts.php +++ b/Zotlabs/Module/Layouts.php @@ -141,7 +141,7 @@ class Layouts extends \Zotlabs\Web\Controller { if($_REQUEST['pagetitle']) $x['pagetitle'] = $_REQUEST['pagetitle']; - $editor = status_editor($a,$x); + $editor = status_editor($a,$x,false,'Layouts'); $r = q("select iconfig.iid, iconfig.v, mid, title, body, mimetype, created, edited, item_type from iconfig left join item on iconfig.iid = item.id diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 21507752d..919996943 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -196,7 +196,7 @@ class Network extends \Zotlabs\Web\Controller { $x['pretext'] = $deftag; - $status_editor = status_editor($a,$x); + $status_editor = status_editor($a,$x,false,'Network'); $o .= $status_editor; $static = channel_manual_conv_update(local_channel()); diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 7b80a3978..19cb72b5b 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -81,7 +81,7 @@ class Pubstream extends \Zotlabs\Web\Controller { ); $o = '
'; - $o .= status_editor($a,$x); + $o .= status_editor($a,$x,false,'Pubstream'); $o .= '
'; } diff --git a/Zotlabs/Module/Rpost.php b/Zotlabs/Module/Rpost.php index 86ee296ec..f03dae2bf 100644 --- a/Zotlabs/Module/Rpost.php +++ b/Zotlabs/Module/Rpost.php @@ -138,7 +138,7 @@ class Rpost extends \Zotlabs\Web\Controller { 'jotnets' => true ); - $editor = status_editor($a,$x); + $editor = status_editor($a,$x,false,'Rpost'); $o .= replace_macros(get_markup_template('edpost_head.tpl'), array( '$title' => t('Edit post'), diff --git a/Zotlabs/Module/Webpages.php b/Zotlabs/Module/Webpages.php index c9b2264bf..787ed5850 100644 --- a/Zotlabs/Module/Webpages.php +++ b/Zotlabs/Module/Webpages.php @@ -208,7 +208,7 @@ class Webpages extends Controller { if(! $r) $x['pagetitle'] = 'home'; - $editor = status_editor($a,$x); + $editor = status_editor($a,$x,false,'Webpages'); $pages = null; -- cgit v1.2.3 From 7dadf387e58ade457698dc2ffc58bbda7be46652 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 1 Oct 2018 11:01:56 +0200 Subject: indicate locked features --- Zotlabs/Module/Settings/Directory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Directory.php b/Zotlabs/Module/Settings/Directory.php index 2682bcafc..6e24a2cfa 100644 --- a/Zotlabs/Module/Settings/Directory.php +++ b/Zotlabs/Module/Settings/Directory.php @@ -6,7 +6,7 @@ namespace Zotlabs\Module\Settings; class Directory { function post() { - + $module = substr(strrchr(strtolower(static::class), '\\'), 1); check_form_security_token_redirectOnErr('/settings/' . $module, 'settings_' . $module); -- cgit v1.2.3 From 08a287dea10321a60473c8fd684a320ef94bdd37 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 1 Oct 2018 12:38:04 +0200 Subject: do not default to channel_startpage if startpage app is not installed --- Zotlabs/Module/Home.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Home.php b/Zotlabs/Module/Home.php index 647a6412a..7f2d6424d 100644 --- a/Zotlabs/Module/Home.php +++ b/Zotlabs/Module/Home.php @@ -13,14 +13,12 @@ class Home extends \Zotlabs\Web\Controller { $ret = array(); call_hooks('home_init',$ret); - + $splash = ((argc() > 1 && argv(1) === 'splash') ? true : false); $channel = \App::get_channel(); if(local_channel() && $channel && $channel['xchan_url'] && ! $splash) { - $dest = $channel['channel_startpage']; - if(! $dest) - $dest = get_pconfig(local_channel(),'system','startpage'); + $dest = (($ret['startpage']) ? $ret['startpage'] : ''); if(! $dest) $dest = get_config('system','startpage'); if(! $dest) -- cgit v1.2.3 From 72abe5f3d377043f6aba31090a6671a7e171ddfb Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 1 Oct 2018 12:47:14 +0200 Subject: do not rely on startpage pconfig anymore --- Zotlabs/Widget/Notifications.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index a4cf4e706..0f9f609e4 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -160,7 +160,7 @@ class Notifications { '$notifications' => $notifications, '$no_notifications' => t('Sorry, you have got no notifications at the moment'), '$loading' => t('Loading'), - '$startpage' => get_pconfig(local_channel(), 'system', 'startpage') + '$startpage' => $channel['channel_startpage'] )); return $o; -- cgit v1.2.3 From 67f19745fd5c66345a7e64b3d5fdedf6c1a6b8b6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 2 Oct 2018 14:29:56 +0200 Subject: add app_destroy hook which allows addons to perform post delete actions --- Zotlabs/Lib/Apps.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index c54a5a111..ec1f3f9dc 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -623,6 +623,7 @@ class Apps { intval(TERM_OBJ_APP), intval($x[0]['id']) ); + call_hooks('app_destroy', $x[0]); } else { $r = q("update app set app_deleted = 1 where app_id = '%s' and app_channel = %d", -- cgit v1.2.3 From d0605e8d5f7c666fffc01352de4d9ed4738f41ab Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 4 Oct 2018 11:50:38 +0200 Subject: uexport app --- Zotlabs/Module/Uexport.php | 21 ++++++++++++++++++--- Zotlabs/Widget/Settings_menu.php | 7 ------- 2 files changed, 18 insertions(+), 10 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Uexport.php b/Zotlabs/Module/Uexport.php index 9af1887dc..3d1587b87 100644 --- a/Zotlabs/Module/Uexport.php +++ b/Zotlabs/Module/Uexport.php @@ -1,18 +1,24 @@ 1) { $sections = (($_REQUEST['sections']) ? explode(',',$_REQUEST['sections']) : ''); - $channel = \App::get_channel(); + $channel = App::get_channel(); if(argc() > 1 && intval(argv(1)) > 1900) { $year = intval(argv(1)); @@ -47,6 +53,15 @@ class Uexport extends \Zotlabs\Web\Controller { } function get() { + + if(! Apps::system_app_installed(local_channel(), 'Channel Export')) { + //Do not display any associated widgets at this point + App::$pdl = ''; + + $o = '' . t('Channel Export App') . ' (' . t('Not Installed') . '):
'; + $o .= t('Export your channel'); + return $o; + } $y = datetime_convert('UTC',date_default_timezone_get(),'now','Y'); diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 238b8071e..194c4b05b 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -9,7 +9,6 @@ class Settings_menu { if(! local_channel()) return; - $channel = \App::get_channel(); $abook_self_id = 0; @@ -66,12 +65,6 @@ class Settings_menu { ); } - $tabs[] = array( - 'label' => t('Export channel'), - 'url' => z_root() . '/uexport', - 'selected' => '' - ); - if($role === false || $role === 'custom') { $tabs[] = array( 'label' => t('Connection Default Permissions'), -- cgit v1.2.3 From c00dc6120d5a458a2386ab4e561437d9f8c62b3c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 4 Oct 2018 13:26:45 +0200 Subject: defperm app --- Zotlabs/Lib/Apps.php | 8 +++++++ Zotlabs/Module/Defperms.php | 46 +++++++++++++++++++++++++++------------- Zotlabs/Widget/Settings_menu.php | 8 ------- 3 files changed, 39 insertions(+), 23 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index ec1f3f9dc..8db4e000f 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -271,6 +271,10 @@ class Apps { if(! can_view_public_stream()) unset($ret); break; + case 'custom_role': + if(get_pconfig(local_channel(),'system','permissions_role') != 'custom') + unset($ret); + break; case 'observer': if(! $observer) unset($ret); @@ -468,6 +472,10 @@ class Apps { if(! can_view_public_stream()) return ''; break; + case 'custom_role': + if(get_pconfig(local_channel(),'system','permissions_role') != 'custom') + return ''; + break; case 'observer': $observer = \App::get_observer(); if(! $observer) diff --git a/Zotlabs/Module/Defperms.php b/Zotlabs/Module/Defperms.php index 2e886aa64..463ecb57a 100644 --- a/Zotlabs/Module/Defperms.php +++ b/Zotlabs/Module/Defperms.php @@ -1,15 +1,16 @@ ' . t('Default Permissions App') . ' (' . t('Not Installed') . '):
'; + $o .= t('Set custom default permissions for new connections'); + return $o; + } $section = ((array_key_exists('section',$_REQUEST)) ? $_REQUEST['section'] : ''); - $channel = \App::get_channel(); + $channel = App::get_channel(); $yes_no = array(t('No'),t('Yes')); @@ -194,7 +210,7 @@ class Defperms extends \Zotlabs\Web\Controller { } $o .= " }\n\n"; - if(\App::$poi) { + if(App::$poi) { $sections = []; @@ -204,9 +220,9 @@ class Defperms extends \Zotlabs\Web\Controller { $perms = array(); - $channel = \App::get_channel(); + $channel = App::get_channel(); - $contact = \App::$poi; + $contact = App::$poi; $global_perms = \Zotlabs\Access\Permissions::Perms(); diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index 194c4b05b..a4b288441 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -65,14 +65,6 @@ class Settings_menu { ); } - if($role === false || $role === 'custom') { - $tabs[] = array( - 'label' => t('Connection Default Permissions'), - 'url' => z_root() . '/defperms', - 'selected' => '' - ); - } - $tabtpl = get_markup_template("generic_links_widget.tpl"); return replace_macros($tabtpl, array( '$title' => t('Settings'), -- cgit v1.2.3 From cccea911fa6a8dadb8fae03676ac933b2ed9592a Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 4 Oct 2018 13:44:26 +0200 Subject: remove redundant var --- Zotlabs/Widget/Settings_menu.php | 2 -- 1 file changed, 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index a4b288441..c537c3835 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -15,8 +15,6 @@ class Settings_menu { // Retrieve the 'self' address book entry for use in the auto-permissions link - $role = get_pconfig(local_channel(),'system','permissions_role'); - $abk = q("select abook_id from abook where abook_channel = %d and abook_self = 1 limit 1", intval(local_channel()) ); -- cgit v1.2.3 From 6e03104e3ee785954b4f755240d1595f702522b2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 4 Oct 2018 20:48:22 +0200 Subject: move *_list_mode to features --- Zotlabs/Module/Channel.php | 2 +- Zotlabs/Module/Network.php | 2 +- Zotlabs/Module/Settings/Display.php | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 8b2e35709..f1537ed15 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -182,7 +182,7 @@ class Channel extends Controller { $item_normal_update = item_normal_update(); $sql_extra = item_permissions_sql(App::$profile['profile_uid']); - if(get_pconfig(App::$profile['profile_uid'],'system','channel_list_mode') && (! $mid)) + if(feature_enabled(App::$profile['profile_uid'], 'channel_list_mode') && (! $mid)) $page_mode = 'list'; else $page_mode = 'client'; diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php index 919996943..015351cbf 100644 --- a/Zotlabs/Module/Network.php +++ b/Zotlabs/Module/Network.php @@ -437,7 +437,7 @@ class Network extends \Zotlabs\Web\Controller { $abook_uids = " and abook.abook_channel = " . local_channel() . " "; $uids = " and item.uid = " . local_channel() . " "; - if(get_pconfig(local_channel(),'system','network_list_mode')) + if(feature_enabled(local_channel(), 'network_list_mode')) $page_mode = 'list'; else $page_mode = 'client'; diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index 0c63a3056..b4f8928e0 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -27,8 +27,6 @@ class Display { $user_scalable = ((x($_POST,'user_scalable')) ? intval($_POST['user_scalable']) : 0); $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0); $title_tosource = ((x($_POST,'title_tosource')) ? intval($_POST['title_tosource']) : 0); - $channel_list_mode = ((x($_POST,'channel_list_mode')) ? intval($_POST['channel_list_mode']) : 0); - $network_list_mode = ((x($_POST,'network_list_mode')) ? intval($_POST['network_list_mode']) : 0); $manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0); $start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0); @@ -55,8 +53,6 @@ class Display { set_pconfig(local_channel(),'system','itemspage', $itemspage); set_pconfig(local_channel(),'system','no_smilies',1-intval($nosmile)); set_pconfig(local_channel(),'system','title_tosource',$title_tosource); - set_pconfig(local_channel(),'system','channel_list_mode', $channel_list_mode); - set_pconfig(local_channel(),'system','network_list_mode', $network_list_mode); set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height); set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height); set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update); @@ -215,8 +211,6 @@ class Display { '$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no), '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no), '$theme_config' => $theme_config, - '$channel_list_mode' => array('channel_list_mode', t('Use blog/list mode on channel page'), get_pconfig(local_channel(),'system','channel_list_mode'), t('(comments displayed separately)'), $yes_no), - '$network_list_mode' => array('network_list_mode', t('Use blog/list mode on grid page'), get_pconfig(local_channel(),'system','network_list_mode'), t('(comments displayed separately)'), $yes_no), '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), '$network_divmore_height' => array('network_divmore_height', t('Grid page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no] -- cgit v1.2.3 From d4af745fc8000be9fcc198d3d0205a6b134e374c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 4 Oct 2018 21:38:39 +0200 Subject: move *_divmore_height setting to the module extra_settings, and fix issue where feature settings were not synced if rpath was provided --- Zotlabs/Module/Settings/Calendar.php | 4 ++++ Zotlabs/Module/Settings/Channel_home.php | 25 +++++++++++++++++++++++++ Zotlabs/Module/Settings/Connections.php | 4 ++++ Zotlabs/Module/Settings/Directory.php | 4 ++++ Zotlabs/Module/Settings/Display.php | 11 ----------- Zotlabs/Module/Settings/Editor.php | 4 ++++ Zotlabs/Module/Settings/Events.php | 4 ++++ Zotlabs/Module/Settings/Manage.php | 4 ++++ Zotlabs/Module/Settings/Network.php | 28 ++++++++++++++++++++++++++-- Zotlabs/Module/Settings/Photos.php | 4 ++++ Zotlabs/Module/Settings/Profiles.php | 4 ++++ 11 files changed, 83 insertions(+), 13 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Calendar.php b/Zotlabs/Module/Settings/Calendar.php index b3a611cdf..a27bf0fa5 100644 --- a/Zotlabs/Module/Settings/Calendar.php +++ b/Zotlabs/Module/Settings/Calendar.php @@ -16,6 +16,10 @@ class Calendar { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Channel_home.php b/Zotlabs/Module/Settings/Channel_home.php index 1d1cc370b..23c7ee1ab 100644 --- a/Zotlabs/Module/Settings/Channel_home.php +++ b/Zotlabs/Module/Settings/Channel_home.php @@ -14,8 +14,18 @@ class Channel_home { $features = get_module_features($module); process_module_features_post(local_channel(), $features, $_POST); + + $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); + if($channel_divmore_height < 50) + $channel_divmore_height = 50; + + set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } @@ -26,6 +36,20 @@ class Channel_home { $features = get_module_features($module); $rpath = (($_GET['rpath']) ? $_GET['rpath'] : ''); + $channel_divmore_height = [ + 'channel_divmore_height', + t('Max height of content (in pixels)'), + ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), + t('Click to expand content exceeding this height') + ]; + + $extra_settings_html = replace_macros(get_markup_template('field_input.tpl'), + [ + '$field' => $channel_divmore_height + ] + ); + + $tpl = get_markup_template("settings_module.tpl"); $o .= replace_macros($tpl, array( @@ -34,6 +58,7 @@ class Channel_home { '$form_security_token' => get_form_security_token('settings_' . $module), '$title' => t('Channel Home Settings'), '$features' => process_module_features_get(local_channel(), $features), + '$extra_settings_html' => $extra_settings_html, '$submit' => t('Submit') )); diff --git a/Zotlabs/Module/Settings/Connections.php b/Zotlabs/Module/Settings/Connections.php index 70b4daa42..cac357791 100644 --- a/Zotlabs/Module/Settings/Connections.php +++ b/Zotlabs/Module/Settings/Connections.php @@ -16,6 +16,10 @@ class Connections { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Directory.php b/Zotlabs/Module/Settings/Directory.php index 6e24a2cfa..13fe6eb79 100644 --- a/Zotlabs/Module/Settings/Directory.php +++ b/Zotlabs/Module/Settings/Directory.php @@ -16,6 +16,10 @@ class Directory { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php index b4f8928e0..45d80e011 100644 --- a/Zotlabs/Module/Settings/Display.php +++ b/Zotlabs/Module/Settings/Display.php @@ -30,13 +30,6 @@ class Display { $manual_update = ((array_key_exists('manual_update',$_POST)) ? intval($_POST['manual_update']) : 0); $start_menu = ((x($_POST,'start_menu')) ? intval($_POST['start_menu']) : 0); - $channel_divmore_height = ((x($_POST,'channel_divmore_height')) ? intval($_POST['channel_divmore_height']) : 400); - if($channel_divmore_height < 50) - $channel_divmore_height = 50; - $network_divmore_height = ((x($_POST,'network_divmore_height')) ? intval($_POST['network_divmore_height']) : 400); - if($network_divmore_height < 50) - $network_divmore_height = 50; - $browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0); $browser_update = $browser_update * 1000; if($browser_update < 10000) @@ -53,8 +46,6 @@ class Display { set_pconfig(local_channel(),'system','itemspage', $itemspage); set_pconfig(local_channel(),'system','no_smilies',1-intval($nosmile)); set_pconfig(local_channel(),'system','title_tosource',$title_tosource); - set_pconfig(local_channel(),'system','channel_divmore_height', $channel_divmore_height); - set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height); set_pconfig(local_channel(),'system','manual_conversation_update', $manual_update); set_pconfig(local_channel(),'system','channel_menu', $channel_menu); set_pconfig(local_channel(),'system','start_menu', $start_menu); @@ -211,8 +202,6 @@ class Display { '$manual_update' => array('manual_update', t('Manual conversation updates'), channel_manual_conv_update(local_channel()), t('Default is on, turning this off may increase screen jumping'), $yes_no), '$title_tosource' => array('title_tosource', t("Link post titles to source"), $title_tosource, '', $yes_no), '$theme_config' => $theme_config, - '$channel_divmore_height' => array('channel_divmore_height', t('Channel page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','channel_divmore_height')) ? get_pconfig(local_channel(),'system','channel_divmore_height') : 400), t('click to expand content exceeding this height')), - '$network_divmore_height' => array('network_divmore_height', t('Grid page max height of content (in pixels)'), ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400) , t('click to expand content exceeding this height')), '$start_menu' => ['start_menu', t('New Member Links'), $start_menu, t('Display new member quick links menu'), $yes_no] )); diff --git a/Zotlabs/Module/Settings/Editor.php b/Zotlabs/Module/Settings/Editor.php index 93e3ce602..5e7a9473a 100644 --- a/Zotlabs/Module/Settings/Editor.php +++ b/Zotlabs/Module/Settings/Editor.php @@ -16,6 +16,10 @@ class Editor { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Events.php b/Zotlabs/Module/Settings/Events.php index fcb4441e1..eb6dda99b 100644 --- a/Zotlabs/Module/Settings/Events.php +++ b/Zotlabs/Module/Settings/Events.php @@ -16,6 +16,10 @@ class Events { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Manage.php b/Zotlabs/Module/Settings/Manage.php index 15d3216e9..9bae12022 100644 --- a/Zotlabs/Module/Settings/Manage.php +++ b/Zotlabs/Module/Settings/Manage.php @@ -16,6 +16,10 @@ class Manage { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Network.php b/Zotlabs/Module/Settings/Network.php index c51b780f1..aaafe9255 100644 --- a/Zotlabs/Module/Settings/Network.php +++ b/Zotlabs/Module/Settings/Network.php @@ -14,8 +14,18 @@ class Network { $features = get_module_features($module); process_module_features_post(local_channel(), $features, $_POST); + + $network_divmore_height = ((x($_POST,'network_divmore_height')) ? intval($_POST['network_divmore_height']) : 400); + if($network_divmore_height < 50) + $network_divmore_height = 50; + + set_pconfig(local_channel(),'system','network_divmore_height', $network_divmore_height); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } @@ -26,6 +36,19 @@ class Network { $features = get_module_features($module); $rpath = (($_GET['rpath']) ? $_GET['rpath'] : ''); + $network_divmore_height = [ + 'network_divmore_height', + t('Max height of content (in pixels)'), + ((get_pconfig(local_channel(),'system','network_divmore_height')) ? get_pconfig(local_channel(),'system','network_divmore_height') : 400), + t('Click to expand content exceeding this height') + ]; + + $extra_settings_html = replace_macros(get_markup_template('field_input.tpl'), + [ + '$field' => $network_divmore_height + ] + ); + $tpl = get_markup_template("settings_module.tpl"); $o .= replace_macros($tpl, array( @@ -33,8 +56,9 @@ class Network { '$action_url' => 'settings/' . $module, '$form_security_token' => get_form_security_token('settings_' . $module), '$title' => t('Activity Settings'), - '$features' => process_module_features_get(local_channel(), $features), - '$submit' => t('Submit') + '$features' => process_module_features_get(local_channel(), $features), + '$extra_settings_html' => $extra_settings_html, + '$submit' => t('Submit') )); return $o; diff --git a/Zotlabs/Module/Settings/Photos.php b/Zotlabs/Module/Settings/Photos.php index f403b4d38..9edbaa929 100644 --- a/Zotlabs/Module/Settings/Photos.php +++ b/Zotlabs/Module/Settings/Photos.php @@ -16,6 +16,10 @@ class Photos { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } diff --git a/Zotlabs/Module/Settings/Profiles.php b/Zotlabs/Module/Settings/Profiles.php index 78dc0160e..2dc037317 100644 --- a/Zotlabs/Module/Settings/Profiles.php +++ b/Zotlabs/Module/Settings/Profiles.php @@ -16,6 +16,10 @@ class Profiles { process_module_features_post(local_channel(), $features, $_POST); build_sync_packet(); + + if($_POST['rpath']) + goaway($_POST['rpath']); + return; } -- cgit v1.2.3 From 363fc5c72b9e9564196375137b89e3270774f471 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 4 Oct 2018 21:49:00 +0200 Subject: whitespace --- Zotlabs/Module/Settings/Channel_home.php | 1 - 1 file changed, 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Channel_home.php b/Zotlabs/Module/Settings/Channel_home.php index 23c7ee1ab..0e916d530 100644 --- a/Zotlabs/Module/Settings/Channel_home.php +++ b/Zotlabs/Module/Settings/Channel_home.php @@ -49,7 +49,6 @@ class Channel_home { ] ); - $tpl = get_markup_template("settings_module.tpl"); $o .= replace_macros($tpl, array( -- cgit v1.2.3 From 9fe9137c9689347e2be1d6bf6633956e147e368c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 4 Oct 2018 22:01:34 +0200 Subject: fix displaying of perm cats selector --- Zotlabs/Module/Settings/Channel.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php index c473a70a4..6b49f165d 100644 --- a/Zotlabs/Module/Settings/Channel.php +++ b/Zotlabs/Module/Settings/Channel.php @@ -2,6 +2,8 @@ namespace Zotlabs\Module\Settings; +use Zotlabs\Lib\Apps; + require_once('include/selectors.php'); @@ -551,8 +553,8 @@ class Channel { '$suggestme' => $suggestme, '$group_select' => $group_select, '$role' => array('permissions_role' , t('Channel role and privacy'), $permissions_role, '', $perm_roles), - '$defpermcat' => [ 'defpermcat', t('Default Permissions Group'), $default_permcat, '', $permcats ], - '$permcat_enable' => feature_enabled(local_channel(),'permcats'), + '$defpermcat' => [ 'defpermcat', t('Default permissions category'), $default_permcat, '', $permcats ], + '$permcat_enable' => Apps::system_app_installed(local_channel(), 'Permission Categories'), '$profile_in_dir' => $profile_in_dir, '$hide_friends' => $hide_friends, '$hide_wall' => $hide_wall, -- cgit v1.2.3 From 1eaf6df842184743ee20ec69931be1ff7136f34e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 4 Oct 2018 22:21:20 +0200 Subject: fix issues with bs accordions --- Zotlabs/Module/Permcats.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Permcats.php b/Zotlabs/Module/Permcats.php index 262a14fe4..75ac2ac87 100644 --- a/Zotlabs/Module/Permcats.php +++ b/Zotlabs/Module/Permcats.php @@ -25,7 +25,7 @@ class Permcats extends Controller { $name = escape_tags(trim($_POST['name'])); if(! $name) { - notice( t('Permission Name is required.') . EOL); + notice( t('Permission category name is required.') . EOL); return; } @@ -117,7 +117,7 @@ class Permcats extends Controller { '$atoken' => $atoken, '$url1' => z_root() . '/channel/' . $channel['channel_address'], '$url2' => z_root() . '/photos/' . $channel['channel_address'], - '$name' => array('name', t('Permission Name') . ' *', (($name) ? $name : ''), ''), + '$name' => array('name', t('Permission category name') . ' *', (($name) ? $name : ''), ''), '$me' => t('My Settings'), '$perms' => $perms, '$inherited' => t('inherited'), -- cgit v1.2.3