aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Acl.php14
-rw-r--r--Zotlabs/Module/Connect.php68
-rw-r--r--Zotlabs/Module/Connections.php2
-rw-r--r--Zotlabs/Module/Connedit.php3
-rw-r--r--Zotlabs/Module/Contactgroup.php2
-rw-r--r--Zotlabs/Module/Defperms.php3
-rw-r--r--Zotlabs/Module/Directory.php6
-rw-r--r--Zotlabs/Module/Group.php39
-rw-r--r--Zotlabs/Module/Import.php2
-rw-r--r--Zotlabs/Module/Lockview.php4
-rw-r--r--Zotlabs/Module/Manage.php4
-rw-r--r--Zotlabs/Module/Network.php2
-rw-r--r--Zotlabs/Module/New_channel.php8
-rw-r--r--Zotlabs/Module/Notes.php41
-rw-r--r--Zotlabs/Module/Oauth.php (renamed from Zotlabs/Module/Settings/Oauth.php)67
-rw-r--r--Zotlabs/Module/Oauth2.php (renamed from Zotlabs/Module/Settings/Oauth2.php)67
-rw-r--r--Zotlabs/Module/Pdledit.php21
-rw-r--r--Zotlabs/Module/Permcats.php (renamed from Zotlabs/Module/Settings/Permcats.php)35
-rw-r--r--Zotlabs/Module/Settings/Channel.php4
-rw-r--r--Zotlabs/Module/Settings/Channel_home.php43
-rw-r--r--Zotlabs/Module/Settings/Conversation.php60
-rw-r--r--Zotlabs/Module/Settings/Directory.php43
-rw-r--r--Zotlabs/Module/Settings/Display.php15
-rw-r--r--Zotlabs/Module/Settings/Features.php35
-rw-r--r--Zotlabs/Module/Tokens.php (renamed from Zotlabs/Module/Settings/Tokens.php)42
25 files changed, 459 insertions, 171 deletions
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),
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 @@
<?php
namespace Zotlabs\Module; /** @file */
-
+use App;
+use Zotlabs\Web\Controller;
+use Zotlabs\Lib\Apps;
require_once('include/contact_widgets.php');
require_once('include/items.php');
-
-
-class Connect extends \Zotlabs\Web\Controller {
+class Connect extends Controller {
function init() {
if(argc() > 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 = '<b>Premium Channel App (Not Installed):</b><br>';
+ $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/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
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'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$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/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())
);
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 @@
<?php
namespace Zotlabs\Module;
+use Zotlabs\Lib\Apps;
require_once('include/socgraph.php');
require_once('include/selectors.php');
@@ -238,7 +239,7 @@ class Defperms extends \Zotlabs\Web\Controller {
'$autoperms' => 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'), '', '<span class="loading invisible">' . t('Loading') . '<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span></span>',$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/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() {
diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php
index acebe995d..bfe051d59 100644
--- a/Zotlabs/Module/Group.php
+++ b/Zotlabs/Module/Group.php
@@ -1,11 +1,13 @@
<?php
namespace Zotlabs\Module;
-require_once('include/group.php');
-
+use App;
+use Zotlabs\Web\Controller;
+use Zotlabs\Lib\Apps;
+require_once('include/group.php');
-class Group extends \Zotlabs\Web\Controller {
+class Group extends Controller {
function init() {
if(! local_channel()) {
@@ -13,7 +15,11 @@ class Group extends \Zotlabs\Web\Controller {
return;
}
- \App::$profile_uid = local_channel();
+ if(! Apps::system_app_installed(local_channel(), 'Privacy Groups')) {
+ return;
+ }
+
+ App::$profile_uid = local_channel();
nav_set_selected('Privacy Groups');
}
@@ -24,6 +30,10 @@ class Group extends \Zotlabs\Web\Controller {
notice( t('Permission denied.') . EOL);
return;
}
+
+ if(! Apps::system_app_installed(local_channel(), 'Privacy Groups')) {
+ return;
+ }
if((argc() == 2) && (argv(1) === 'new')) {
check_form_security_token_redirectOnErr('/group/new', 'group_edit');
@@ -43,7 +53,7 @@ class Group extends \Zotlabs\Web\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())
);
@@ -57,7 +67,7 @@ class Group extends \Zotlabs\Web\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()),
@@ -77,13 +87,22 @@ class Group extends \Zotlabs\Web\Controller {
$change = false;
- logger('mod_group: ' . \App::$cmd,LOGGER_DEBUG);
+ logger('mod_group: ' . App::$cmd,LOGGER_DEBUG);
if(! local_channel()) {
notice( t('Permission denied') . EOL);
return;
}
+ if(! Apps::system_app_installed(local_channel(), 'Privacy Groups')) {
+ //Do not display any associated widgets at this point
+ App::$pdl = '';
+
+ $o = '<b>Privacy Groups App (Not Installed):</b><br>';
+ $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)
@@ -96,7 +115,7 @@ class Group extends \Zotlabs\Web\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())
);
@@ -141,7 +160,7 @@ class Group extends \Zotlabs\Web\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())
);
@@ -173,7 +192,7 @@ class Group extends \Zotlabs\Web\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())
);
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) {
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[] = '<div class="dropdown-item"><b>' . $rr['gname'] . '</b></div>';
@@ -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[] = '<div class="dropdown-item"><b><strike>' . $rr['gname'] . '</strike></b></div>';
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,
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())
);
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;
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 @@
<?php
namespace Zotlabs\Module; /** @file */
+use App;
+use Zotlabs\Web\Controller;
+use Zotlabs\Lib\Apps;
-class Notes extends \Zotlabs\Web\Controller {
+class Notes extends Controller {
- function init() {
+ function post() {
if(! local_channel())
- return;
+ return EMPTY_STR;
+
+ if(! Apps::system_app_installed(local_channel(), 'Notes'))
+ return EMPTY_STR;
$ret = array('success' => 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 = '<b>Notes App (Not Installed):</b><br>';
+ $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/Module/Settings/Oauth.php b/Zotlabs/Module/Oauth.php
index d6576c6de..fbcc48ead 100644
--- a/Zotlabs/Module/Settings/Oauth.php
+++ b/Zotlabs/Module/Oauth.php
@@ -1,27 +1,37 @@
<?php
-namespace Zotlabs\Module\Settings;
+namespace Zotlabs\Module;
+use App;
+use Zotlabs\Lib\Apps;
+use Zotlabs\Web\Controller;
-class Oauth {
+class Oauth extends Controller {
function post() {
+
+ if(! local_channel())
+ return;
+
+
+ if(! Apps::system_app_installed(local_channel(), 'OAuth Apps Manager'))
+ return;
if(x($_POST,'remove')){
- check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
+ check_form_security_token_redirectOnErr('/oauth', 'oauth');
$key = $_POST['remove'];
q("DELETE FROM tokens WHERE id='%s' AND uid=%d",
dbesc($key),
local_channel());
- goaway(z_root()."/settings/oauth/");
+ goaway(z_root()."/oauth");
return;
}
- if((argc() > 2) && (argv(2) === 'edit' || argv(2) === 'add') && x($_POST,'submit')) {
+ if((argc() > 1) && (argv(1) === 'edit' || argv(1) === 'add') && x($_POST,'submit')) {
- check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
+ check_form_security_token_redirectOnErr('oauth', 'oauth');
$name = ((x($_POST,'name')) ? escape_tags($_POST['name']) : '');
$key = ((x($_POST,'key')) ? escape_tags($_POST['key']) : '');
@@ -73,17 +83,30 @@ class Oauth {
);
}
}
- goaway(z_root()."/settings/oauth/");
+ goaway(z_root()."/oauth");
return;
}
}
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 = '';
+
+ $o = '<b>OAuth Apps Manager App (Not Installed):</b><br>';
+ $o .= t('OAuth authentication tokens for mobile and remote apps');
+ return $o;
+ }
+
- if((argc() > 2) && (argv(2) === 'add')) {
- $tpl = get_markup_template("settings_oauth_edit.tpl");
+ 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("settings_oauth"),
+ '$form_security_token' => get_form_security_token("oauth"),
'$title' => t('Add application'),
'$submit' => t('Submit'),
'$cancel' => t('Cancel'),
@@ -96,9 +119,9 @@ class Oauth {
return $o;
}
- if((argc() > 3) && (argv(2) === 'edit')) {
+ if((argc() > 2) && (argv(1) === 'edit')) {
$r = q("SELECT * FROM clients WHERE client_id='%s' AND uid=%d",
- dbesc(argv(3)),
+ dbesc(argv(2)),
local_channel());
if (!count($r)){
@@ -107,9 +130,9 @@ class Oauth {
}
$app = $r[0];
- $tpl = get_markup_template("settings_oauth_edit.tpl");
+ $tpl = get_markup_template("oauth_edit.tpl");
$o .= replace_macros($tpl, array(
- '$form_security_token' => get_form_security_token("settings_oauth"),
+ '$form_security_token' => get_form_security_token("oauth"),
'$title' => t('Add application'),
'$submit' => t('Update'),
'$cancel' => t('Cancel'),
@@ -122,13 +145,13 @@ class Oauth {
return $o;
}
- if((argc() > 3) && (argv(2) === 'delete')) {
- check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth', 't');
+ 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(3)),
+ dbesc(argv(2)),
local_channel());
- goaway(z_root()."/settings/oauth/");
+ goaway(z_root()."/oauth");
return;
}
@@ -141,11 +164,11 @@ class Oauth {
local_channel());
- $tpl = get_markup_template("settings_oauth.tpl");
+ $tpl = get_markup_template("oauth.tpl");
$o .= replace_macros($tpl, array(
- '$form_security_token' => get_form_security_token("settings_oauth"),
+ '$form_security_token' => get_form_security_token("oauth"),
'$baseurl' => z_root(),
- '$title' => t('Connected Apps'),
+ '$title' => t('Connected OAuth Apps'),
'$add' => t('Add application'),
'$edit' => t('Edit'),
'$delete' => t('Delete'),
@@ -158,4 +181,4 @@ class Oauth {
}
-} \ No newline at end of file
+}
diff --git a/Zotlabs/Module/Settings/Oauth2.php b/Zotlabs/Module/Oauth2.php
index 70fd3a5c3..c27d7534b 100644
--- a/Zotlabs/Module/Settings/Oauth2.php
+++ b/Zotlabs/Module/Oauth2.php
@@ -1,15 +1,24 @@
<?php
-namespace Zotlabs\Module\Settings;
+namespace Zotlabs\Module;
+use App;
+use Zotlabs\Lib\Apps;
+use Zotlabs\Web\Controller;
-class Oauth2 {
+class Oauth2 extends Controller {
function post() {
+
+ if(! local_channel())
+ return;
+
+ if(! Apps::system_app_installed(local_channel(), 'OAuth2 Apps Manager'))
+ return;
if(x($_POST,'remove')){
- check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2');
+ check_form_security_token_redirectOnErr('oauth2', 'oauth2');
$name = ((x($_POST,'name')) ? escape_tags(trim($_POST['name'])) : '');
logger("REMOVE! ".$name." uid: ".local_channel());
$key = $_POST['remove'];
@@ -25,13 +34,13 @@ class Oauth2 {
dbesc($name),
intval(local_channel())
);
- goaway(z_root()."/settings/oauth2/");
+ goaway(z_root()."/oauth2");
return;
}
- if((argc() > 2) && (argv(2) === 'edit' || argv(2) === 'add') && x($_POST,'submit')) {
+ if((argc() > 1) && (argv(1) === 'edit' || argv(1) === 'add') && x($_POST,'submit')) {
- check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2');
+ 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'])) : '');
@@ -80,17 +89,29 @@ class Oauth2 {
);
}
}
- goaway(z_root()."/settings/oauth2/");
+ goaway(z_root()."/oauth2");
return;
}
}
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 = '';
+
+ $o = '<b>OAuth2 Apps Manager App (Not Installed):</b><br>';
+ $o .= t('OAuth2 authenticatication tokens for mobile and remote apps');
+ return $o;
+ }
- if((argc() > 2) && (argv(2) === 'add')) {
- $tpl = get_markup_template("settings_oauth2_edit.tpl");
+ 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("settings_oauth2"),
+ '$form_security_token' => get_form_security_token("oauth2"),
'$title' => t('Add OAuth2 application'),
'$submit' => t('Submit'),
'$cancel' => t('Cancel'),
@@ -103,9 +124,9 @@ class Oauth2 {
return $o;
}
- if((argc() > 3) && (argv(2) === 'edit')) {
+ if((argc() > 2) && (argv(1) === 'edit')) {
$r = q("SELECT * FROM oauth_clients WHERE client_id='%s' AND user_id= %d",
- dbesc(argv(3)),
+ dbesc(argv(2)),
intval(local_channel())
);
@@ -116,9 +137,9 @@ class Oauth2 {
$app = $r[0];
- $tpl = get_markup_template("settings_oauth2_edit.tpl");
+ $tpl = get_markup_template("oauth2_edit.tpl");
$o .= replace_macros($tpl, array(
- '$form_security_token' => get_form_security_token("settings_oauth2"),
+ '$form_security_token' => get_form_security_token("oauth2"),
'$title' => t('Add application'),
'$submit' => t('Update'),
'$cancel' => t('Cancel'),
@@ -131,26 +152,26 @@ class Oauth2 {
return $o;
}
- if((argc() > 3) && (argv(2) === 'delete')) {
- check_form_security_token_redirectOnErr('/settings/oauth2', 'settings_oauth2', 't');
+ 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(3)),
+ dbesc(argv(2)),
intval(local_channel())
);
$r = q("DELETE FROM oauth_access_tokens WHERE client_id = '%s' AND user_id = %d",
- dbesc(argv(3)),
+ dbesc(argv(2)),
intval(local_channel())
);
$r = q("DELETE FROM oauth_authorization_codes WHERE client_id = '%s' AND user_id = %d",
- dbesc(argv(3)),
+ dbesc(argv(2)),
intval(local_channel())
);
$r = q("DELETE FROM oauth_refresh_tokens WHERE client_id = '%s' AND user_id = %d",
- dbesc(argv(3)),
+ dbesc(argv(2)),
intval(local_channel())
);
- goaway(z_root()."/settings/oauth2/");
+ goaway(z_root()."/oauth2");
return;
}
@@ -164,9 +185,9 @@ class Oauth2 {
intval(local_channel())
);
- $tpl = get_markup_template("settings_oauth2.tpl");
+ $tpl = get_markup_template("oauth2.tpl");
$o .= replace_macros($tpl, array(
- '$form_security_token' => get_form_security_token("settings_oauth2"),
+ '$form_security_token' => get_form_security_token("oauth2"),
'$baseurl' => z_root(),
'$title' => t('Connected OAuth2 Apps'),
'$add' => t('Add application'),
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 @@
<?php
namespace Zotlabs\Module;
+use App;
+use Zotlabs\Web\Controller;
+use Zotlabs\Lib\Apps;
-class Pdledit extends \Zotlabs\Web\Controller {
+class Pdledit extends Controller {
function post() {
if(! local_channel())
return;
- if(! $_REQUEST['module'])
+
+ if(! Apps::system_app_installed(local_channel(), 'PDL Editor'))
return;
- if(! feature_enabled(local_channel(),'advanced_theming'))
+
+ if(! $_REQUEST['module'])
return;
if(! trim($_REQUEST['content'])) {
@@ -30,9 +35,13 @@ class Pdledit extends \Zotlabs\Web\Controller {
return;
}
- if(! feature_enabled(local_channel(),'advanced_theming')) {
- notice( t('Feature disabled.') . EOL);
- return;
+ if(! Apps::system_app_installed(local_channel(), 'PDL Editor')) {
+ //Do not display any associated widgets at this point
+ App::$pdl = '';
+
+ $o = '<b>PDL Editor App (Not Installed):</b><br>';
+ $o .= t('Provides the ability to edit system page layouts');
+ return $o;
}
if(argc() > 2 && argv(2) === 'reset') {
diff --git a/Zotlabs/Module/Settings/Permcats.php b/Zotlabs/Module/Permcats.php
index 40641c3f2..3d068862a 100644
--- a/Zotlabs/Module/Settings/Permcats.php
+++ b/Zotlabs/Module/Permcats.php
@@ -1,19 +1,24 @@
<?php
-namespace Zotlabs\Module\Settings;
+namespace Zotlabs\Module;
+use App;
+use Zotlabs\Web\Controller;
+use Zotlabs\Lib\Apps;
-
-class Permcats {
+class Permcats extends Controller {
function post() {
if(! local_channel())
return;
- $channel = \App::get_channel();
+ if(! Apps::system_app_installed(local_channel(), 'Permission Categories'))
+ return;
+
+ $channel = App::get_channel();
- check_form_security_token_redirectOnErr('/settings/permcats', 'settings_permcats');
+ check_form_security_token_redirectOnErr('/permcats', 'permcats');
$all_perms = \Zotlabs\Access\Permissions::Perms();
@@ -50,13 +55,21 @@ class Permcats {
if(! local_channel())
return;
- $channel = \App::get_channel();
+ if(! Apps::system_app_installed(local_channel(), 'Permission Categories')) {
+ //Do not display any associated widgets at this point
+ App::$pdl = '';
+
+ $o = '<b>Permission Categories App (Not Installed):</b><br>';
+ $o .= t('Create custom connection permission limits');
+ return $o;
+ }
+ $channel = App::get_channel();
- if(argc() > 2)
- $name = hex2bin(argv(2));
+ if(argc() > 1)
+ $name = hex2bin(argv(1));
- if(argc() > 3 && argv(3) === 'drop') {
+ if(argc() > 2 && argv(2) === 'drop') {
\Zotlabs\Lib\Permcat::delete(local_channel(),$name);
build_sync_packet();
json_return_and_die([ 'success' => true ]);
@@ -93,9 +106,9 @@ class Permcats {
- $tpl = get_markup_template("settings_permcats.tpl");
+ $tpl = get_markup_template("permcats.tpl");
$o .= replace_macros($tpl, array(
- '$form_security_token' => get_form_security_token("settings_permcats"),
+ '$form_security_token' => get_form_security_token("permcats"),
'$title' => t('Permission Categories'),
'$desc' => $desc,
'$desc2' => $desc2,
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') )
);
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 @@
+<?php
+
+namespace Zotlabs\Module\Settings;
+
+
+class Channel_home {
+
+ function post() {
+
+ $module = substr(strrchr(strtolower(static::class), '\\'), 1);
+
+ check_form_security_token_redirectOnErr('/settings/' . $module, 'settings_' . $module);
+
+ $features = get_module_features($module);
+
+ process_module_features_post(local_channel(), $features, $_POST);
+
+ build_sync_packet();
+ return;
+ }
+
+ function get() {
+
+ $module = substr(strrchr(strtolower(static::class), '\\'), 1);
+
+ $features = get_module_features($module);
+ $rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
+
+ $tpl = get_markup_template("settings_module.tpl");
+
+ $o .= replace_macros($tpl, array(
+ '$rpath' => $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;
+ }
+
+}
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 @@
+<?php
+
+namespace Zotlabs\Module\Settings;
+
+
+class Conversation {
+
+ function post() {
+
+ $module = substr(strrchr(strtolower(static::class), '\\'), 1);
+
+ check_form_security_token_redirectOnErr('/settings/' . $module, 'settings_' . $module);
+
+ $features = get_module_features($module);
+
+ process_module_features_post(local_channel(), $features, $_POST);
+
+ build_sync_packet();
+
+ if($_POST['aj']) {
+ if($_POST['auto_update'] == 1)
+ info(t('Settings saved.') . EOL);
+ else
+ info(t('Settings saved. Reload page please.') . EOL);
+
+ killme();
+ }
+ else {
+ return;
+ }
+ }
+
+ function get() {
+
+ $aj = ((isset($_GET['aj'])) ? true : false);
+
+ $module = substr(strrchr(strtolower(static::class), '\\'), 1);
+
+ $features = get_module_features($module);
+
+ $tpl = (($aj) ? get_markup_template("settings_module_ajax.tpl") : get_markup_template("settings_module.tpl"));
+
+ $o .= replace_macros($tpl, array(
+ '$action_url' => '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/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 @@
+<?php
+
+namespace Zotlabs\Module\Settings;
+
+
+class Directory {
+
+ function post() {
+
+ $module = substr(strrchr(strtolower(static::class), '\\'), 1);
+
+ check_form_security_token_redirectOnErr('/settings/' . $module, 'settings_' . $module);
+
+ $features = get_module_features($module);
+
+ process_module_features_post(local_channel(), $features, $_POST);
+
+ build_sync_packet();
+ return;
+ }
+
+ function get() {
+
+ $module = substr(strrchr(strtolower(static::class), '\\'), 1);
+
+ $features = get_module_features($module);
+ $rpath = (($_GET['rpath']) ? $_GET['rpath'] : '');
+
+ $tpl = get_markup_template("settings_module.tpl");
+
+ $o .= replace_macros($tpl, array(
+ '$rpath' => $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;
+ }
+
+}
diff --git a/Zotlabs/Module/Settings/Display.php b/Zotlabs/Module/Settings/Display.php
index 340b3c0bb..0c63a3056 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
@@ -204,15 +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' => feature_enabled(local_channel(),'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]
));
call_hooks('display_settings',$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/Module/Settings/Tokens.php b/Zotlabs/Module/Tokens.php
index e59cf8d1c..ae03a499a 100644
--- a/Zotlabs/Module/Settings/Tokens.php
+++ b/Zotlabs/Module/Tokens.php
@@ -1,16 +1,24 @@
<?php
-namespace Zotlabs\Module\Settings;
+namespace Zotlabs\Module;
+use App;
+use Zotlabs\Web\Controller;
+use Zotlabs\Lib\Apps;
-
-class Tokens {
+class Tokens extends Controller {
function post() {
- $channel = \App::get_channel();
+ if(! local_channel())
+ return;
+
+ if(! Apps::system_app_installed(local_channel(), 'Guest Access'))
+ return;
+
+ $channel = App::get_channel();
- check_form_security_token_redirectOnErr('/settings/tokens', 'settings_tokens');
+ check_form_security_token_redirectOnErr('tokens', 'tokens');
$token_errs = 0;
if(array_key_exists('token',$_POST)) {
$atoken_id = (($_POST['atoken_id']) ? intval($_POST['atoken_id']) : 0);
@@ -81,13 +89,25 @@ class Tokens {
function get() {
- $channel = \App::get_channel();
+ 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 = '<b>Guest Access App (Not Installed):</b><br>';
+ $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);
+ if(argc() > 1) {
+ $id = argv(1);
$atoken = q("select * from atoken where atoken_id = %d and atoken_uid = %d",
intval($id),
@@ -99,7 +119,7 @@ class Tokens {
$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 = '';
@@ -144,9 +164,9 @@ class Tokens {
- $tpl = get_markup_template("settings_tokens.tpl");
+ $tpl = get_markup_template("tokens.tpl");
$o .= replace_macros($tpl, array(
- '$form_security_token' => get_form_security_token("settings_tokens"),
+ '$form_security_token' => get_form_security_token("tokens"),
'$title' => t('Guest Access Tokens'),
'$desc' => $desc,
'$desc2' => $desc2,