2010-07-01 23:48:07 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
function can_write_wall(&$a,$owner) {
|
|
|
|
if((! (local_user())) && (! (remote_user())))
|
|
|
|
return false;
|
|
|
|
if((local_user()) && ($_SESSION['uid'] == $owner))
|
|
|
|
return true;
|
|
|
|
|
2010-08-19 11:59:31 +00:00
|
|
|
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `id` = %d AND `blocked` = 0 AND `pending` = 0
|
|
|
|
AND `readonly` = 0 AND `rel` IN ( %d , %d ) LIMIT 1",
|
2010-07-01 23:48:07 +00:00
|
|
|
intval($owner),
|
2010-08-19 11:59:31 +00:00
|
|
|
intval($_SESSION['visitor_id']),
|
2010-09-22 02:51:08 +00:00
|
|
|
intval(REL_VIP),
|
|
|
|
intval(REL_BUD)
|
2010-07-01 23:48:07 +00:00
|
|
|
);
|
|
|
|
if(count($r))
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|