aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-04-13 19:57:47 -0700
committerfriendica <info@friendica.com>2014-04-13 19:57:47 -0700
commitbc041bdb77036eba31468278d0a0796c1e354379 (patch)
treed9d8fcf25c2f7381517dfb4653b9c9c1e2e82a28
parent769b0f6bc9ca66a0996c2d402359e5f463e25333 (diff)
downloadvolse-hubzilla-bc041bdb77036eba31468278d0a0796c1e354379.tar.gz
volse-hubzilla-bc041bdb77036eba31468278d0a0796c1e354379.tar.bz2
volse-hubzilla-bc041bdb77036eba31468278d0a0796c1e354379.zip
profperm: abook_profile was being handled by profile id rather than profile_guid, causing private profiles to not be activated in many cases.
-rw-r--r--mod/profperm.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/mod/profperm.php b/mod/profperm.php
index 08838831b..915f2a994 100644
--- a/mod/profperm.php
+++ b/mod/profperm.php
@@ -61,9 +61,9 @@ function profperm_content(&$a) {
$profile = $r[0];
- $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d AND abook_profile = %d",
+ $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d AND abook_profile = '%s'",
intval(local_user()),
- intval(argv(1))
+ dbesc($profile['profile_guid'])
);
$ingroup = array();
@@ -75,23 +75,23 @@ function profperm_content(&$a) {
if($change) {
if(in_array($change,$ingroup)) {
- q("UPDATE abook SET abook_profile = 0 WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
+ q("UPDATE abook SET abook_profile = '' WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
intval($change),
intval(local_user())
);
}
else {
- q("UPDATE abook SET abook_profile = %d WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
- intval(argv(1)),
+ q("UPDATE abook SET abook_profile = '%s' WHERE abook_id = %d AND abook_channel = %d LIMIT 1",
+ dbesc($profile['profile_guid']),
intval($change),
intval(local_user())
);
}
- $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d AND abook_profile = %d",
+ $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d AND abook_profile = '%s'",
intval(local_user()),
- intval(argv(1))
+ dbesc($profile['profile_guid'])
);
$members = $r;