function bridge_popup()
{
    $boot = new boostrap_form();
    $sock = new sockets();
    $users = new usersMenus();
    $ldap = new clladp();
    $ID = $_GET["ID"];
    $title_button = "{add}";
    $nics = unserialize(base64_decode($sock->getFrameWork("cmd.php?list-nics=yes")));
    $IP = new networking();
    while (list($key, $value) = each($nics)) {
        $array = $IP->GetNicInfos($value);
        $NICZ[$value] = $value . " [{$array["IPADDR"]}]";
    }
    $boot->set_list("nic_inbound", "{from}", $NICZ, null);
    $boot->set_list("nic_linked", "{to}", $NICZ, null);
    $boot->set_hidden("ID", $_GET["ID"]);
    if (!$users->AsSystemAdministrator) {
        $boot->set_form_locked();
    }
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin2");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function policy_domain()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $q = new amavisdb();
    $boot = new boostrap_form();
    $email = $_GET["policy-domain"];
    $sql = "SELECT id,policy_name FROM policy WHERE ou='{$_SESSION["ou"]}' ORDER BY policy_name";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "<p class=text-error>{$q->mysql_error}<br>{$sql}<hr></p>";
    }
    $policies[0] = "{default}";
    while ($ligne = mysql_fetch_assoc($results)) {
        $policies[$ligne["id"]] = $ligne["policy_name"];
    }
    $email_id = $q->emailid_from_email("@{$email}");
    $policy_id = $q->policyid_from_mail("@{$email}");
    $boot->set_hidden("policy_domain", $email);
    $boot->set_hidden("email_id", $email_id);
    $boot->set_list("policy_id", "{policy}", $policies, $policy_id);
    $boot->set_button("{apply}");
    $boot->set_CallBack("YahooWin2Hide");
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function etchosts_popup()
{
    $boot = new boostrap_form();
    $sock = new sockets();
    $users = new usersMenus();
    $ldap = new clladp();
    $ID = $_GET["ID"];
    $title_button = "{add_new_entry}";
    $boot->set_field("hostname", "{hostname}", $ligne["name"]);
    $boot->set_field("ipaddr", "{tcp_address}", $ligne["ipaddr"], array("IPV4" => true));
    $boot->set_field("alias", "{alias}", null);
    if (!$users->AsSystemAdministrator) {
        $boot->set_form_locked();
    }
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin2");
    }
    $boot->set_button("{add}");
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function remotedomain_add()
{
    $ldap = new clladp();
    $ou = $_SESSION["ou"];
    $btname = "{add}";
    $domain = $_GET["domain"];
    if ($domain != null) {
        $btname = "{apply}";
    }
    if ($ou == null) {
        $ou = $ldap->ou_by_smtp_domain($domain);
    }
    $HashDomains = $ldap->Hash_relay_domains();
    $tools = new DomainsTools();
    $arr = $tools->transport_maps_explode($HashDomains[$domain]);
    $dn = "cn=@{$domain},cn=relay_recipient_maps,ou={$ou},dc=organizations,{$ldap->suffix}";
    $trusted_smtp_domain = 0;
    if ($ldap->ExistsDN($dn)) {
        $trusted_smtp_domain = 1;
    }
    if (!is_numeric($arr[2])) {
        $arr[2] = 25;
    }
    if ($arr[3] == null) {
        $arr[3] = 0;
    } else {
        if ($arr[3] == "no") {
            $arr[3] = 0;
        } else {
            $arr[3] = 1;
        }
    }
    $boot = new boostrap_form();
    $ldap = new clladp();
    if ($domain != null) {
        $boot->set_field("remotedomain", "{domain}", $domain, array("MANDATORY" => true, "DISABLED" => true));
    } else {
        $boot->set_field("remotedomain", "{domain}", $domain, array("MANDATORY" => true));
    }
    $users = new usersMenus();
    if ($users->AsPostfixAdministrator) {
        $ous = $ldap->hash_get_ou(true);
        $boot->set_list("ou", "{ou}", $ous, $ou);
    } else {
        $boot->set_hidden("ou", $ou);
    }
    $boot->set_field("destination", "{destination}", $arr[1], null, array("MANDATORY" => true));
    $boot->set_field("destination_port", "{port}", $arr[2], null, array("MANDATORY" => true));
    $boot->set_checkbox("MX", "{MX_lookups}", $arr[3], array('TOOLTIP' => "{mx_look}"));
    $boot->set_checkbox("trusted_smtp_domain", "{trusted_smtp_domain}", $trusted_smtp_domain, array('TOOLTIP' => "{trusted_smtp_domain_text}"));
    $boot->set_button($btname);
    $boot->set_RefreshSearchs();
    $boot->set_CloseYahoo("YahooWin");
    echo $boot->Compile();
}
Ejemplo n.º 5
0
function replace_group_popup()
{
    $ID = $_GET["ID"];
    $q = new mysql_squid_builder();
    $title = "{new_group}";
    $bt = "{add}";
    $boot = new boostrap_form();
    $sock = new sockets();
    if ($ID > 0) {
        $q = new mysql_squid_builder();
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_replace_group WHERE ID='{$ID}'"));
        $bt = "{apply}";
        $title = "{$ligne["groupname"]}";
    }
    if ($ligne["groupname"] == null) {
        $ligne["groupname"] = "New Group";
    }
    $boot->set_hidden("editgroupid", $ID);
    $boot->set_formtitle($title);
    $boot->set_field("groupname", "{groupname}", $ligne["groupname"]);
    $boot->set_button($bt);
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function failover()
{
    //this_feature_is_disabled_corp_license
    $users = new usersMenus();
    $boot = new boostrap_form();
    $tpl = new templates();
    $t = time();
    $page = CurrentPageName();
    $sock = new sockets();
    $eth = $_GET["nic"];
    $nic = new system_nic($eth);
    for ($i = 1; $i < 256; $i++) {
        $ucarp_vids[$i] = $i;
    }
    $boot->set_hidden("save_nic", $eth);
    $array = unserialize(base64_decode($sock->getFrameWork("system.php?ucarp-status={$eth}")));
    if (!isset($array["PID"])) {
        $boot->set_formdescription("{status}:{stopped}");
        $boot->set_Newbutton("{start}", "Start{$t}()");
    } else {
        $boot->set_Newbutton("{stop}", "Stop{$t}()");
        $boot->set_formdescription("{status}:{running} PID:{$array["PID"]} {since} {$array["TIME"]}Mn");
    }
    $XHR = array();
    $XHR["start-vip"] = "yes";
    $boot->set_AddScript("Start{$t}", array("XHR" => $XHR));
    $XHR = array();
    $XHR["stop-vip"] = "yes";
    $boot->set_AddScript("Stop{$t}", array("XHR" => $XHR));
    $boot->set_checkbox("ucarp_enabled", "{enabled}", $nic->ucarp_enabled, array("DISABLEALL" => true));
    $boot->set_checkbox("ucarp_master", "{isamaster}", $nic->ucarp_master, array("TOOLTIP" => "{ucarp_master_explain}"));
    $boot->set_list("ucarp_vid", "{ucarp-vid}", $ucarp_vids, $nic->ucarp_vid);
    $boot->set_field("ucarp_vip", "{ucarp-vip}", $nic->ucarp_vip, array("MANDATORY" => true, "IPV4" => true, "TOOLTIP" => "{ucarp_vip_explain}"));
    $boot->set_list("ucarp_advskew", "{ucarp-advskew}", $ucarp_vids, $nic->ucarp_advskew);
    $boot->set_field("ucarp_advbase", "{interval} ({seconds})", $nic->ucarp_advbase, array("MANDATORY" => true));
    $boot->set_button("{apply}");
    $boot->set_RefreshSearchs();
    if (!$users->AsSystemAdministrator) {
        $boot->set_form_locked();
    }
    if (!$users->CORP_LICENSE) {
        $error = "<p class=text-error>{this_feature_is_disabled_corp_license}</p>";
        $boot->set_form_locked();
    }
    $form = $boot->Compile();
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($error . $form);
}
Ejemplo n.º 7
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 NewipaddrLink_popup()
{
    $tpl = new templates();
    $_GET["ipaddr"] = trim($_GET["ipaddr"]);
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM webfilters_ipaddr WHERE ipaddr='{$_GET["ipaddr"]}'"));
    $boot = new boostrap_form();
    if ($_GET["ipaddr"] == null) {
        $boot->set_field("ipaddr", "{ipaddr}", null, array("MANDATORY" => true, "IPV4" => true));
    } else {
        $boot->set_formtitle("{ipaddr}:{$_GET["ipaddr"]}");
        $boot->set_hidden("ipaddr", $_GET["ipaddr"]);
        $ips = array();
        $linkstats = "<div style='width:100%'>\n\t\t\t\t<a href=\"javascript:blur();\" \n\t\t\t\tOnClick=\"javascript:miniadm.squid.ipaddrbrowser.php?visits-day-js={$_GET["ipaddr"]}');>{statistics}</a></div>";
    }
    $linkstats = null;
    $boot->set_hidden("save-ipaddr", 'yes');
    $boot->set_field("uid", "{member}", $ligne["uid"], array("MANDATORY" => true));
    $boot->set_field("hostname", "{hostname}", $ligne["hostname"]);
    $boot->set_button("{add}");
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function search_database_popup()
{
    $boot = new boostrap_form();
    $q = new mysql_storelogs();
    if (!isset($_SESSION["QUERY_SYSLOG_HOST_DAY_FIELDY"])) {
        $sql = "SELECT DATE_FORMAT(filetime,'%Y-%m-%d') as filetime FROM files_info GROUP BY filetime ORDER BY filetime DESC";
        $results = $q->QUERY_SQL($sql);
        $dayz[null] = "{select}";
        while ($ligne = mysql_fetch_assoc($results)) {
            $time = time_to_date(strtotime($ligne["filetime"] . " 00:00:00"));
            $dayz[$ligne["filetime"]] = $time;
        }
        $_SESSION["QUERY_SYSLOG_HOST_DAY_FIELDY"] = serialize($dayz);
    }
    if (!isset($_SESSION["QUERY_SYSLOG_HOST_FIELDZ"])) {
        $sql = "SELECT hostname FROM files_info GROUP BY hostname ORDER BY hostname ASC";
        $results = $q->QUERY_SQL($sql);
        $hostz[null] = "{select}";
        while ($ligne = mysql_fetch_assoc($results)) {
            $hostz[$ligne["hostname"]] = $ligne["hostname"];
        }
        $_SESSION["QUERY_SYSLOG_HOST_FIELDZ"] = serialize($hostz);
    }
    $LIMITS[50] = 50;
    $LIMITS[250] = 250;
    $LIMITS[500] = 250;
    $LIMITS[1000] = 1000;
    $LIMITS[2000] = 2000;
    if (!isset($_SESSION["QUERY_SYSLOG_LIMIT"])) {
        $_SESSION["QUERY_SYSLOG_LIMIT"] = 250;
    }
    if (!is_numeric($_GET["xtime"])) {
        $boot->set_list("QUERY_SYSLOG_DATE", "{date}", unserialize($_SESSION["QUERY_SYSLOG_HOST_DAY_FIELDY"]), $_SESSION["QUERY_SYSLOG_DATE"]);
    }
    $boot->set_list("QUERY_SYSLOG_HOST", "{hostname}", unserialize($_SESSION["QUERY_SYSLOG_HOST_FIELDZ"]), $_SESSION["QUERY_SYSLOG_HOST"]);
    $boot->set_field("QUERY_SYSLOG_FILE", "{filename}", $_SESSION["QUERY_SYSLOG_FILE"]);
    $boot->set_list("QUERY_SYSLOG_LIMIT", "{rows}", $LIMITS, $_SESSION["QUERY_SYSLOG_LIMIT"]);
    $boot->set_button("{search}");
    $boot->set_CloseYahoo("YahooWin2");
    $boot->set_formdescription("{advanced_search_explain}");
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Ejemplo n.º 10
0
function cache_popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $servername = $_GET["servername"];
    $q = new mysql_squid_builder();
    $title = "{new_cache}";
    $bt = "{add}";
    $ID = $_GET["ID"];
    $boot = new boostrap_form();
    $sock = new sockets();
    $NginxProxyStorePath = $sock->GET_INFO("NginxProxyStorePath");
    if ($NginxProxyStorePath == null) {
        $NginxProxyStorePath = "/home/nginx";
    }
    if ($ID > 0) {
        $q = new mysql_squid_builder();
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_caches WHERE ID='{$ID}'"));
        $bt = "{apply}";
        $title = "{$ligne["keys_zone"]}";
    }
    if ($ligne["keys_zone"] == null) {
        $ligne["keys_zone"] = time();
    }
    if (trim($ligne["directory"]) == null) {
        $ligne["directory"] = $NginxProxyStorePath . "/{$ligne["keys_zone"]}";
    }
    if ($ligne["levels"] == null) {
        $ligne["levels"] = "1:2";
    }
    if (!is_numeric($ligne["keys_zone_size"])) {
        $ligne["keys_zone_size"] = 1;
    }
    if (!is_numeric($ligne["max_size"])) {
        $ligne["max_size"] = 2;
    }
    if (!is_numeric($ligne["inactive"])) {
        $ligne["inactive"] = 10;
    }
    if (!is_numeric($ligne["loader_files"])) {
        $ligne["loader_files"] = 100;
    }
    if (!is_numeric($ligne["loader_sleep"])) {
        $ligne["loader_sleep"] = 10;
    }
    if (!is_numeric($ligne["loader_threshold"])) {
        $ligne["loader_threshold"] = 100;
    }
    $boot->set_hidden("ID", $ID);
    $boot->set_formtitle($title);
    $boot->set_field("keys_zone", "{name}", $ligne["keys_zone"]);
    $boot->set_field("directory", "{directory}", $ligne["directory"], array("BROWSE" => true, "MANDATORY" => true, "ENCODE" => true));
    $boot->set_field("levels", "{levels}", $ligne["levels"]);
    $boot->set_field("keys_zone_size", "{memory_size} (MB)", $ligne["keys_zone_size"]);
    $boot->set_field("max_size", "{max_size} (GB)", $ligne["max_size"]);
    $boot->set_field("inactive", "{inactive} ({minutes})", $ligne["inactive"], array("TOOLTIP" => "{nginx_inactive_explain}"));
    $boot->set_field("loader_files", "{loader_files}", $ligne["loader_files"]);
    $boot->set_field("loader_sleep", "{loader_sleep} {milliseconds}", $ligne["loader_sleep"]);
    $boot->set_field("loader_threshold", "{loader_threshold} {milliseconds}", $ligne["loader_threshold"]);
    $boot->set_button($bt);
    if ($servername == null) {
        $boot->set_CloseYahoo("YahooWin");
    }
    $boot->set_RefreshSearchs();
    if (!AdminPrivs()) {
        $boot->set_form_locked();
    }
    echo $boot->Compile();
}
Ejemplo n.º 11
0
function item_config()
{
    $ldap = new clladp();
    $tpl = new templates();
    $id = $_GET["item-id"];
    if (!is_numeric($id)) {
        $id = 0;
    }
    $t = $_GET["t"];
    if (!is_numeric($t)) {
        $t = time();
    }
    $bname = "{add}";
    $page = CurrentPageName();
    $explian = "<div class=text-info style='font-size:14px'>{ADD_DNS_ENTRY_TEXT}</div>";
    $q = new mysql();
    if ($id > 0) {
        $bname = "{apply}";
        $sql = "SELECT * FROM records WHERE id={$id}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "powerdns"));
        $hostname = $ligne["name"];
        $tr = explode(".", $hostname);
        $computername = $tr[0];
        unset($tr[0]);
        $DnsZoneNameV = @implode(".", $tr);
        $DnsType = $ligne["type"];
        $ComputerIP = $ligne["content"];
        $ttl = $ligne["ttl"];
        $prio = $ligne["prio"];
        $explainthis = $ligne["explainthis"];
        $domain_id = $ligne["domain_id"];
        $ligneZ = mysql_fetch_array($q->QUERY_SQL("SELECT name FROM domains WHERE id={$domain_id}", "powerdns"));
        $DnsZoneName = $ligneZ["name"];
    }
    if (!is_numeric($domain_id)) {
        $domain_id = 0;
    }
    $dnstypeTable = array("" => "{select}", "MX" => "{mail_exchanger}", "A" => "{dnstypea}");
    $DnsType = Field_array_Hash($dnstypeTable, "DnsType", $DnsType, null, null, 0, null);
    $ERROR_VALUE_MISSING_PLEASE_FILL_THE_FORM = $tpl->javascript_parse_text('{ERROR_VALUE_MISSING_PLEASE_FILL_THE_FORM}');
    $addDomain = imgtootltip("plus-24.png", "{new_dnsdomain}", "Loadjs('postfix.transport.table.php?localdomain-js=yes&domain=&t={$t}&callback=RefreshFieldDomain{$t}')");
    if (!$users->AsSystemAdministrator) {
        if (!$users->AsDnsAdministrator) {
            $ldap = new clladp();
            $addDomain = null;
        }
    }
    if ($ttl == null) {
        $ttl = 8600;
    }
    if (!is_numeric($prio)) {
        $prio = 0;
    }
    $boot = new boostrap_form();
    $boot->set_field("ComputerIP", "{computer_ip}", $ComputerIP);
    if ($domain_id > 0) {
        $boot->set_field("DnsZoneName", "{DnsZoneName}", $DnsZoneName, array("DISABLED" => true));
    } else {
        $boot->set_field("DnsZoneName", "{DnsZoneName}", $DnsZoneName);
    }
    $boot->set_field("computername", "{computer_name}", $computername);
    $boot->set_field("TTL", "TTL", $ttl);
    $boot->set_field("PRIO", "PRIO", $prio);
    $boot->set_field("explainthis", "{explain}", $explainthis, array("ENCODE" => true));
    $boot->set_button($bname);
    $boot->set_hidden("id", $id);
    $boot->set_RefreshSearchs();
    $boot->set_formtitle("{record}");
    $form = $boot->Compile();
    echo $tpl->_ENGINE_parse_body($form);
}
function sources_add_group_popup()
{
    $boot = new boostrap_form();
    $sock = new sockets();
    $users = new usersMenus();
    $ldap = new clladp();
    $ID = $_GET["groupid"];
    $title_button = "{add}";
    $title = "{new_group}";
    if ($ID > 0) {
        $sql = "SELECT * FROM authenticator_auth WHERE ID='{$ID}'";
        $q = new mysql_squid_builder();
        $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        if (!$q->ok) {
            echo "<p class=text-error>{$q->mysql_error}</p>";
        }
        $title_button = "{apply}";
        $title = $ligne["groupname"] . "&nbsp;&raquo;&raquo;&nbsp;" . $GLOBALS["TYPES"][$ligne["group_type"]];
    }
    $mainrule = $_GET["mainrule"];
    if (!is_numeric($mainrule)) {
        $mainrule = 0;
    }
    $boot->set_formtitle($title);
    $boot->set_hidden("rules-sources-add-group-save", "yes");
    $boot->set_hidden("mainrule", $mainrule);
    $boot->set_hidden("groupid", $ID);
    $boot->set_field("groupname", "{groupname}", $ligne["groupname"], array("ENCODE" => true));
    $boot->set_checkbox("enabled", "{enabled}", $ligne["enabled"]);
    if ($ID == 0) {
        $boot->set_list("group_type", "{groupe_type}", $GLOBALS["TYPES"], $ligne["group_type"]);
    } else {
        $boot->set_hidden("group_type", $ligne["group_type"]);
    }
    $boot->set_button($title_button);
    $AdminPrivs = AdminPrivs();
    if (!$AdminPrivs) {
        $boot->set_form_locked();
    }
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin3");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function pools_sources_popup()
{
    $ID = $_GET["sourceid"];
    $q = new mysql_squid_builder();
    if (!is_numeric($ID)) {
        $ID = 0;
    }
    $title = "{new_source}";
    $bt = "{add}";
    if ($ID > 0) {
        $q = new mysql_squid_builder();
        $nginx_pools = "( SELECT nginx_pools_list.*,reverse_sources.servername FROM nginx_pools_list,reverse_sources WHERE nginx_pools_list.sourceid=reverse_sources.ID ) as t";
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM {$nginx_pools} WHERE ID='{$ID}'"));
        $title = $ligne["servername"];
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_pools_list WHERE ID='{$ID}'"));
        $bt = "{apply}";
    }
    $boot = new boostrap_form();
    $boot->set_hidden("pool-source-id", $ID);
    $boot->set_hidden("poolid", $_GET["pool-id"]);
    $sql = "SELECT ID,servername FROM reverse_sources";
    $results = $q->QUERY_SQL($sql, 'artica_backup');
    if (!$q->ok) {
        senderror($q->mysql_error);
    }
    while ($ligne2 = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $sources[$ligne2["ID"]] = $ligne2["servername"];
    }
    $boot->set_formtitle($title);
    $backuptype["none"] = "{default}";
    $backuptype["backup"] = "backup";
    $backuptype["down"] = "down";
    if (!is_numeric($ligne["max_fails"])) {
        $ligne["max_fails"] = 3;
    }
    if (!is_numeric($ligne["fail_timeout"])) {
        $ligne["fail_timeout"] = 30;
    }
    $boot->set_list("sourceid", "{source}", $sources, $ligne["sourceid"]);
    $boot->set_button($bt);
    $boot->set_field("max_fails", "{max_failed}", $ligne["max_fails"]);
    $boot->set_field("fail_timeout", "{connect_timeout} ({seconds})", $ligne["fail_timeout"]);
    $boot->set_list("backuptype", "{type}", $backuptype, $ligne["backuptype"]);
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function ruleid_popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $id = $_GET["ruleid"];
    if (!is_numeric($id)) {
        $id = 0;
    }
    $gpid = $_GET["gpid"];
    $buttonname = "{add}";
    if ($id > 0) {
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM webfilter_aclsdynamic WHERE `ID`='{$id}'"));
        $buttonname = "{apply}";
        $gpid = $ligne["gpid"];
    }
    $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT params FROM webfilters_sqgroups WHERE ID='{$gpid}'"));
    $params = unserialize(base64_decode($ligne2["params"]));
    if ($id == 0) {
        $ligne["duration"] = $params["duration"];
    }
    $t = time();
    if (!is_numeric($gpid)) {
        $gpid = 0;
    }
    $ligne["description"] = stripslashes($ligne["description"]);
    if ($id > 0) {
        $buttonname = "{apply}";
    }
    $durations[0] = "{unlimited}";
    $durations[5] = "05 {minutes}";
    $durations[10] = "10 {minutes}";
    $durations[15] = "15 {minutes}";
    $durations[30] = "30 {minutes}";
    $durations[60] = "1 {hour}";
    $durations[120] = "2 {hours}";
    $durations[240] = "4 {hours}";
    $durations[480] = "8 {hours}";
    $durations[720] = "12 {hours}";
    $durations[960] = "16 {hours}";
    $durations[1440] = "1 {day}";
    $durations[2880] = "2 {days}";
    $durations[5760] = "4 {days}";
    $durations[10080] = "1 {week}";
    $durations[20160] = "2 {weeks}";
    $durations[43200] = "1 {month}";
    $boot = new boostrap_form();
    $boot->set_hidden("SaveRule", "yes");
    $boot->set_hidden("gpid", $gpid);
    $boot->set_hidden("ruleid", $id);
    $boot->set_formdescription("{dynaacl_howto}");
    $boot->set_list("type", "{type}", $q->acl_GroupTypeDynamic, $ligne["type"]);
    $boot->set_field("value", "{value}", $ligne["value"], array("MANDATORY" => true));
    if ($params["allow_duration"] == 1) {
        $boot->set_list("duration", "{time_duration}", $durations, $ligne["duration"]);
    }
    $boot->set_field("description", "{description}", utf8_encode($ligne["description"]));
    $boot->set_button($buttonname);
    $boot->set_RefreshSearchs();
    $html = $boot->Compile();
    echo $tpl->_ENGINE_parse_body($html);
}
function host_edit_options()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $mac = $_GET["mac"];
    $tt = $_GET["t"];
    $bootstrap = new boostrap_form();
    $q = new mysql();
    if (!$q->FIELD_EXISTS('dhcpd_fixed', 'routers', 'artica_backup')) {
        $sql = "ALTER TABLE `dhcpd_fixed` ADD `routers` VARCHAR( 128 ),\n\t\t\t\t\t`time-servers` VARCHAR( 128 ),\n\t\t\t\t\t`domain-name-servers` VARCHAR( 255 ),\n\t\t\t\t\t`ntp-servers`  VARCHAR( 255 ),\n\t\t\t\t\t`local-pac-server` VARCHAR( 255 )";
        $q->QUERY_SQL($sql, "artica_backup");
        if (!$q->ok) {
            echo $q->mysql_error . "\n{$sql}\n";
        }
    }
    $sql = "SELECT * FROM dhcpd_fixed WHERE `mac`='{$_GET["mac"]}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    $bootstrap->set_formdescription("{dhcp_host_explain_options}");
    $bootstrap->set_button("{apply}");
    $bootstrap->set_hidden("edit-mac-adv", $mac);
    $bootstrap->set_field("routers", "{gateway}", $ligne["routers"]);
    $bootstrap->set_field("time-servers", "{time-servers}", $ligne["time-servers"]);
    $bootstrap->set_field("domain-name-servers", "{domain-name-servers}", $ligne["domain-name-servers"]);
    $bootstrap->set_field("ntp-servers", "{ntp-servers}", $ligne["ntp-servers"]);
    $bootstrap->set_field("local-pac-server", "{local-pac-server}", $ligne["local-pac-server"]);
    $bootstrap->set_RefreshSearchs();
    echo $tpl->_ENGINE_parse_body($bootstrap->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();
}
Ejemplo n.º 17
0
function add_user_popup()
{
    $ldap = new clladp();
    if ($_GET["ou"] == null) {
        senderror("{ERROR_NO_ORGANISATION_SELECTED}");
    }
    $hash = $ldap->hash_groups($_GET["ou"], 1);
    $domains = $ldap->hash_get_domains_ou($_GET["ou"]);
    $boot = new boostrap_form();
    $boot->set_hidden("ou", $_GET["ou"]);
    $boot->set_hidden("encpass", 1);
    $boot->set_field("new_userid", "{name_the_new_account_title}", null, array("MANDATORY" => true));
    $boot->set_field("password", "{password}", null, array("MANDATORY" => true));
    $boot->set_field("email", "{email}", null, array("MANDATORY" => true));
    $boot->set_field("password", "{password}", null, array("MANDATORY" => true, "ENCODE" => true));
    $boot->set_list("group_id", "{group}", $hash);
    $boot->set_button("{add}");
    $boot->set_CloseYahoo("YahooWin2");
    $boot->set_RefreshSearchs();
    $boot->setAjaxPage("domains.edit.user.php");
    $boot->set_formtitle("{$_GET["ou"]}:: {new_member}");
    echo $boot->Compile();
}
function member_popup()
{
    $page = CurrentPageName();
    $boot = new boostrap_form();
    $tpl = new templates();
    $boot->set_field("ipaddr", "{ipaddr}", null, array("IPV4" => true));
    $boot->set_field("username", "{username}", null, array("MANDATORY" => True));
    $boot->set_fieldpassword("password", "{password}", null, array("MANDATORY" => True));
    $boot->set_button("{add}");
    $boot->set_RefreshSearchs();
    $boot->set_CloseYahoo("YahooWin");
    echo $boot->Compile();
}
Ejemplo n.º 19
0
function subrules_popup()
{
    $ruleid = $_GET["rule-id"];
    $ID = $_GET["subrule"];
    $users = new usersMenus();
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $buttonname = "{add}";
    $boot = new boostrap_form();
    if ($ID > 0) {
        $q = new mysql();
        $sql = "SELECT *  FROM iproute_rules WHERE ID={$ID}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        $title = $tpl->_ENGINE_parse_body("{$ID}::{$ligne["src"]} - {$ligne["destination"]}");
        $buttonname = "{apply}";
    } else {
        $boot->set_CloseYahoo("YahooWin3");
    }
    if (!is_numeric($ligne["enable"])) {
        $ligne["enable"] = 1;
    }
    $boot->set_formtitle($title);
    $boot->set_formdescription("{iprules_explain}");
    $boot->set_hidden("subruleid", $ID);
    $boot->set_hidden("ruleid", $ruleid);
    $boot->set_field("src", "{source}", $ligne["source"]);
    $boot->set_field("destination", "{destination}", $ligne["destination"]);
    $boot->set_field("priority", "{priority}", $ligne["priority"]);
    $boot->set_checkbox("enable", "{enabled}", $ligne["enable"]);
    $users = new usersMenus();
    if (!$users->AsSystemAdministrator) {
        $boot->set_form_locked();
    }
    $boot->set_button($buttonname);
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function policy3()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $boot = new boostrap_form();
    $t = time();
    $q = new amavisdb();
    $users = new usersMenus();
    $policy_id = $_GET["policy-id"];
    $btname = "{apply}";
    $sql = "SELECT * FROM policy WHERE id='{$policy_id}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
    if (!$q->ok) {
        $error = "<p class='text-error'>{$q->mysql_error}.</p>";
    }
    $boot->set_hidden("policy_id", $policy_id);
    $boot->set_spacertitle("{warnrecip}");
    $boot->set_checkboxYN("warnvirusrecip", "{warnvirusrecip}", $ligne["warnvirusrecip"]);
    $boot->set_checkboxYN("warnbannedrecip", "{warnbannedrecip}", $ligne["warnbannedrecip"]);
    $boot->set_checkboxYN("warnbadhrecip", "{warnbadhrecip}", $ligne["warnbadhrecip"]);
    $boot->set_spacertitle("{sendreportto}");
    $boot->set_field("newvirus_admin", "{virus_detected}", $ligne["newvirus_admin"]);
    $boot->set_field("banned_admin", "{banned_files}", $ligne["banned_admin"]);
    $boot->set_field("bad_header_admin", "{bad_headers}", $ligne["bad_header_admin"]);
    $boot->set_field("spam_admin", "{spam_messages}", $ligne["spam_admin"]);
    $boot->set_spacertitle("{subjects_tags}");
    $boot->set_field("spam_subject_tag", "{non_spam_messages}", $ligne["spam_subject_tag"]);
    $boot->set_field("spam_subject_tag2", "{spam_messages}", $ligne["spam_subject_tag2"]);
    $boot->set_field("spam_subject_tag3", "{blatant_spam}", $ligne["spam_subject_tag3"]);
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Ejemplo n.º 21
0
function virtip_popup()
{
    $boot = new boostrap_form();
    $sock = new sockets();
    $users = new usersMenus();
    $ldap = new clladp();
    $ID = $_GET["ID"];
    $title_button = "{add}";
    $nics = unserialize(base64_decode($sock->getFrameWork("cmd.php?list-nics=yes")));
    if ($_GET["ID"] > 0) {
        $sql = "SELECT * FROM nics_virtuals WHERE ID='{$ID}'";
        $q = new mysql();
        $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        $title_button = "{apply}";
    }
    $ous = $ldap->hash_get_ou(true);
    $ous["openvpn_service"] = "{APP_OPENVPN}";
    while (list($num, $val) = each($nics)) {
        $nics_array[$val] = $val;
    }
    $nics_array[null] = "{select}";
    $ous[null] = "{select}";
    $boot->set_list("nic", "{nic}", $nics_array, $ligne["nic"]);
    $boot->set_list("org", "{organization}", $ous, $ligne["org"]);
    $boot->set_field("ipaddr", "{tcp_address}", $ligne["ipaddr"], array("IPV4" => true));
    $boot->set_field("netmask", "{netmask}", $ligne["netmask"], array("IPV4" => true));
    $boot->set_field("cdir", "CDIR", $ligne["cdir"], array("CDIR" => "ipaddr,netmask"));
    $boot->set_field("gateway", "{gateway}", $ligne["gateway"], array("IPV4" => true));
    $boot->set_field("metric", "{metric}", $ligne["metric"]);
    $boot->set_hidden("ID", $_GET["ID"]);
    $boot->set_checkbox("ForceGateway", "{ForceGateway}", $ligne["ForceGateway"]);
    if (!$users->AsSystemAdministrator) {
        $boot->set_form_locked();
    }
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin2");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
function settings()
{
    $schedules = new system_tasks();
    $q = new mysql_squid_builder();
    $tpl = new templates();
    $buttontext = "{apply}";
    $ID = $_GET["ID"];
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM webfilters_schedules WHERE ID={$ID}"));
    $ligne["TimeDescription"] = utf8_encode($ligne["TimeDescription"]);
    $TimeText = $tpl->_ENGINE_parse_body($schedules->PatternToHuman($ligne["TimeText"]));
    $TimeText = str_replace("<br>", "", $TimeText);
    $explain = $tpl->_ENGINE_parse_body($q->tasks_explain_array[$ligne["TaskType"]]);
    $boot = new boostrap_form();
    $boot->set_hidden("ID", $ID);
    $boot->set_checkbox("enabled", "{enabled}", $ligne["enabled"]);
    $boot->set_field("TimeDescription", "{description}", $ligne["TimeDescription"], array("ENCODE" => TRUE));
    $boot->set_button("{apply}");
    $boot->set_formtitle("{task} {$ligne["ID"]}");
    $runtask = $tpl->_ENGINE_parse_body("<div style='text-align:right'><i class='icon-play'></i> <a href=\"javascript:Blurz();\" OnClick=\"javascript:Loadjs('miniadm.ajax.squid.schedules.php?schedule-run-js=yes&ID={$ID}');\">{run} {task}</div>");
    $boot->set_formdescription("{$explain}<br>{$TimeText}{$runtask}");
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Ejemplo n.º 23
0
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 group_popup()
{
    $ID = $_GET["ID"];
    $q = new mysql_squid_builder();
    $title = "{new_group}";
    $bt = "{add}";
    $q = new mysql_squid_builder();
    if (!$q->TABLE_EXISTS("nginx_exploits_groups")) {
        $sql = "CREATE TABLE IF NOT EXISTS `nginx_exploits_groups` (\n\t\t\t  `ID` INT NOT NULL AUTO_INCREMENT,\n\t\t\t  `groupname` CHAR(255)  NOT NULL,\n\t\t\t  PRIMARY KEY (`ID`),\n\t\t\t  KEY `groupname` (`groupname`)\n\t\t\t)  ENGINE = MYISAM;";
        if (!$q->QUERY_SQL($sql)) {
            echo $q->mysql_error_html();
        }
    }
    $boot = new boostrap_form();
    $sock = new sockets();
    if ($ID > 0) {
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_exploits_groups WHERE ID='{$ID}'"));
        $bt = "{apply}";
        $title = "{$ligne["groupname"]}";
    }
    $boot->set_hidden("editgroupid", $ID);
    $boot->set_hidden("servername", $_GET["servername"]);
    $boot->set_formtitle($title);
    $boot->set_field("groupname", "{groupname}", $ligne["groupname"]);
    if ($ID == 0) {
        $boot->set_checkbox("addef", "{add_defaults}", 0);
    }
    $boot->set_button($bt);
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin5");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Ejemplo n.º 25
0
function section_blocked_form()
{
    $boot = new boostrap_form();
    $q = new mysql_squid_builder();
    $ARRAYTABLES = $q->LIST_TABLES_BLOCKED();
    while (list($tablename, $none) = each($ARRAYTABLES)) {
        $time = $q->TIME_FROM_DAY_TABLE($tablename);
        $days[$time] = time_to_date($time);
    }
    $BLOCKED_CATEGORY_LIMITS[50] = 50;
    $BLOCKED_CATEGORY_LIMITS[250] = 250;
    $BLOCKED_CATEGORY_LIMITS[500] = 250;
    $BLOCKED_CATEGORY_LIMITS[1000] = 1000;
    $BLOCKED_CATEGORY_LIMITS[2000] = 2000;
    krsort($days);
    $boot->set_list("QUERY_BLOCKED_DATE", "{date}", $days, $_SESSION["QUERY_BLOCKED_DATE"]);
    $boot->set_field("QUERY_BLOCKED_UID", "{member}", $_SESSION["QUERY_BLOCKED_UID"]);
    $boot->set_field("QUERY_BLOCKED_CATEGORY", "{category}", $_SESSION["QUERY_BLOCKED_CATEGORY"]);
    $boot->set_list("BLOCKED_CATEGORY_LIMIT", "{rows}", $BLOCKED_CATEGORY_LIMITS, $_SESSION["BLOCKED_CATEGORY_LIMIT"]);
    $boot->set_button("{search}");
    $boot->set_CloseYahoo("YahooWin2");
    $boot->set_formdescription("{advanced_search_explain}");
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Ejemplo n.º 26
0
function bridge_popup()
{
    $boot = new boostrap_form();
    $sock = new sockets();
    $users = new usersMenus();
    $ldap = new clladp();
    $ID = $_GET["ID"];
    $title_button = "{add}";
    $nics = unserialize(base64_decode($sock->getFrameWork("cmd.php?list-nics=yes")));
    if ($_GET["ID"] > 0) {
        $sql = "SELECT * FROM nics_bridge WHERE ID='{$ID}'";
        $q = new mysql();
        $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        $title_button = "{apply}";
    }
    $nics_array[null] = "{select}";
    $ous[null] = "{select}";
    $boot->set_field("name", "{name}", $ligne["name"]);
    $boot->set_field("ipaddr", "{tcp_address}", $ligne["ipaddr"], array("IPV4" => true));
    $boot->set_field("netmask", "{netmask}", $ligne["netmask"], array("IPV4" => true));
    $boot->set_field("cdir", "CDIR", $ligne["cdir"], array("CDIR" => "ipaddr,netmask"));
    $boot->set_field("broadcast", "{broadcast}", $ligne["broadcast"], array("IPV4" => true));
    $boot->set_field("gateway", "{gateway}", $ligne["gateway"], array("IPV4" => true));
    $boot->set_hidden("ID", $_GET["ID"]);
    if (!$users->AsSystemAdministrator) {
        $boot->set_form_locked();
    }
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin2");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Ejemplo n.º 27
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 NewMacLink_popup()
{
    $tpl = new templates();
    $_GET["MAC"] = trim($_GET["MAC"]);
    if ($_GET["MAC"] != null) {
        if (!IsPhysicalAddress($_GET["MAC"])) {
            unset($_GET["MAC"]);
        }
    } else {
        unset($_GET["MAC"]);
    }
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM webfilters_nodes WHERE MAC='{$_GET["MAC"]}'"));
    $boot = new boostrap_form();
    if ($_GET["MAC"] == null) {
        $boot->set_field("MAC", "{MAC}", null, array("MANDATORY" => true, "BUTTON" => array("JS" => "Loadjs('miniadm.squid.macbrowser.php?field=%f')", "LABEL" => $tpl->_ENGINE_parse_body("{browse}"))));
    } else {
        $boot->set_formtitle("{MAC}:{$_GET["MAC"]}");
        $boot->set_hidden("MAC", $_GET["MAC"]);
        $ips = array();
        $results2 = $q->QUERY_SQL("SELECT ipaddr FROM members_macip WHERE MAC='{$_GET["MAC"]}' ORDER BY ipaddr");
        while ($ligne2 = mysql_fetch_assoc($results2)) {
            $ips[] = $ligne2["ipaddr"];
        }
        if (count($ips) > 0) {
            $boot->set_formdescription(@implode(", ", $ips));
        }
        $linkstats = "<div style='width:100%'>\n\t\t\t\t<a href=\"javascript:blur();\" \n\t\t\t\tOnClick=\"javascript:miniadm.squid.macbrowser.php?visits-day-js={$_GET["MAC"]}');>{statistics}</a></div>";
    }
    $boot->set_hidden("save-mac", 'yes');
    $boot->set_field("hostname", "{hostname}", $ligne["hostname"]);
    $boot->set_field("uid", "{member}", $ligne["uid"], array("MANDATORY" => true));
    $boot->set_button("{add}");
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Ejemplo n.º 29
0
function table_all_videos_search_popup()
{
    $boot = new boostrap_form();
    $q = new mysql_squid_builder();
    if (isset($_SESSION["QUERY_YOUTUBE_CATZ"])) {
        $testCatz = unserialize($_SESSION["QUERY_YOUTUBE_CATZ"]);
        if (!is_array($testCatz)) {
            unset($_SESSION["QUERY_YOUTUBE_CATZ"]);
        }
    }
    if (!isset($_SESSION["QUERY_YOUTUBE_CATZ"])) {
        $sql = "SELECT category  FROM youtube_objects GROUP BY category";
        $results = $q->QUERY_SQL($sql);
        $dayz[null] = "{select}";
        while ($ligne = mysql_fetch_assoc($results)) {
            $time = time_to_date(strtotime($ligne["filetime"] . " 00:00:00"));
            $dayz[$ligne["category"]] = $ligne["category"];
        }
        $_SESSION["QUERY_YOUTUBE_CATZ"] = serialize($dayz);
    }
    $LIMITS[50] = 50;
    $LIMITS[250] = 250;
    $LIMITS[500] = 250;
    $LIMITS[1000] = 1000;
    $LIMITS[2000] = 2000;
    if (!isset($_SESSION["QUERY_YOUTUBE_LIMIT"])) {
        $_SESSION["QUERY_YOUTUBE_LIMIT"] = 250;
    }
    $boot->set_list("QUERY_YOUTUBE_CATE", "{category}", unserialize($_SESSION["QUERY_YOUTUBE_CATZ"]), $_SESSION["QUERY_YOUTUBE_CATE"]);
    $boot->set_list("QUERY_YOUTUBE_LIMIT", "{rows}", $LIMITS, $_SESSION["QUERY_YOUTUBE_LIMIT"]);
    $boot->set_button("{search}");
    $boot->set_CloseYahoo("YahooWin2");
    $boot->set_formdescription("{advanced_search_explain}");
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}
Ejemplo n.º 30
0
function firewall_popup()
{
    $ID = $_GET["ID"];
    $q = new mysql_squid_builder();
    $bt = "{apply}";
    $servername = $_GET["servername"];
    if (!$q->TABLE_EXISTS("nginx_exploits_fw")) {
        $sql = "CREATE TABLE IF NOT EXISTS `nginx_exploits_fw` (\n\t\t`servername` CHAR(255) NOT NULL  PRIMARY KEY,\n\t\t`maxaccess` smallint(1)  NOT NULL DEFAULT 0,\n\t\t`sendlogs` smallint(1)  NOT NULL DEFAULT 0,\n\t\tKEY `maxaccess` (`maxaccess`),\n\t\tKEY `sendlogs` (`sendlogs`)\n\t\t)  ENGINE = MYISAM;";
        if (!$q->QUERY_SQL($sql)) {
            echo $q->mysql_error_html();
        }
    }
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM nginx_exploits_fw WHERE servername='{$servername}'"));
    if (!is_numeric($ligne["maxaccess"])) {
        $ligne["maxaccess"] = 0;
    }
    $boot = new boostrap_form();
    $sock = new sockets();
    $boot->set_hidden("servername", $_GET["servername"]);
    $boot->set_hidden("firewall", $_GET["servername"]);
    $boot->set_formtitle("{firewall}");
    $boot->set_formdescription("{NGINX_FW_EXPLAIN}");
    $boot->set_field("maxaccess", "{MAX_EVENTS}", $ligne["maxaccess"], array("TOOLTIP" => "{NGINX_MAXACCESS_FW_EXPLAIN}"));
    $boot->set_checkbox("sendlogs", "{write_logs}", $ligne["sendlogs"]);
    $boot->set_button($bt);
    if ($ID == 0) {
        $boot->set_CloseYahoo("YahooWin4");
    }
    $boot->set_RefreshSearchs();
    echo $boot->Compile();
}