aboutsummaryrefslogblamecommitdiffstats
path: root/include/security.php
blob: a71391dbaca30cc20cc44657d40b5199afeaa4ab (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                          
                                                                                                                    







                                               
<?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 LIMIT 1",
                intval($owner),
                intval($_SESSION['visitor_id'])
        );
        if(count($r))
                return true;
        return false;

}