$skont = query("SELECT * FROM admin_pages WHERE link = '$getsayf' AND active = '1'");
$homePage = "pages/home.php";
$pageUrl = "pages/".$getsayf.".php";
$PermsInSession = $_SESSION['yetki'];
if( mysql_affected_rows() )
{
$data = fetch($skont);
if ( !file_exists($pageUrl) )
{
require $homePage;
}else{
if ( $data->perms !== 0 ) // !== olmasinin nedeni gelen nesnenin tipinide kontrol etmesi gerekmekte.
{
$permissions = explode( "|", $data->perms );
if ( is_array($permissions) )
{
$perms = array_search($PermsInSession, $permissions);
if ( isset($perms) && $perms === true )
require $pageUrl;
}
} else {
require $pageUrl;
}
}
}else{
yonlendir("index.php?error=12ffl44");
}