View file plugins/rules/delete.php

File size: 1Kb
<?


include_once '../../sys/inc/start.php';


include_once COMPRESS;


include_once SESS;


include_once '../../sys/inc/home.php';


include_once SETTINGS;


include_once DB_CONNECT;


include_once IPUA;


include_once FNC;


include_once USER;





if (isset ($user) && $user['level'] < 3)


header("Location: /");





if (isset($_GET['del']) && dbresult(dbquery("SELECT COUNT(*) FROM `rules_p` WHERE `id` = '".intval($_GET['del'])."'"),0)==1)


{


	$post=dbassoc(dbquery("SELECT * FROM `rules_p` WHERE `id` = '".intval($_GET['del'])."' LIMIT 1"));


	$ank=dbassoc(dbquery("SELECT * FROM `user` WHERE `id` = $post[id_user] LIMIT 1"));





	if (isset($user) && ($user['level']>$ank['level']))


	dbquery("DELETE FROM `rules_p` WHERE `id` = '$post[id]'");


}





if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER']!=NULL)


header("Location: ".$_SERVER['HTTP_REFERER']);


else


header("Location: post.php?".SID);





?>