Файл: vsime.com/system/functions/user_access.php
Строк: 12
<?
    function user_access($access, $u_id=null, $exit=false)
    {
        global $dbi;
        if ($u_id == null)global $user;
        else $user = profile($u_id);
        if (!isset($user['group_access']) || $user['group_access'] == null)
        {
            if ($exit !== false){
                header("Location: $exit");
                exit;
            }
            else return false;
        }
        if ($exit!==false)
        {
            if (mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `user_group_access` WHERE `id_group` = '$user[group_access]' AND `id_access` = '$access'"))==0)
            {
                header("Location: $exit");exit;
            }
        }
        else return (mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `user_group_access` WHERE `id_group` = '$user[group_access]' AND `id_access` = '$access'"))==1?true:false);
    }
?>