Пример #1
0
function popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $ID = $_GET["ID"];
    $title = "{new_page}";
    $buttonname = "{add}";
    if ($ID > 0) {
        $q = new mysql_squid_builder();
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM reverse_pages_content WHERE ID='{$ID}'"));
        $title = $ligne["subject"];
        $buttonname = "{apply}";
    }
    if ($ligne["content"] == null) {
        $ligne["content"] = "<html>\n<head>\n<title>It's works</title>\n</head>\n<body>\n\t<H1>It works!</H1>\n</body>\n</html>";
    }
    $boot = new boostrap_form();
    $boot->set_hidden("ID", $ID);
    $boot->set_formtitle($title);
    if (!is_numeric($ligne["cachemin"])) {
        $ligne["cachemin"] = 5;
    }
    $boot->set_list("cachemin", "{cache}", $ligne["cachemin"], $q->CACHE_AGES);
    $boot->set_field("subject", "{subject}", $ligne["subject"]);
    $boot->set_textarea("content", "{content}", $ligne["content"], array("ENCODE" => true, "HEIGHT" => 350));
    $boot->set_button($buttonname);
    $boot->set_RefreshSearchs();
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin6");
    }
    echo $boot->Compile();
}
function item_popup()
{
    $ID = $_GET["ID"];
    $q = new mysql_squid_builder();
    $title = "{new_group}";
    $bt = "{add}";
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_exploits_groups WHERE ID='{$_GET["groupid"]}'"));
    $groupname = $ligne["groupname"];
    $ligne["enabled"] = 1;
    if ($ID > 0) {
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_exploits_items WHERE ID='{$ID}'"));
        $bt = "{apply}";
        $title = "{$groupname}::{{$ligne["token"]}}";
    }
    $array["http_user_agent"] = "{http_user_agent}";
    $array["query_string"] = "{query_string}";
    $boot = new boostrap_form();
    $boot->set_hidden("edititem", $ID);
    $boot->set_hidden("groupid", $_GET["groupid"]);
    $boot->set_formtitle($title);
    $boot->set_list("token", "{token}", $array, $ligne["token"]);
    $boot->set_textarea("pattern", "{pattern}", $ligne["pattern"], array("ENCODE" => true));
    $boot->set_checkbox("reverse", "{reverse}", $ligne["reverse"]);
    $boot->set_checkbox("enabled", "{enabled}", $ligne["enabled"]);
    $boot->set_button($bt);
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin6");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Пример #3
0
function websites_popup_webserver_replace_popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $servername = $_GET["servername"];
    $q = new mysql_squid_builder();
    $title = "{new_rule}";
    $bt = "{add}";
    $ID = $_GET["replaceid"];
    $boot = new boostrap_form();
    $sock = new sockets();
    $servername = $_GET["servername"];
    if ($ID > 0) {
        $q = new mysql_squid_builder();
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_replace_www WHERE ID='{$ID}'"));
        $bt = "{apply}";
        $title = "{$ligne["rulename"]}";
        $ligne["stringtosearch"] = stripslashes($ligne["stringtosearch"]);
        $ligne["replaceby"] = stripslashes($ligne["replaceby"]);
        $servername = $ligne["servername"];
    }
    if ($ligne["tokens"] == null) {
        $ligne["tokens"] = "g";
    }
    if ($ligne["rulename"] == null) {
        $ligne["rulename"] = time();
    }
    $boot->set_hidden("replaceid", $ID);
    $boot->set_hidden("servername", $servername);
    $boot->set_formtitle($title);
    $boot->set_field("rulename", "{name}", $ligne["rulename"]);
    $boot->set_field("zorder", "{order}", $ligne["zorder"]);
    $boot->set_spacertitle("{search}");
    $boot->set_textarea("stringtosearch", "{search}", $ligne["stringtosearch"], array("MANDATORY" => true, "ENCODE" => true));
    $boot->set_checkbox("AsRegex", "{regex}", $ligne["AsRegex"], array("TOOLTIP" => "{replace_regex_explain}"));
    $boot->set_spacertitle("{replace}");
    $boot->set_textarea("replaceby", "{replace}", $ligne["replaceby"], array("MANDATORY" => true, "ENCODE" => true));
    $boot->set_field("tokens", "{flags}", $ligne["tokens"], array("MANDATORY" => true));
    $boot->set_button($bt);
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin3");
    }
    $boot->set_RefreshSearchs();
    $boot->set_formdescription("{nginx_subst_explain}");
    echo $boot->Compile();
}
function charter_settings()
{
    $ID = $_GET["ID"];
    $users = new usersMenus();
    $page = CurrentPageName();
    $sock = new sockets();
    $boot = new boostrap_form();
    $users = new usersMenus();
    $title = "Acceptable Use Policy";
    $btname = "{add}";
    if ($ID > 0) {
        $q = new mysql_squid_builder();
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT TextIntro,TextButton,title FROM itcharters WHERE ID='{$ID}'"));
        if (!$q->ok) {
            echo "<p class=text-error>{$q->mysql_error}</p>";
        }
        $title = $ligne["title"];
        $btname = "{apply}";
    }
    if ($ligne["TextIntro"] == null) {
        $ligne["TextIntro"] = "<p style='font-size:18px'>Please read the IT chart before accessing trough Internet</p>";
    }
    if ($ligne["TextButton"] == null) {
        $ligne["TextButton"] = "I accept the terms and conditions of this agreement";
    }
    $boot->set_formtitle($title);
    $boot->set_hidden("ID", $ID);
    $boot->set_field("title", "{page_title}", $title);
    $boot->set_textarea("TextIntro", "{introduction_text}", $ligne["TextIntro"], array("ENCODE" => true));
    $boot->set_field("TextButton", "{text_button}", $ligne["TextButton"], array("ENCODE" => true));
    if (!$users->AsDansGuardianAdministrator) {
        $boot->set_form_locked();
    }
    $boot->set_button($btname);
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin2");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function replace_popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $servername = $_GET["servername"];
    $q = new mysql_squid_builder();
    $title = "{new_rule}";
    $bt = "{add}";
    $ID = $_GET["ID"];
    $boot = new boostrap_form();
    $sock = new sockets();
    $groupid = $_GET["groupid"];
    if ($ID > 0) {
        $q = new mysql_squid_builder();
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_replace WHERE ID='{$ID}'"));
        $bt = "{apply}";
        $title = "{$ligne["rulename"]}";
        $ligne["stringtosearch"] = stripslashes($ligne["stringtosearch"]);
        $ligne["replaceby"] = stripslashes($ligne["replaceby"]);
        $groupid = $ligne["groupid"];
    } else {
        $boot->set_hidden("groupid", $groupid);
    }
    if ($ligne["rulename"] == null) {
        $ligne["rulename"] = time();
    }
    $boot->set_hidden("ID", $ID);
    $boot->set_formtitle($title);
    $boot->set_field("rulename", "{name}", $ligne["rulename"]);
    $boot->set_textarea("stringtosearch", "{search}", $ligne["stringtosearch"], array("MANDATORY" => true, "ENCODE" => true));
    $boot->set_textarea("replaceby", "{replace}", $ligne["replaceby"], array("MANDATORY" => true, "ENCODE" => true));
    $boot->set_button($bt);
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin2");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function add_www_import()
{
    $boot = new boostrap_form();
    $boot->set_formdescription("{free_catgorized_explain}");
    $boot->set_hidden("category", $_GET["category"]);
    $boot->set_checkbox("ForceCat", "{force}", 0, array("TOOLTIP" => "{free_cat_force_explain}"));
    $boot->set_textarea("categorize", "{items}", null, array("HEIGHT" => 250));
    $boot->set_button("{add}");
    $boot->set_RefreshSearchs();
    $boot->set_RefreshSearchsForced();
    echo $boot->Compile();
}
function rules_params()
{
    $boot = new boostrap_form();
    $sock = new sockets();
    $users = new usersMenus();
    $ldap = new clladp();
    $ID = $_GET["rules-params"];
    $title_button = "{add}";
    $title = "{new_authenticator_rule}";
    if ($ID > 0) {
        $sql = "SELECT * FROM authenticator_rules WHERE ID='{$ID}'";
        $q = new mysql_squid_builder();
        $ligne = @mysql_fetch_array($q->QUERY_SQL($sql));
        $title_button = "{apply}";
        $title = $ligne["rulename"];
    }
    $boot->set_formtitle($title);
    $boot->set_hidden("ruleid", $ID);
    $boot->set_field("rulename", "{rulename}", $ligne["rulename"], array("ENCODE" => true));
    $boot->set_field("cachetime", "{cachetime} ({minutes})", $ligne["cachetime"], array("TOOLTIP" => "{authenticator_cache_time_explain}"));
    $boot->set_textarea("explain", "{explain}", $ligne["explain"], array("ENCODE" => true));
    $boot->set_button($title_button);
    $AdminPrivs = AdminPrivs();
    if (!$AdminPrivs) {
        $boot->set_form_locked();
    }
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin2");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function tasks_popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $tasks = new system_tasks();
    $PatternToHuman = null;
    $boot = new boostrap_form();
    $q = new mysql();
    $no_schedule_set = $tpl->javascript_parse_text("{no_schedule_set}");
    $buttontext = "{add}";
    $ID = $_GET["ID"];
    $t = $_GET["t"];
    $title = "{new_schedule}";
    $task_type = $tasks->tasks_array;
    if ($ID > 0) {
        $buttontext = "{apply}";
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM system_schedules WHERE ID={$ID}", "artica_backup"));
        $ligne["TimeDescription"] = utf8_encode($ligne["TimeDescription"]);
        $title = $task_type[$ligne["TaskType"]];
        $PatternToHuman = "<br>" . $tasks->PatternToHuman($ligne["TimeText"], true);
    }
    if (!is_numeric($ligne["TaskType"])) {
        $ligne["TaskType"] = 0;
    }
    if (!is_numeric($ID)) {
        $ID = 0;
    }
    if (!$users->KAV4PROXY_INSTALLED) {
        unset($task_type[5]);
        unset($task_type[12]);
    }
    if (!$users->UPDATE_UTILITYV2_INSTALLED) {
        unset($task_type[13]);
    }
    $task_type = $tasks->tasks_array;
    while (list($TaskType, $content) = each($task_type)) {
        $taskz[$TaskType] = "[{$TaskType}] " . $tpl->_ENGINE_parse_body($content);
    }
    $YahooWinHide = "YahooWin{$_GET["YahooWin"]}";
    $boot->set_formtitle($title);
    $boot->set_hidden("ID", $ID);
    if ($ID == 0) {
        if ($_GET["task-section"] > 0) {
            $boot->set_hidden("TaskType", $_GET["task-section"]);
            $boot->set_formdescription($tasks->tasks_explain_array[$_GET["task-section"]] . $PatternToHuman);
            $ligne["TimeDescription"] = $tpl->javascript_parse_text($tasks->tasks_array[$_GET["task-section"]]);
        } else {
            $boot->set_list("TaskType", "{type}", $taskz, null);
        }
        $ligne["enabled"] = 1;
    } else {
        $boot->set_hidden("TaskType", $ligne["TaskType"]);
        $boot->set_formdescription($tasks->tasks_explain_array[$ligne["TaskType"]]);
    }
    $boot->set_checkbox("enabled", "{enabled}", $ligne["enabled"]);
    $boot->set_textarea("TimeDescription", "{description}", $ligne["TimeDescription"], array("ENCODE" => true));
    $boot->set_field("TimeText", "{schedule}", $ligne["TimeText"], array("SCHEDULE" => true, "MANDATORY" => true, "DISABLED" => true));
    if ($ID == 0) {
        $boot->set_CloseYahoo($YahooWinHide);
    }
    //
    $boot->set_button($buttontext);
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function category_settings()
{
    $q = new mysql_squid_builder();
    $dans = new dansguardian_rules();
    $lock = false;
    if ($_GET["cat"] != null) {
        $lock = true;
        $sql = "SELECT category_description,master_category FROM personal_categories WHERE category='{$_GET["cat"]}'";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
    }
    $groups = $dans->LoadBlackListesGroups();
    $groups[null] = "{select}";
    $boot = new boostrap_form();
    if (!$lock) {
        $boot->set_field("category-to-add", "{category}", null, array("ENCODE" => true));
        $boot->set_button("{add}");
        $boot->set_CloseYahoo("YahooWin5");
    } else {
        $boot->set_formtitle("{$_GET["cat"]}");
        $boot->set_hidden("category-to-add", $_GET["cat"]);
        $boot->set_button("{apply}");
    }
    $boot->set_textarea("category_text", "{description}", $ligne["category_description"], array("ENCODE" => true));
    $boot->set_list("group", "{group}", $groups, $ligne["master_category"]);
    $boot->set_field("CatzByGroupA", "{group} ({add})", null);
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Пример #10
0
function parent_import_popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $boot = new boostrap_form();
    $array_type["parent"] = "parent";
    $array_type["sibling"] = "sibling";
    $array_type["multicast"] = "multicast";
    $btname = "{import}";
    $boot->set_formtitle("{import}");
    $boot->set_formdescription("{parents_squid_import_explain}");
    $boot->set_hidden("import-perform", "yes");
    $boot->set_textarea("import-text", "{parents}", null);
    $boot->set_list("server_type", "{server_type}", $array_type, "parent", array("TOOLTIP" => "{squid_parent_sibling_how_to}"));
    $boot->set_field("options", "{options}", "proxy-only,no-query,round-robin,connect-timeout=7,connect-fail-limit=3,weight=%i");
    $boot->set_checkbox("delete_all", "{delete_all}", 0);
    $boot->set_button($btname);
    $boot->set_RefreshSearchs();
    $boot->set_CloseYahoo("YahooWin5");
    echo $boot->Compile();
}
Пример #11
0
function rule_id()
{
    $ID = $_GET["pattern-id"];
    $q = new mysql_squid_builder();
    $boot = new boostrap_form();
    if ($ID == 0) {
        $title = "{new_rule}";
        $btname = "{add}";
        $boot->set_CloseYahoo("YahooWin");
    } else {
        $sql = "SELECT * FROM haarp_redirpats WHERE ID='{$ID}'";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        if (!$q->ok) {
            $error = "<p class='text-error'>{$q->mysql_error}.</p>";
        }
        $title = "{rule}::{$ID}";
        $btname = "{apply}";
    }
    $boot->set_formtitle($title);
    $boot->set_formdescription("{haarp_rule_explain}");
    $boot->set_hidden("pattern-id", $ID);
    $boot->set_textarea("pattern", "{pattern}", $ligne["pattern"]);
    $boot->set_button($btname);
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}