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/Module/Settings') 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 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 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Module/Settings') 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] )); -- 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/Module/Settings') 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 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/Settings/Display.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'Zotlabs/Module/Settings') 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/Settings/Oauth.php | 161 -------------------------------- Zotlabs/Module/Settings/Oauth2.php | 184 ------------------------------------- 2 files changed, 345 deletions(-) delete mode 100644 Zotlabs/Module/Settings/Oauth.php delete mode 100644 Zotlabs/Module/Settings/Oauth2.php (limited to 'Zotlabs/Module/Settings') 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 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/Settings/Permcats.php | 120 ----------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 Zotlabs/Module/Settings/Permcats.php (limited to 'Zotlabs/Module/Settings') 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; - } - -} -- 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/Settings/Tokens.php | 173 ------------------------------------- 1 file changed, 173 deletions(-) delete mode 100644 Zotlabs/Module/Settings/Tokens.php (limited to 'Zotlabs/Module/Settings') 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; - } - -} -- 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/Module/Settings/Conversation.php | 60 ++++++++++++++++++++++++++++++++ Zotlabs/Module/Settings/Features.php | 35 +------------------ 2 files changed, 61 insertions(+), 34 deletions(-) create mode 100644 Zotlabs/Module/Settings/Conversation.php (limited to 'Zotlabs/Module/Settings') 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'), )); -- 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/Module/Settings') 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 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/Module/Settings') 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 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/Module/Settings/Account.php | 15 --------------- Zotlabs/Module/Settings/Channel.php | 7 +------ 2 files changed, 1 insertion(+), 21 deletions(-) (limited to 'Zotlabs/Module/Settings') 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 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/Module/Settings') 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 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/Settings/Display.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'Zotlabs/Module/Settings') 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/Module/Settings') 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/Module/Settings') 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/Module/Settings') 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