aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Group.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Group.php')
-rw-r--r--Zotlabs/Module/Group.php39
1 files changed, 29 insertions, 10 deletions
diff --git a/Zotlabs/Module/Group.php b/Zotlabs/Module/Group.php
index acebe995d..c8ccaa2cb 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>' . t('Privacy Groups App') . ' (' . t('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())
);