friendica_2021-01/include/security.php

21 lines
601 B
PHP
Raw Normal View History

2010-07-02 01:48:07 +02:00
<?php
function can_write_wall(&$a,$owner) {
if((! (local_user())) && (! (remote_user())))
return false;
if((local_user()) && ($_SESSION['uid'] == $owner))
return true;
$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-02 01:48:07 +02:00
intval($owner),
intval($_SESSION['visitor_id']),
intval(DIRECTION_OUT),
intval(DIRECTION_BOTH)
2010-07-02 01:48:07 +02:00
);
if(count($r))
return true;
return false;
}