diff options
author | habeascodice <habeascodice@federated.social> | 2014-11-17 08:30:26 -0800 |
---|---|---|
committer | habeascodice <habeascodice@federated.social> | 2014-11-17 08:30:26 -0800 |
commit | 540b7af2c12666047710dd8f5e0c54d23ae8872c (patch) | |
tree | ea90f72d9d308f6cb061a528c1f8494106e70087 /include/group.php | |
parent | 80eb84e843cdca51bbf4ebda180f4de41351b9c4 (diff) | |
parent | ee38bebbd6a641eb953eacf493c085053442d972 (diff) | |
download | volse-hubzilla-540b7af2c12666047710dd8f5e0c54d23ae8872c.tar.gz volse-hubzilla-540b7af2c12666047710dd8f5e0c54d23ae8872c.tar.bz2 volse-hubzilla-540b7af2c12666047710dd8f5e0c54d23ae8872c.zip |
Merge branch 'master' of https://github.com/habeascodice/red
Diffstat (limited to 'include/group.php')
-rw-r--r-- | include/group.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/group.php b/include/group.php index d4f08108f..28cf5d80d 100644 --- a/include/group.php +++ b/include/group.php @@ -18,10 +18,11 @@ function group_add($uid,$name,$public = 0) { intval($r) ); if(count($z) && $z[0]['deleted']) { - $r = q("UPDATE `groups` SET `deleted` = 0 WHERE `uid` = %d AND `name` = '%s' LIMIT 1", + /*$r = q("UPDATE `groups` SET `deleted` = 0 WHERE `uid` = %d AND `name` = '%s' LIMIT 1", intval($uid), dbesc($name) - ); + );*/ + q('UPDATE groups SET deleted = 0 WHERE id = %d', intval($z[0]['id'])); notice( t('A deleted group with this name was revived. Existing item permissions <strong>may</strong> apply to this group and any future members. If this is not what you intended, please create another group with a different name.') . EOL); } return true; @@ -107,7 +108,7 @@ function group_rmv($uid,$name) { ); // remove group - $r = q("UPDATE `groups` SET `deleted` = 1 WHERE `uid` = %d AND `name` = '%s' LIMIT 1", + $r = q("UPDATE `groups` SET `deleted` = 1 WHERE `uid` = %d AND `name` = '%s'", intval($uid), dbesc($name) ); @@ -152,7 +153,7 @@ function group_rmv_member($uid,$name,$member) { return false; if(! ( $uid && $gid && $member)) return false; - $r = q("DELETE FROM `group_member` WHERE `uid` = %d AND `gid` = %d AND xchan = '%s' LIMIT 1 ", + $r = q("DELETE FROM `group_member` WHERE `uid` = %d AND `gid` = %d AND xchan = '%s' ", intval($uid), intval($gid), dbesc($member) @@ -199,7 +200,7 @@ function group_get_members($gid) { if(intval($gid)) { $r = q("SELECT * FROM `group_member` LEFT JOIN abook ON abook_xchan = `group_member`.`xchan` left join xchan on xchan_hash = abook_xchan - WHERE `gid` = %d AND abook_channel = %d and `group_member`.`uid` = %d and not ( xchan_flags & %d ) and not ( abook_flags & %d ) and not ( abook_flags & %d ) ORDER BY xchan_name ASC ", + WHERE `gid` = %d AND abook_channel = %d and `group_member`.`uid` = %d and not ( xchan_flags & %d )>0 and not ( abook_flags & %d )>0 and not ( abook_flags & %d )>0 ORDER BY xchan_name ASC ", intval($gid), intval(local_user()), intval(local_user()), |