]> git.mxchange.org Git - friendica.git/commitdiff
funny behaviour with post permissions after recent changes
authorMike Macgirvin <mike@macgirvin.com>
Mon, 18 Oct 2010 03:24:58 +0000 (20:24 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Mon, 18 Oct 2010 03:24:58 +0000 (20:24 -0700)
boot.php
include/security.php

index eb3d1b06e3d898a9e424b27c324937b786153ecc..3bc8d2983da619baf071aaf94ba1ef8e5e0a9ebf 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1027,7 +1027,7 @@ function photo_new_resource() {
 
 if(! function_exists('get_uid')) {
 function get_uid() {
-       return ((x($_SESSION,'uid')) ? intval($_SESSION['uid']) : 0) ;
+       return local_user();
 }}
 
 // Take a URL from the wild, prepend http:// if necessary
index ae161b4a4330eae458cd8f8e2f1aeee0cd0387d8..1e0107dcca50041bd4df49adbd546c3135ac55c6 100644 (file)
@@ -1,11 +1,14 @@
 <?php
 
 function can_write_wall(&$a,$owner) {
+
         if((! (local_user())) && (! (remote_user())))
                 return false;
                $uid = get_uid();
-        if(($uid) && ($uid === $owner))
+
+        if(($uid) && ($uid === $owner)) {
                 return true;
+               }
 
         $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` LEFT JOIN `user` on `user`.`uid` = `contact`.`uid` 
                        WHERE `contact`.`uid` = %d AND `contact`.`id` = %d AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 
@@ -16,6 +19,7 @@ function can_write_wall(&$a,$owner) {
                        intval(REL_BUD),
                        intval(PAGE_COMMUNITY)
         );
+
         if(count($r))
                 return true;
         return false;