]> git.mxchange.org Git - friendica.git/blob - include/security.php
return code is no longer a string
[friendica.git] / include / security.php
1 <?php
2
3 function can_write_wall(&$a,$owner) {
4
5         if((! (local_user())) && (! (remote_user())))
6                 return false;
7                 $uid = local_user();
8
9         if(($uid) && ($uid == $owner)) {
10                 return true;
11                 }
12
13                 if(remote_user()) {
14                         $r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` LEFT JOIN `user` on `user`.`uid` = `contact`.`uid` 
15                                 WHERE `contact`.`uid` = %d AND `contact`.`id` = %d AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 
16                                 AND `readonly` = 0  AND ( `contact`.`rel` IN ( %d , %d ) OR `user`.`page-flags` = %d ) LIMIT 1",
17                                 intval($owner),
18                                 intval(remote_user()),
19                                 intval(REL_VIP),
20                                 intval(REL_BUD),
21                                 intval(PAGE_COMMUNITY)
22                         );
23                 }
24                 if(count($r))
25                         return true;
26
27                 
28         return false;
29
30 }