aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-09-28 09:41:21 +0200
committerMario <mario@mariovavti.com>2018-09-28 09:41:21 +0200
commit9e87219aead74791cdb68d4fa166326a0bd92d78 (patch)
tree3cec224f7ebca28d3155ff335bf43fc39ea3db39 /Zotlabs/Module
parent1b7e220de734f30cf22452e36fe6b746676ddf46 (diff)
parent65785ead697056130d01520a917bfc2626788c0c (diff)
downloadvolse-hubzilla-9e87219aead74791cdb68d4fa166326a0bd92d78.tar.gz
volse-hubzilla-9e87219aead74791cdb68d4fa166326a0bd92d78.tar.bz2
volse-hubzilla-9e87219aead74791cdb68d4fa166326a0bd92d78.zip
Merge branch 'patch-10' into 'dev'
rename groups and group_members tables for MySQL 8 compatibility See merge request hubzilla/core!1290
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Acl.php14
-rw-r--r--Zotlabs/Module/Connections.php2
-rw-r--r--Zotlabs/Module/Contactgroup.php2
-rw-r--r--Zotlabs/Module/Group.php10
-rw-r--r--Zotlabs/Module/Import.php2
-rw-r--r--Zotlabs/Module/Lockview.php4
-rw-r--r--Zotlabs/Module/Network.php2
-rw-r--r--Zotlabs/Module/Settings/Channel.php4
8 files changed, 20 insertions, 20 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/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/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/Group.php b/Zotlabs/Module/Group.php
index bf0edb1ed..bfe051d59 100644
--- a/Zotlabs/Module/Group.php
+++ b/Zotlabs/Module/Group.php
@@ -53,7 +53,7 @@ class Group extends Controller {
if((argc() == 2) && (intval(argv(1)))) {
check_form_security_token_redirectOnErr('/group', 'group_edit');
- $r = q("SELECT * FROM groups WHERE id = %d AND uid = %d LIMIT 1",
+ $r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d LIMIT 1",
intval(argv(1)),
intval(local_channel())
);
@@ -67,7 +67,7 @@ class Group extends Controller {
$public = intval($_POST['public']);
if((strlen($groupname)) && (($groupname != $group['gname']) || ($public != $group['visible']))) {
- $r = q("UPDATE groups SET gname = '%s', visible = %d WHERE uid = %d AND id = %d",
+ $r = q("UPDATE pgrp SET gname = '%s', visible = %d WHERE uid = %d AND id = %d",
dbesc($groupname),
intval($public),
intval(local_channel()),
@@ -115,7 +115,7 @@ class Group extends Controller {
$new = (((argc() == 2) && (argv(1) === 'new')) ? true : false);
- $groups = q("SELECT id, gname FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
+ $groups = q("SELECT id, gname FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval(local_channel())
);
@@ -160,7 +160,7 @@ class Group extends Controller {
check_form_security_token_redirectOnErr('/group', 'group_drop', 't');
if(intval(argv(2))) {
- $r = q("SELECT gname FROM groups WHERE id = %d AND uid = %d LIMIT 1",
+ $r = q("SELECT gname FROM pgrp WHERE id = %d AND uid = %d LIMIT 1",
intval(argv(2)),
intval(local_channel())
);
@@ -192,7 +192,7 @@ class Group extends Controller {
if((argc() > 1) && (intval(argv(1)))) {
require_once('include/acl_selectors.php');
- $r = q("SELECT * FROM groups WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1",
+ $r = q("SELECT * FROM pgrp WHERE id = %d AND uid = %d AND deleted = 0 LIMIT 1",
intval(argv(1)),
intval(local_channel())
);
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/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/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') )
);