function main_rules_exceptionsitelist_add()
{
    $rule_main = $_GET["rule_main"];
    $www = $_GET["exceptionsitelist_add"];
    $dans = new dansguardian_rules($_GET["hostname"], $rule_main);
    $dans->Add_exceptionsitelist($rule_main, $www);
}
function checkprivs()
{
    $_POST["userid"] = trim($_POST["userid"]);
    include "ressources/settings.inc";
    $socks = new sockets();
    if (strtolower($_POST["userid"]) == strtolower($_GLOBAL["ldap_admin"])) {
        if ($_POST["password"] != $_GLOBAL["ldap_password"]) {
            die("bad password");
        }
        $dans = new dansguardian_rules(null, 1);
        $dans->Add_exceptionsitelist(1, $_POST["uri"]);
        AddEvents("Manager", $_POST["uri"]);
        $sock = new sockets();
        $sock->getFrameWork("reload-dansguardian");
        die("SUCCESS");
    }
    $ldap = new clladp();
    writelogs('This is not Global admin, so test user...', __FUNCTION__, __FILE__);
    $hash = $ldap->UserDatas($_POST["userid"]);
    $userPassword = $hash["userPassword"];
    if (trim($hash["uid"]) == null) {
        writelogs('Unable to get user infos abort', __FUNCTION__, __FILE__);
        die("Unknown user");
    }
    if (trim($_POST["password"]) == trim($userPassword)) {
        $users = new usersMenus($ldap->_Get_privileges_userid($_POST["userid"]));
        $priv_array = $users->_ParsePrivieleges($ldap->_Get_privileges_userid($_POST["userid"]));
        $users->_TranslateRights($priv_array);
        if ($users->AllowDansGuardianBanned) {
            $dans = new dansguardian_rules(null, 1);
            $dans->Add_exceptionsitelist(1, $_POST["uri"]);
            $sock = new sockets();
            AddEvents($_POST["userid"], $_POST["uri"]);
            $sock->getFrameWork("cmd.php?reload-dansguardian");
            die("SUCCESS");
        }
    } else {
        die("BAD PASSWORD");
    }
    die("No privileges");
}