aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-05-02 21:00:39 -0700
committerfriendica <info@friendica.com>2012-05-02 21:00:39 -0700
commite7580b71e1825dc6e049d7c1f945ab701bf8f6cd (patch)
tree5b90774d406f0aecd7564b5bfff0c8c15d4f0f84
parent079d954765401175313961e247f191dd67421a31 (diff)
downloadvolse-hubzilla-e7580b71e1825dc6e049d7c1f945ab701bf8f6cd.tar.gz
volse-hubzilla-e7580b71e1825dc6e049d7c1f945ab701bf8f6cd.tar.bz2
volse-hubzilla-e7580b71e1825dc6e049d7c1f945ab701bf8f6cd.zip
use cid rather than uid in perms
-rw-r--r--mod/events.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/mod/events.php b/mod/events.php
index 1f11e7503..069046ff9 100644
--- a/mod/events.php
+++ b/mod/events.php
@@ -68,6 +68,15 @@ function events_post(&$a) {
$share = ((intval($_POST['share'])) ? intval($_POST['share']) : 0);
+ $c = q("select id from contact where uid = %d and self = 1 limit 1",
+ intval(local_user())
+ );
+ if(count($c))
+ $self = $c[0]['id'];
+ else
+ $self = 0;
+
+
if($share) {
$str_group_allow = perms2str($_POST['group_allow']);
$str_contact_allow = perms2str($_POST['contact_allow']);
@@ -75,9 +84,9 @@ function events_post(&$a) {
$str_contact_deny = perms2str($_POST['contact_deny']);
// Undo the pseudo-contact of self, since there are real contacts now
- if( strpos($str_contact_allow, '<' . local_user() . '>') !== false )
+ if( strpos($str_contact_allow, '<' . $self . '>') !== false )
{
- $str_contact_allow = str_replace('<' . local_user() . '>', '', $str_contact_allow);
+ $str_contact_allow = str_replace('<' . $self . '>', '', $str_contact_allow);
}
// Make sure to set the `private` field as true. This is necessary to
// have the posts show up correctly in Diaspora if an event is created
@@ -90,7 +99,7 @@ function events_post(&$a) {
else {
// Note: do not set `private` field for self-only events. It will
// keep even you from seeing them!
- $str_contact_allow = '<' . local_user() . '>';
+ $str_contact_allow = '<' . $self . '>';
$str_group_allow = $str_contact_deny = $str_group_deny = '';
}