Exemplo n.º 1
0
function page()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $SquidSimpleConfig = $sock->GET_INFO("SquidSimpleConfig");
    if (!is_numeric($SquidSimpleConfig)) {
        $SquidSimpleConfig = 1;
    }
    $meminfo = unserialize(base64_decode($sock->getFrameWork("system.php?meminfo=yes")));
    $kernel_shmmax = $sock->getFrameWork("cmd.php?sysctl-value=yes&key=" . base64_encode("kernel.shmmax"));
    $MEMTOTAL = intval($meminfo["MEMTOTAL"]);
    $squid = new squidbee();
    $cache_mem = $squid->global_conf_array["cache_mem"];
    if (preg_match("#([0-9]+)\\s+#", $cache_mem, $re)) {
        $cache_mem = $re[1];
    }
    $SquidMemoryPools = intval($sock->GET_INFO("SquidMemoryPools"));
    $memory_pools_limit_suffix = null;
    $SquidMemoryPoolsLimit = intval($sock->GET_INFO("SquidMemoryPoolsLimit"));
    $FF = 1500;
    $FF = $FF * 1024;
    $FF = $FF * 1024;
    $proposal = $meminfo["MEMTOTAL"] - $FF;
    $proposal = $proposal / 2;
    $proposal = $proposal / 1024;
    $proposal = round($proposal / 1024);
    $html = "\n\t\n\t<div class=explain style='font-size:16px'>{squid_cache_memory_explain}</div>\n\t<div style='margin:10px;padding:10px;width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td colspan=3 style='font-size:32px;margin-bottom:20px'>{central_memory}</div>\n\t\t\t<div class=explain style='font-size:18px'>{cache_mem_explain2}</div>\n\t\t</td>\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:26px'>{central_memory}:</td>\n\t\t<td style='font-size:26px'>" . Field_text("cache_mem-{$t}", $cache_mem, "font-size:26px;width:150px;font-weight:bold") . "&nbsp;MB</td>\n\t\t<td style='font-size:26px' width=1% nowrap>" . help_icon('{cache_mem_text}', true) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:26px'>{current}:</td>\n\t\t<td style='font-size:26px'><span id='squid-cache-mem-current' style='font-size:26px;font-weight:bold'></span></td>\n\t\t<td style='font-size:26px' width=1% nowrap>&nbsp;</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t<td colspan=3 style='font-size:20px;margin-bottom:20px;color:#8E8E8E;text-align:right'>{server_memory}: " . FormatBytes($meminfo["MEMTOTAL"] / 1024) . " ({proposal}: {$proposal}MB)</div>\n\t</table>\n\t</div>\t\t\n\t<div style='margin:10px;padding:10px;width:98%' class=form>\t\n\t<table style='width:100%'>\n\n\t<tr>\n\t\t<td style='font-size:26px' class=legend>{memory_pools}:</td>\n\t\t<td align='left' style='font-size:26px'>" . Field_checkbox_design("SquidMemoryPools-{$t}", 1, $SquidMemoryPools, "SquidMemoryPools{$t}()") . "</td>\n\t\t<td width=1%>" . help_icon('{memory_pools_explain}', true) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:26px' class=legend>{memory_pools_limit}:</td>\n\t\t<td align='left' style='font-size:26px'>" . Field_text("SquidMemoryPoolsLimit-{$t}", $SquidMemoryPoolsLimit, "font-size:26px;width:150px") . "&nbsp;MB</td>\n\t\t<td width=1%>" . help_icon('{memory_pools_limit_explain}', true) . "</td>\n\t</tr>\t\t\t\t\t\t\t\t\t\n</tr>\t\n\t<tr><td colspan=3 style='text-align:right;pdding-top:50px'><hr>" . button("{apply}", "Save{$t}()", 36) . "</td>\n\t</tr>\n</table>\t\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tLoadjs('squid.compile.progress.php?ask=yes');\n}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('cache_mem',document.getElementById('cache_mem-{$t}').value);\n\t\n\tif(document.getElementById('SquidMemoryPools-{$t}').checked){XHR.appendData('SquidMemoryPools',1);}else{\n\tXHR.appendData('SquidMemoryPools',0);}\n\tXHR.appendData('SquidMemoryPoolsLimit',document.getElementById('SquidMemoryPoolsLimit-{$t}').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\t\nfunction SquidMemoryPools{$t}(){\n\tvar SquidSimpleConfig={$SquidSimpleConfig};\n\tif(SquidSimpleConfig==1){\n\t\tdocument.getElementById('SquidMemoryPools-{$t}').disabled=true;\n\t\tdocument.getElementById('SquidMemoryPoolsLimit-{$t}').disabled=true;\n\t\treturn;\n\t}\n\n\tdocument.getElementById('SquidMemoryPoolsLimit-{$t}').disabled=true;\n\tif(document.getElementById('SquidMemoryPools-{$t}').checked){\n\t\tdocument.getElementById('SquidMemoryPoolsLimit-{$t}').disabled=false;\n\t}\n\t\n\tLoadAjax('squid-cache-mem-current','{$page}?squid-cache-mem-current=yes');\n\t\n}\nSquidMemoryPools{$t}();\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 2
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $Param = unserialize(base64_decode($sock->GET_INFO("MimeDefangServiceOptions")));
    $t = time();
    if (!is_numeric($Param["DEBUG"])) {
        $Param["DEBUG"] = 0;
    }
    if (!is_numeric($Param["MX_REQUESTS"])) {
        $Param["MX_REQUESTS"] = 200;
    }
    if (!is_numeric($Param["MX_MINIMUM"])) {
        $Param["MX_MINIMUM"] = 2;
    }
    if (!is_numeric($Param["MX_MAXIMUM"])) {
        $Param["MX_MAXIMUM"] = 10;
    }
    if (!is_numeric($Param["MX_MAX_RSS"])) {
        $Param["MX_MAX_RSS"] = 30000;
    }
    if (!is_numeric($Param["MX_MAX_AS"])) {
        $Param["MX_MAX_AS"] = 90000;
    }
    if (!is_numeric($Param["MX_TMPFS"])) {
        $Param["MX_TMPFS"] = 0;
    }
    $MimeDefangVersion = $sock->GET_INFO("MimeDefangVersion");
    $html = "\n\t<div style='font-size:40px;margin:bottom:40px;text-align:right'>{APP_MIMEDEFANG} v{$MimeDefangVersion} <span style='font-size:18px'>(" . texttooltip("{reload_service}", "{reload_service_text}", "MimeDefangCompileRules()") . ")</span></div>\n\t<table style='width:100%' class=form>\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{debug}:</td>\n\t\t<td>" . Field_checkbox_design("DEBUG-{$t}", 1, $Param["DEBUG"]) . "</td>\n\t\t\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{workingdir_in_memory}", "{workingdir_in_memory_text}") . ":</td>\n\t\t<td style='font-size:22px'>" . Field_text("MX_TMPFS-{$t}", $Param["MX_TMPFS"], "font-size:22px;width:90px") . "&nbsp;M</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{max_requests}", "{MX_REQUESTS_TEXT}") . ":</td>\n\t\t<td>" . Field_text("MX_REQUESTS-{$t}", $Param["MX_REQUESTS"], "font-size:22px;width:90px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{MX_MINIMUM}", "{MX_MINIMUM_TEXT}") . ":</td>\n\t\t<td>" . Field_text("MX_MINIMUM-{$t}", $Param["MX_MINIMUM"], "font-size:22px;width:90px") . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{MX_MAXIMUM}", "{MX_MAXIMUM}") . ":</td>\n\t\t<td>" . Field_text("MX_MAXIMUM-{$t}", $Param["MX_MAXIMUM"], "font-size:22px;width:90px") . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{MX_MAX_RSS}", "{MX_MAX_RSS_TEXT}") . ":</td>\n\t\t<td style='font-size:22px'>" . Field_text("MX_MAX_RSS-{$t}", $Param["MX_MAX_RSS_TEXT"], "font-size:22px;width:110px") . "&nbsp;KB</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{MX_MAX_AS}", "{MX_MAX_AS_TEXT}") . ":</td>\n\t\t<td style='font-size:22px'>" . Field_text("MX_MAX_AS-{$t}", $Param["MX_MAX_AS"], "font-size:22px;width:110px") . "&nbsp;KB</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "SaveMimeService{$t}()", "40") . "</td>\n\t</tr>\t\n\t</table>\n\n\t<script>\n\t\tfunction MimeDefangCompileRules(){\n\t\tLoadjs('mimedefang.compile.php');\n\t}\n\t\n\t\n\t\tvar x_SaveMimeService{$t}= function (obj) {\n\t\t\tvar tempvalue=obj.responseText;\n\t\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\t\tLoadjs('mimedefang.compile.php');\n\t\t}\t\t\n\t\n\t\tfunction SaveMimeService{$t}(){\n\t\tvar XHR = new XHRConnection();  \n\t\t  var DEBUG=0;\n\t\t  if(document.getElementById('DEBUG-{$t}').checked){DEBUG=1;}\n\t      XHR.appendData('MX_MAX_AS',document.getElementById('MX_MAX_AS-{$t}').value);\n\t      XHR.appendData('MX_MAX_RSS',document.getElementById('MX_MAX_RSS-{$t}').value);\n\t      XHR.appendData('MX_MAXIMUM',document.getElementById('MX_MAXIMUM-{$t}').value);\n\t      XHR.appendData('MX_MINIMUM',document.getElementById('MX_MINIMUM-{$t}').value);\n\t      XHR.appendData('MX_REQUESTS',document.getElementById('MX_REQUESTS-{$t}').value);\n\t      XHR.appendData('MX_TMPFS',document.getElementById('MX_TMPFS-{$t}').value);\n\t      XHR.appendData('DEBUG',DEBUG);\n\t      XHR.sendAndLoad('{$page}', 'POST',x_SaveMimeService{$t});\n\t\t}\n\t</script>\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 3
0
function TEMPLATE_SETTINGS()
{
    $page = CurrentPageName();
    $sock = new sockets();
    $tpl = new templates();
    $users = new usersMenus();
    $squid = new squidbee();
    $error = null;
    $t = time();
    $button = "<hr>" . button("{save}", "Save{$t}()", 40);
    $TEMPLATE_TITLE = $_GET["TEMPLATE_TITLE"];
    $SquidTemplatesMicrosoft = intval($sock->GET_INFO("SquidTemplatesMicrosoft"));
    $SquidHTTPTemplateLanguage = $sock->GET_INFO("SquidHTTPTemplateLanguage");
    if ($SquidHTTPTemplateLanguage == null) {
        $SquidHTTPTemplateLanguage = "en";
    }
    $lang = $_GET["lang"];
    $ENABLED = 1;
    $xtpl = new template_simple("ERR_ADS_BLOCK", $SquidHTTPTemplateLanguage);
    if (!$users->CORP_LICENSE) {
        $ENABLED = 0;
        $error = "<p class=text-error>{MOD_TEMPLATE_ERROR_LICENSE}</p>";
        $button = null;
    }
    $html = "\n<div style='font-size:40px;margin-bottom:30px'>{error_page}</div>\t\n\n{$error}\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:24px'>{subject}:</td>\n\t\t<td>" . Field_text("TITLE-{$t}", utf8_decode($xtpl->TITLE), "font-size:24px;width:90%") . "</td>\t\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:24px;vertical-align:middle'>{content}:</td>\n\t\t<td><textarea\n\t\tstyle='width:100%;height:350px;font-size:24px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\tCourier,monospace;background-color:white;color:black' id='BODY-{$t}'>" . utf8_decode($xtpl->BODY) . "</textarea>\n\t</tr>\t\n<tr>\n\t<td class=legend style='font-size:24px' width=1% nowrap>{remove_artica_version}:</td>\n\t<td width=99%>" . Field_checkbox_design("SquidADSTemplateNoVersion-{$t}", 1, $xtpl->SquidADSTemplateNoVersion) . "</td>\n</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:24px'>{background_color}:</td>\n\t\t<td>" . Field_ColorPicker("SquidADSTemplateBackgroundColor-{$t}", $xtpl->SquidADSTemplateBackgroundColor, "font-size:24px;width:150px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:24px'>{font_family}:</td>\n\t<td><textarea\n\tstyle='width:100%;height:150px;font-size:24px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\tCourier,monospace;background-color:white;color:black' id='SquidADSTemplateFamily-{$t}'>{$xtpl->SquidADSTemplateFamily}</textarea>\n\t</td>\n\t</tr>\n\t<tr>\n\t<td class=legend style='font-size:24px'>{font_color}:</td>\n\t<td>" . Field_ColorPicker("SquidADSTemplateFontColor-{$t}", $xtpl->SquidADSTemplateFontColor, "font-size:24px;width:150px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:24px'>Smiley:</td>\n\t\t<td>" . Field_text("SquidADSTemplateSmiley-{$t}", $xtpl->SquidADSTemplateSmiley, "width:120px;font-size:24px") . "</td>\n\t</tr>\t\t\n\t<tr>\n\t<td colspan=2 align='right'>{$button}</td>\n\t</tr>\n<script>\n\tvar xSave{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue)};\n\tLoadjs('privoxy.progress.template.php');\n}\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('TEMPLATE_TITLE','ERR_ADS_BLOCK');\n\tXHR.appendData('lang','{$lang}');\n\tXHR.appendData('SquidADSTemplateFamily',document.getElementById('SquidADSTemplateFamily-{$t}').value);\n\tXHR.appendData('SquidADSTemplateBackgroundColor',document.getElementById('SquidADSTemplateBackgroundColor-{$t}').value);\n\tXHR.appendData('SquidADSTemplateFontColor',document.getElementById('SquidADSTemplateFontColor-{$t}').value);\n\tXHR.appendData('SquidADSTemplateSmiley',document.getElementById('SquidADSTemplateSmiley-{$t}').value);\n\tXHR.appendData('TITLE',encodeURIComponent(document.getElementById('TITLE-{$t}').value));\n\tXHR.appendData('BODY',encodeURIComponent(document.getElementById('BODY-{$t}').value));\n\tif(document.getElementById('SquidADSTemplateNoVersion-{$t}').checked){XHR.appendData('SquidADSTemplateNoVersion',1);}else{XHR.appendData('SquidADSTemplateNoVersion',0);}\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\nfunction EnableForm{$t}(){\n\tvar ENABLED={$ENABLED};\n\tif(ENABLED==1){return;}\n\t\n\tdocument.getElementById('SquidADSTemplateSmiley-{$t}').disabled=true;\n\tdocument.getElementById('SquidADSTemplateFamily-{$t}').disabled=true;\n\tdocument.getElementById('SquidADSTemplateBackgroundColor-{$t}').disabled=true;\n\tdocument.getElementById('SquidADSTemplateFontColor-{$t}').disabled=true;\n\tdocument.getElementById('SquidADSTemplateNoVersion-{$t}').disabled=true;\n}\nEnableForm{$t}();\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 4
0
function Page()
{
    $ruleid = $_GET["ID"];
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new wifidog_settings($ruleid);
    $wifidog_templates = new wifidog_templates($ruleid);
    $ArticaHotSpotNowPassword = intval($sock->GET_INFO("ArticaHotSpotNowPassword"));
    $ENABLED_REDIRECT_LOGIN = intval($sock->GET_INFO("ENABLED_REDIRECT_LOGIN"));
    $USE_TERMS = intval($sock->GET_INFO("USE_TERMS"));
    $REGISTER_MAX_TIME = $sock->GET_INFO("REGISTER_MAX_TIME");
    $smtp_server_port = intval(trim($sock->GET_INFO("smtp_server_port")));
    if ($smtp_server_port == 0) {
        $smtp_server_port = 25;
    }
    if ($REGISTER_MAX_TIME < 5) {
        $REGISTER_MAX_TIME = 5;
    }
    $Timez[5] = "5 {minutes}";
    $Timez[10] = "10 {minutes}";
    $Timez[15] = "15 {minutes}";
    $Timez[30] = "30 {minutes}";
    $Timez[60] = "1 {hour}";
    $html = "\n\t<div style='width:100%;font-size:30px;margin-bottom:20px'>{self_register} SMS {rule}:{$ruleid}</div>\t\t\n\t<div style='font-size:18px' class=explain>{hotspot_sms_mailexp}</div>\n\t\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{form_message}:</td>\n\t\t<td style='width:860px'><textarea \n\t\t\tstyle='width:100%;height:140px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='SMS_INTRO-{$t}'>" . $wifidog_templates->SMS_INTRO . "</textarea>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{font_size}:</strong></td>\n\t\t<td>" . Field_text("SMS_FONT_SIZE-{$t}", $wifidog_templates->SMS_FONT_SIZE, 'font-size:22px;padding:3px;width:120px') . "</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{field_label}:</strong></td>\n\t\t<td>" . Field_text("SMS_FIELD-{$t}", $wifidog_templates->SMS_FIELD, 'font-size:22px;padding:3px;width:450px') . "</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{button_label}:</strong></td>\n\t\t<td>" . Field_text("SMS_BUTTON-{$t}", $wifidog_templates->SMS_BUTTON, 'font-size:22px;padding:3px;width:450px') . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{wrong_code_message}:</td>\n\t\t<td><textarea \n\t\t\tstyle='width:100%;height:90px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='SMS_CODE_ERROR-{$t}'>" . $wifidog_templates->SMS_CODE_ERROR . "</textarea>\n\t\t</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{smtp_register_subject}:</td>\n\t\t<td style='width:860px'><textarea \n\t\t\tstyle='width:100%;height:40px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='SMS_SMTP_SUBJECT-{$t}'>" . $wifidog_templates->SMS_SMTP_SUBJECT . "</textarea>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{message}:</td>\n\t\t<td><textarea \n\t\t\tstyle='width:100%;height:150px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='SMS_SMTP_BODY-{$t}'>" . $wifidog_templates->SMS_SMTP_BODY . "</textarea>\n\t\t</td>\n\t</tr>\t\n\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{smtp_confirm}:</td>\n\t\t<td style='width:860px'><textarea \n\t\t\tstyle='width:100%;height:140px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='SMS_CONFIRM_MESSAGE-{$t}'>" . $wifidog_templates->SMS_CONFIRM_MESSAGE . "</textarea>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_server_name}:</strong></td>\n\t\t<td>" . Field_text("sms_smtp_server_name-{$t}", trim($sock->GET_INFO("sms_smtp_server_name")), 'font-size:22px;padding:3px;width:450px') . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_server_port}:</strong></td>\n\t\t<td>" . Field_text("sms_smtp_server_port-{$t}", trim($sock->GET_INFO("sms_smtp_server_port")), 'font-size:22px;padding:3px;width:110px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_sender}:</strong></td>\n\t\t<td>" . Field_text("sms_smtp_sender-{$t}", trim($sock->GET_INFO("sms_smtp_sender")), 'font-size:22px;padding:3px;width:450px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{recipient}:</strong></td>\n\t\t<td>" . Field_text("sms_smtp_recipient-{$t}", trim($sock->GET_INFO("sms_smtp_recipient")), 'font-size:22px;padding:3px;width:450px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_auth_user}:</strong></td>\n\t\t<td>" . Field_text("sms_smtp_auth_user-{$t}", trim($sock->GET_INFO("sms_smtp_auth_user")), 'font-size:22px;padding:3px;width:450px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_auth_passwd}:</strong></td>\n\t\t<td>" . Field_password("sms_smtp_auth_passwd-{$t}", trim($sock->GET_INFO("sms_smtp_auth_passwd")), 'font-size:22px;padding:3px;width:450px') . "</td>\n\t\t\t\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{tls_enabled}:</strong></td>\n\t\t<td>" . Field_checkbox_design("sms_tls_enabled-{$t}", 1, $sock->GET_INFO("sms_tls_enabled")) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' colspan=2>\n\t\t\t\t" . button('{test}', "TestSMTP{$t}();", 32) . "&nbsp;" . button('{apply}', "Save{$t}();", 32) . "</td>\n\t</tr>\n\t</table>\n\t<script>\n\t\n\tvar xSave{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\t\$('#HOSTPOT_RULES').flexReload();\n\t}\t\n\t\n\tfunction TestSMTP{$t}(){\n\t\tSave{$t}();\n\t\tLoadjs('{$page}?test-smtp-js=yes&ruleid={$ruleid}');\n\t}\n\t\n\tfunction Save{$t}(){\n\t\tvar pp=encodeURIComponent(document.getElementById('sms_smtp_auth_passwd-{$t}').value);\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('ruleid',{$ruleid});\n\t\tXHR.appendData('SMS_SMTP_BODY',encodeURIComponent(document.getElementById('SMS_SMTP_BODY-{$t}').value));\n\t\tXHR.appendData('SMS_SMTP_SUBJECT',encodeURIComponent(document.getElementById('SMS_SMTP_SUBJECT-{$t}').value));\n\t\tXHR.appendData('SMS_INTRO',encodeURIComponent(document.getElementById('SMS_INTRO-{$t}').value));\n\t\tXHR.appendData('SMS_BUTTON',encodeURIComponent(document.getElementById('SMS_BUTTON-{$t}').value));\n\t\tXHR.appendData('SMS_FIELD',encodeURIComponent(document.getElementById('SMS_FIELD-{$t}').value));\n\t\tXHR.appendData('SMS_CONFIRM_MESSAGE',encodeURIComponent(document.getElementById('SMS_CONFIRM_MESSAGE-{$t}').value));\n\n\t\tXHR.appendData('SMS_FONT_SIZE',encodeURIComponent(document.getElementById('SMS_FONT_SIZE-{$t}').value));\n\t\tXHR.appendData('SMS_CODE_ERROR',encodeURIComponent(document.getElementById('SMS_CODE_ERROR-{$t}').value));\n\t\tif(document.getElementById('sms_tls_enabled-{$t}').checked){XHR.appendData('sms_tls_enabled',1);}else{XHR.appendData('sms_tls_enabled',0); }\n\t\tXHR.appendData('sms_smtp_server_name',encodeURIComponent(document.getElementById('sms_smtp_server_name-{$t}').value));\n\t\tXHR.appendData('sms_smtp_server_port',encodeURIComponent(document.getElementById('sms_smtp_server_port-{$t}').value));\n\t\tXHR.appendData('sms_smtp_sender',encodeURIComponent(document.getElementById('sms_smtp_sender-{$t}').value));\n\t\tXHR.appendData('sms_smtp_recipient',encodeURIComponent(document.getElementById('sms_smtp_recipient-{$t}').value));\n\t\tXHR.appendData('sms_smtp_auth_user',encodeURIComponent(document.getElementById('sms_smtp_auth_user-{$t}').value));\n\t\tXHR.appendData('sms_smtp_auth_passwd',pp);\n\t\tXHR.appendData('smtp_notifications-{$t}','yes');\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t\t\n\t}\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 5
0
function rule_time()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $eth = $_GET["eth"];
    $ethC = new system_nic($eth);
    $table = $_GET["table"];
    $ID = $_GET["ID"];
    $t = time();
    $q = new mysql();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM iptables_main WHERE ID='{$ID}'", "artica_backup"));
    $title = "{time_restriction}: {$eth}::" . $tpl->javascript_parse_text($ligne["rulename"]);
    $enabled = $ligne["enabled"];
    $table = $ligne["MOD"];
    $eth = $ligne["eth"];
    $bt = "{apply}";
    $array_days = array(1 => "monday", 2 => "tuesday", 3 => "wednesday", 4 => "thursday", 5 => "friday", 6 => "saturday", 7 => "sunday");
    $TTIME = unserialize($ligne["time_restriction"]);
    $tr[] = "<table>";
    while (list($num, $maks) = each($array_days)) {
        $tr[] = "<tr>\n\t\t<td class=legend style='font-size:22px'>{{$maks}}</td>\n\t\t<td>" . Field_checkbox_design("D{$num}-{$t}", 1, $TTIME["D{$num}"]) . "</td>\n\t\t\t</tr>";
        $jsF[] = "if(document.getElementById('D{$num}-{$t}').checked){XHR.appendData('D{$num}',1); }else{ XHR.appendData('D{$num}',0); }";
        $jsD[] = "document.getElementById('D{$num}-{$t}').disabled=true;";
        $jsE[] = "document.getElementById('D{$num}-{$t}').disabled=false;";
    }
    $tr[] = "</table>";
    if ($TTIME["ftime"] == null) {
        $TTIME["ftime"] = "20:00:00";
    }
    if ($TTIME["ttime"] == null) {
        $TTIME["ttime"] = "23:59:00";
    }
    $html = "\n\t<div style='font-size:18px' class=explain>{fwtime_explain}</div>\n\t<div style='width:98%' class=form>\n\t<div style='font-size:28px;margin-bottom:25px;margin-top:10px;margin-left:5px'>{$title}</div>\n\t<table style='width:100%'>\n\t<tr>\n\t<td class=legend style='font-size:22px'>{enabled}:</td>\n\t<td style='font-size:16px'>" . Field_checkbox_design("enabled-{$t}", 1, $ligne["enablet"], "EnableCK{$t}()") . "\n\t</tr>\n\t<tr>\n\t\t<tr>\n\t\t<td style='font-size:26px;vertical-align:top'>{hours}:<hr></td>\n\t<td>\n\t<table style='width:325px'>\n\t<td class=legend style='font-size:22px'>{from_time}:</td>\n\t<td style='font-size:16px'>" . field_text("ftime-{$t}", $TTIME["ftime"], "font-size:22px;width:130px;text-align:right") . "\n\t</tr>\n\t<tr>\n\t<td class=legend style='font-size:22px'>{to_time}:</td>\n\t<td style='font-size:16px'>" . field_text("ttime-{$t}", $TTIME["ttime"], "font-size:22px;width:130px;text-align:right") . "\n\t</tr>\n\t</table>\n\t</td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:26px;vertical-align:top'>{days}:<hr></td>\n\t\t<td>" . @implode("", $tr) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", 40) . "</td>\n\t\t</tr>\n\t\t</table>\n\t\t</div>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar res=obj.responseText;\n\tif (res.length>3){alert(res);}\n\t\$('#FIREWALL_NIC_RULES').flexReload();\n}\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('time-save',  '{$ID}');\n\tXHR.appendData('ttime',  document.getElementById('ttime-{$t}').value);\n\tXHR.appendData('ftime',  document.getElementById('ftime-{$t}').value);\n\tif(document.getElementById('enabled-{$t}').checked){ XHR.appendData('enablet',1); }else{ XHR.appendData('enablet',0); }\n\t" . @implode("\n", $jsF) . "\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\nfunction EnableCK{$t}(){\n\tif(document.getElementById('enabled-{$t}').checked){\n\t\tdocument.getElementById('ttime-{$t}').disabled=false;\n\t\tdocument.getElementById('ftime-{$t}').disabled=false;\n\t\t" . @implode("\n", $jsE) . "\n\t}else{\n\t\tdocument.getElementById('ttime-{$t}').disabled=true;\n\t\tdocument.getElementById('ftime-{$t}').disabled=true;\n\t\t" . @implode("\n", $jsD) . "\n}\n\n\n}\n\nEnableCK{$t}();\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 6
0
function Page()
{
    $ruleid = $_GET["ID"];
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new wifidog_settings($ruleid);
    $wifidog_templates = new wifidog_templates($_GET["ruleid"]);
    $ArticaHotSpotNowPassword = intval($sock->GET_INFO("ArticaHotSpotNowPassword"));
    $ENABLED_REDIRECT_LOGIN = intval($sock->GET_INFO("ENABLED_REDIRECT_LOGIN"));
    $USE_TERMS = intval($sock->GET_INFO("USE_TERMS"));
    $REGISTER_MAX_TIME = $sock->GET_INFO("REGISTER_MAX_TIME");
    $smtp_server_port = intval(trim($sock->GET_INFO("smtp_server_port")));
    if ($smtp_server_port == 0) {
        $smtp_server_port = 25;
    }
    if ($REGISTER_MAX_TIME < 5) {
        $REGISTER_MAX_TIME = 5;
    }
    $Timez[5] = "5 {minutes}";
    $Timez[10] = "10 {minutes}";
    $Timez[15] = "15 {minutes}";
    $Timez[30] = "30 {minutes}";
    $Timez[60] = "1 {hour}";
    $html = "\n\t<div style='width:100%;font-size:30px;margin-bottom:20px'>{self_register} SMTP</div>\t\t\n\t<div style='width:98%' class=form>\n\t\t\t\n" . Paragraphe_switch_img("{enable_hotspot_smtp}", "{enable_hotspot_smtp_explain}", "ENABLED_SMTP-{$t}", intval($sock->GET_INFO("ENABLED_SMTP")), null, 1090) . "\t\t\t\n\t\t\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' style='width:600px'>{max_time_register}:</td>\n\t\t<td>" . Field_array_Hash($Timez, "REGISTER_MAX_TIME-{$t}", $REGISTER_MAX_TIME, "style:font-size:22px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{smtp_register_message}:</td>\n\t\t<td><textarea \n\t\t\tstyle='width:100%;height:150px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='REGISTER_MESSAGE-{$t}'>{$wifidog_templates->REGISTER_MESSAGE}</textarea>\n\t\t</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{smtp_register_subject}:</td>\n\t\t<td style='width:860px'><textarea \n\t\t\tstyle='width:100%;height:40px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='REGISTER_SUBJECT-{$t}'>{$wifidog_templates->REGISTER_SUBJECT}</textarea>\n\t\t</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{smtp_confirm}:</td>\n\t\t<td style='width:860px'><textarea \n\t\t\tstyle='width:100%;height:40px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='CONFIRM_MESSAGE-{$t}'>{$wifidog_templates->CONFIRM_MESSAGE}</textarea>\n\t\t</td>\n\t</tr>\n\t\n\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{lost_password_text}:</td>\n\t\t<td style='width:860px'><textarea \n\t\t\tstyle='width:100%;height:40px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='LostPasswordLink-{$t}'>{$wifidog_templates->LostPasswordLink}</textarea>\n\t\t</td>\n\t</tr>\n\t\n\t\n\t\t\t\t\t\n\t\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_server_name}:</strong></td>\n\t\t<td>" . Field_text("smtp_server_name-{$t}", trim($sock->GET_INFO("smtp_server_name")), 'font-size:22px;padding:3px;width:450px') . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_server_port}:</strong></td>\n\t\t<td>" . Field_text("smtp_server_port-{$t}", $smtp_server_port, 'font-size:22px;padding:3px;width:110px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_sender}:</strong></td>\n\t\t<td>" . Field_text("smtp_sender-{$t}", trim($sock->GET_INFO("smtp_sender")), 'font-size:22px;padding:3px;width:450px') . "</td>\n\t</tr>\n\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_auth_user}:</strong></td>\n\t\t<td>" . Field_text("smtp_auth_user-{$t}", trim($sock->GET_INFO("smtp_auth_user")), 'font-size:22px;padding:3px;width:450px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{smtp_auth_passwd}:</strong></td>\n\t\t<td>" . Field_password("smtp_auth_passwd-{$t}", trim($sock->GET_INFO("smtp_auth_passwd")), 'font-size:22px;padding:3px;width:450px') . "</td>\n\t\t\t\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:22px'>{tls_enabled}:</strong></td>\n\t\t<td>" . Field_checkbox_design("tls_enabled-{$t}", 1, $sock->GET_INFO("tls_enabled")) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' colspan=2>\n\t\t\t\t" . button('{test}', "TestSMTP{$t}();", 32) . "&nbsp;" . button('{apply}', "Save{$t}();", 32) . "</td>\n\t</tr>\n\t</table>\n\t<script>\n\t\n\tvar xSave{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\t\$('#HOSTPOT_RULES').flexReload();\n\t}\t\n\t\n\tfunction TestSMTP{$t}(){\n\t\tSave{$t}();\n\t\tLoadjs('{$page}?test-smtp-js=yes&ruleid={$ruleid}');\n\t}\n\t\n\tfunction Save{$t}(){\n\t\tvar pp=encodeURIComponent(document.getElementById('smtp_auth_passwd-{$t}').value);\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('ruleid',{$ruleid});\n\t\tXHR.appendData('ENABLED_SMTP',encodeURIComponent(document.getElementById('ENABLED_SMTP-{$t}').value));\n\t\tXHR.appendData('REGISTER_SUBJECT',encodeURIComponent(document.getElementById('REGISTER_SUBJECT-{$t}').value));\n\t\tXHR.appendData('REGISTER_MESSAGE',encodeURIComponent(document.getElementById('REGISTER_MESSAGE-{$t}').value));\n\t\tXHR.appendData('LostPasswordLink',encodeURIComponent(document.getElementById('LostPasswordLink-{$t}').value));\n\t\tXHR.appendData('REGISTER_MAX_TIME',encodeURIComponent(document.getElementById('REGISTER_MAX_TIME-{$t}').value));\n\t\tXHR.appendData('CONFIRM_MESSAGE',encodeURIComponent(document.getElementById('CONFIRM_MESSAGE-{$t}').value));\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(document.getElementById('tls_enabled-{$t}').checked){XHR.appendData('tls_enabled',1);}else{XHR.appendData('tls_enabled',0); }\n\t\tXHR.appendData('smtp_server_name',encodeURIComponent(document.getElementById('smtp_server_name-{$t}').value));\n\t\tXHR.appendData('smtp_server_port',encodeURIComponent(document.getElementById('smtp_server_port-{$t}').value));\n\t\tXHR.appendData('smtp_sender',encodeURIComponent(document.getElementById('smtp_sender-{$t}').value));\n\t\tXHR.appendData('smtp_auth_user',encodeURIComponent(document.getElementById('smtp_auth_user-{$t}').value));\n\t\tXHR.appendData('smtp_auth_passwd',pp);\n\t\tXHR.appendData('smtp_notifications-{$t}','yes');\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t\t\n\t}\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
function Page()
{
    $ruleid = $_GET["ID"];
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new wifidog_settings($ruleid);
    $ArticaHotSpotNowPassword = intval($sock->GET_INFO("ArticaHotSpotNowPassword"));
    $ENABLED_REDIRECT_LOGIN = intval($sock->GET_INFO("ENABLED_REDIRECT_LOGIN"));
    $ArticaSplashHotSpotEndTime = intval($sock->GET_INFO("ArticaSplashHotSpotEndTime"));
    $ENABLED_META_LOGIN = intval($sock->GET_INFO("ENABLED_META_LOGIN"));
    $USE_TERMS = intval($sock->GET_INFO("USE_TERMS"));
    $ArticaSplashHotSpotCacheAuth = intval($sock->GET_INFO("ArticaSplashHotSpotCacheAuth"));
    $USE_MYSQL = intval($sock->GET_INFO("USE_MYSQL"));
    $USE_ACTIVEDIRECTORY = intval($sock->GET_INFO("USE_ACTIVEDIRECTORY"));
    $Timez[0] = "{unlimited}";
    $Timez[30] = "30 {minutes}";
    $Timez[60] = "1 {hour}";
    $Timez[120] = "2 {hours}";
    $Timez[180] = "3 {hours}";
    $Timez[360] = "6 {hours}";
    $Timez[720] = "12 {hours}";
    $Timez[1440] = "1 {day}";
    $Timez[2880] = "2 {days}";
    $Timez[10080] = "1 {week}";
    $Timez[20160] = "2 {weeks}";
    $Timez[40320] = "1 {month}";
    $ENABLED_AUTO_LOGIN = intval($sock->GET_INFO("ENABLED_AUTO_LOGIN"));
    $USE_ACTIVEDIRECTORY = intval($sock->GET_INFO("USE_ACTIVEDIRECTORY"));
    $ALLOW_RECOVER_PASS = intval($sock->GET_INFO("ALLOW_RECOVER_PASS"));
    $DO_NOT_AUTENTICATE = intval($sock->GET_INFO("DO_NOT_AUTENTICATE"));
    $LIMIT_BY_SIZE = intval($sock->GET_INFO("LIMIT_BY_SIZE"));
    $LANDING_PAGE = $sock->GET_INFO("LANDING_PAGE");
    $LOST_LANDING_PAGE = $sock->GET_INFO("LOST_LANDING_PAGE");
    $MACWHITE = intval($sock->GET_INFO("MACWHITE"));
    $SMS_REGISTER = intval($sock->GET_INFO("SMS_REGISTER"));
    $BOUNCE_AUTH = intval($sock->GET_INFO("BOUNCE_AUTH"));
    $TOS_VALUE = intval($sock->GET_INFO("TOS_VALUE"));
    if ($LOST_LANDING_PAGE == null) {
        $LOST_LANDING_PAGE = "http://articatech.net";
    }
    $ArticaSplashHotSpotRemoveAccount = intval($sock->GET_INFO("ArticaSplashHotSpotRemoveAccount"));
    if ($ENABLED_AUTO_LOGIN == 1) {
        $ENABLED_SMTP = intval($sock->GET_INFO("ENABLED_SMTP"));
        if ($ENABLED_SMTP == 0) {
            echo $tpl->_ENGINE_parse_body("<p class=text-error>{HOTSPOT_ENABLED_AUTO_LOGIN_SMTP_DISABLED}</p>");
        } else {
            $smtp_server_name = trim($sock->GET_INFO("smtp_server_name"));
            $smtp_server_port = intval(trim($sock->GET_INFO("smtp_server_port")));
            $smtp_sender = trim($sock->GET_INFO("smtp_sender"));
            if ($smtp_server_name == null or $smtp_sender == null) {
                echo $tpl->_ENGINE_parse_body("<p class=text-error>{HOTSPOT_ENABLED_AUTO_LOGIN_SMTP_SETTINGS}</p>");
            }
        }
    }
    $ayDscp = array(0 => '{default}', 8 => '0x20', 10 => '0x28', 12 => '0x30', 14 => '0x38', 16 => '0x40', 18 => '0x48', 20 => '0x50', 22 => '0x58', 24 => '0x60', 26 => '0x68', 28 => '0x70', 30 => '0x78', 32 => '0x80', 34 => '0x88', 36 => '0x90', 38 => '0x98', 40 => '0xA0', 46 => '0xB8', 48 => '0xC0', 56 => '0xE0');
    $html = "<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{use_terme_of_use}:</td>\n\t\t<td>" . Field_checkbox_design("USE_TERMS-{$t}", 1, $USE_TERMS) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{send_accounts_to_meta_server}", "{send_accounts_to_meta_server_explain}") . ":</td>\n\t\t<td>" . Field_checkbox_design("ENABLED_META_LOGIN-{$t}", 1, $ENABLED_META_LOGIN) . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{allow_recover_password}", "{allow_recover_password_explain_hotspot}") . ":</td>\n\t\t<td>" . Field_checkbox_design("ALLOW_RECOVER_PASS-{$t}", 1, $ALLOW_RECOVER_PASS) . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{lost_landing_page}", "{lost_landing_page_explain}") . ":</td>\n\t\t<td>" . Field_text("LOST_LANDING_PAGE-{$t}", $LOST_LANDING_PAGE, "font-size:22px;width:350px") . "</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{landing_page}", "{landing_page_hotspot_explain}") . ":</td>\n\t\t<td>" . Field_text("LANDING_PAGE-{$t}", $LANDING_PAGE, "font-size:22px;width:350px") . "</td>\n\t</tr>\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>{re_authenticate_each} ({default}):</td>\n\t\t<td style='font-size:18px'>" . Field_array_Hash($Timez, "ArticaSplashHotSpotCacheAuth-{$t}", $ArticaSplashHotSpotCacheAuth, null, null, 0, "font-size:22px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>" . texttooltip("{re_authenticate_each}", "{re_authenticate_each_hotspot_size}") . ":</td>\n\t\t<td style='font-size:18px'>" . Field_text("LIMIT_BY_SIZE-{$t}", $LIMIT_BY_SIZE, "font-size:22px;width:120px") . "&nbsp;MB</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>" . texttooltip("{tcp_outgoing_tos}", "{HOTSPOT_TOS_VALUE_EXPLAIN}") . ":</td>\n\t\t<td>" . Field_array_Hash($ayDscp, "TOS_VALUE-{$t}", $TOS_VALUE, 'style:font-size:22px;') . "</td>\n\t</tr>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>" . texttooltip("{disable_account_in} ({default})", "{ArticaSplashHotSpotEndTime_explain}") . ":</td>\n\t\t<td style='font-size:18px'>" . Field_array_Hash($Timez, "ArticaSplashHotSpotEndTime-{$t}", $ArticaSplashHotSpotEndTime, null, null, 0, "font-size:22px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>" . texttooltip("{remove_account_in} ({default})", "{ArticaSplashHotSpotRemoveAccount_explain}") . ":</td>\n\t\t<td style='font-size:18px'>" . Field_array_Hash($Timez, "ArticaSplashHotSpotRemoveAccount-{$t}", $ArticaSplashHotSpotRemoveAccount, null, null, 0, "font-size:22px") . "</td>\n\t</tr>\n\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>" . texttooltip("{bounce_if_already_authenticated}", "{bounce_if_already_authenticated_hotspot}") . ":</td>\n\t\t<td>" . Field_checkbox_design("BOUNCE_AUTH-{$t}", 1, $BOUNCE_AUTH) . "</td>\n\t</tr>\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>" . texttooltip("{save_computer_in_whitelist}", "{save_computer_in_whitelist_hotspot}") . ":</td>\n\t\t<td>" . Field_checkbox_design("MACWHITE-{$t}", 1, $MACWHITE) . "</td>\n\t</tr>\t\t\t\t\t\n\t\t\t\t\n\n\t<tr><td colspan=2 style='font-size:30px'>{authentication}</td></tr>\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{DO_NOT_AUTENTICATE}", "{DO_NOT_AUTENTICATE_HOTSPOT_EXPLAIN}") . ":</td>\n\t\t<td>" . Field_checkbox_design("DO_NOT_AUTENTICATE-{$t}", 1, $DO_NOT_AUTENTICATE) . "</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{use_local_database}", "{hotspot_use_local_database}") . ":</td>\n\t\t<td>" . Field_checkbox_design("USE_MYSQL-{$t}", 1, $USE_MYSQL) . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{use_active_directory}", "{hotspot_use_active_directory}") . ":</td>\n\t\t<td>" . Field_checkbox_design("USE_ACTIVEDIRECTORY-{$t}", 1, $USE_ACTIVEDIRECTORY) . "</td>\n\t</tr>\t\t\t\t\n\t\t\t\t\n\t<tr><td colspan=2 style='font-size:30px'>{self_register}</td></tr>\t\t\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>" . texttooltip("{enable_hotspot_autologin}", "{enable_hotspot_autologin_explain}") . ":</td>\n\t\t<td>" . Field_checkbox_design("ENABLED_AUTO_LOGIN-{$t}", 1, intval($sock->GET_INFO("ENABLED_AUTO_LOGIN"))) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>" . texttooltip("{enable_hotspot_sms}", "{enable_hotspot_sms_explain}") . ":</td>\n\t\t<td>" . Field_checkbox_design("SMS_REGISTER-{$t}", 1, $SMS_REGISTER) . "</td>\n\t</tr>\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>" . texttooltip("{enable_confirmation_establish_session}", "{enable_confirmation_establish_session_explain}") . ":</td>\n\t\t<td>" . Field_checkbox_design("ENABLED_REDIRECT_LOGIN-{$t}", 1, $ENABLED_REDIRECT_LOGIN) . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px;text-transform:capitalize'>{remove_password_field}:</td>\n\t\t<td>" . Field_checkbox_design("ArticaHotSpotNowPassword-{$t}", 1, $ArticaHotSpotNowPassword) . "</td>\n\t</tr>\t\t\t\t\n\n\t\t\t\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", "42px") . "</td>\n\t</tr>\n\t</table>\n\t<script>\n\t\n\tvar xSave{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\t\$('#HOSTPOT_RULES').flexReload();\n\t\tRefreshTab('HOTSPOT_TAB');\n\t\t\n\t}\t\n\t\n\tfunction Save{$t}(){\n\t\t\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('ruleid',{$ruleid});\n\t\t\n\t\t\n\t\tif(document.getElementById('ArticaHotSpotNowPassword-{$t}').checked){XHR.appendData('ArticaHotSpotNowPassword',1);}else{XHR.appendData('ArticaHotSpotNowPassword',0); }\n\t\tif(document.getElementById('USE_TERMS-{$t}').checked){XHR.appendData('USE_TERMS',1); }else{ XHR.appendData('USE_TERMS',0); }\t\t\n\t\tif(document.getElementById('ENABLED_REDIRECT_LOGIN-{$t}').checked){XHR.appendData('ENABLED_REDIRECT_LOGIN',1); }else{ XHR.appendData('ENABLED_REDIRECT_LOGIN',0); }\n\t\tif(document.getElementById('ENABLED_AUTO_LOGIN-{$t}').checked){XHR.appendData('ENABLED_AUTO_LOGIN',1); }else{ XHR.appendData('ENABLED_AUTO_LOGIN',0); }\n\t\tif(document.getElementById('ENABLED_META_LOGIN-{$t}').checked){XHR.appendData('ENABLED_META_LOGIN',1); }else{ XHR.appendData('ENABLED_META_LOGIN',0); }\n\t\tif(document.getElementById('ALLOW_RECOVER_PASS-{$t}').checked){XHR.appendData('ALLOW_RECOVER_PASS',1); }else{ XHR.appendData('ALLOW_RECOVER_PASS',0); }\n\t\tif(document.getElementById('DO_NOT_AUTENTICATE-{$t}').checked){XHR.appendData('DO_NOT_AUTENTICATE',1); }else{ XHR.appendData('DO_NOT_AUTENTICATE',0); }\n\t\tif(document.getElementById('USE_MYSQL-{$t}').checked){XHR.appendData('USE_MYSQL',1); }else{ XHR.appendData('USE_MYSQL',0); }\n\t\tif(document.getElementById('USE_ACTIVEDIRECTORY-{$t}').checked){XHR.appendData('USE_ACTIVEDIRECTORY',1); }else{ XHR.appendData('USE_ACTIVEDIRECTORY',0); }\n\t\tif(document.getElementById('SMS_REGISTER-{$t}').checked){XHR.appendData('SMS_REGISTER',1); }else{ XHR.appendData('SMS_REGISTER',0); }\n\t\tif(document.getElementById('MACWHITE-{$t}').checked){XHR.appendData('MACWHITE',1); }else{ XHR.appendData('MACWHITE',0); }\n\t\tif(document.getElementById('BOUNCE_AUTH-{$t}').checked){XHR.appendData('BOUNCE_AUTH',1); }else{ XHR.appendData('BOUNCE_AUTH',0); }\n\t\tXHR.appendData('TOS_VALUE',document.getElementById('TOS_VALUE-{$t}').value);\n\t\tXHR.appendData('ArticaSplashHotSpotCacheAuth',document.getElementById('ArticaSplashHotSpotCacheAuth-{$t}').value);\n\t\tXHR.appendData('ArticaSplashHotSpotEndTime',document.getElementById('ArticaSplashHotSpotEndTime-{$t}').value);\n\t\tXHR.appendData('ArticaSplashHotSpotRemoveAccount',document.getElementById('ArticaSplashHotSpotRemoveAccount-{$t}').value);\n\t\tXHR.appendData('LIMIT_BY_SIZE',document.getElementById('LIMIT_BY_SIZE-{$t}').value);\n\t\t\n\t\tXHR.appendData('LOST_LANDING_PAGE',document.getElementById('LOST_LANDING_PAGE-{$t}').value);\n\t\tXHR.appendData('LANDING_PAGE',document.getElementById('LANDING_PAGE-{$t}').value);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t\t\n\t}\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $html = "<div style='font-size:18px' class=explain>{mysql_hotspot_members_import_explain}</div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{delete_old_items}", "{delete_old_items_table_explain}") . ":</td>\n\t\t<td>" . Field_checkbox_design("DeleteOld-{$t}", 1, 0) . "</td>\n\t</tr>\n\t<tr>\n\t\t\n\t\t\n\t\t<td colspan=2><textarea \n\t\t\tstyle='width:100%;height:350px;font-size:18px !important;border:4px solid #CCCCCC;font-family:\"Courier New\",\n\t\t\tCourier,monospace;background-color:white;color:black' id='IMPORT-{$t}'></textarea>\n\t\t</td>\n\t</tr>\t\n\t<tr>\n\t\t<td align='right' colspan=2>" . button('{import}', "Save{$t}();", 32) . "</td>\n\t</tr>\n\t</table>\n\t</div>\t\t\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#flexRT{$_GET["t"]}').flexReload();\n\tYahooWin3Hide();\n}\n\nfunction Save{$t}(){\t\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('IMPORT',document.getElementById('IMPORT-{$t}').value);\n\tif(document.getElementById('DeleteOld-{$t}').checked){XHR.appendData('DeleteOld',1);}else {XHR.appendData('DeleteOld',0);}\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\t\n</script>\t\t\t\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 9
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = $_GET["t"];
    $tt = time();
    $html = "\n\t<div id='id-final-{$t}'>\n\t<div id='serverkerb-{$tt}'></div>\n\t\t<div style='width:98%' class=form>\n\t\t<div style='font-size:30px;margin-bottom:20px'>{delete_all_acls}</div>\n\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px'>{delete_associated_groups}:</td>\n\t\t\t\t\t<td>" . Field_checkbox_design("DeleteGroups-{$t}", 1, 0) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2 align='right'><hr>" . button("{delete}", "Save{$tt}()", 28) . "</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</div>\n\t</div>\n\t<script>\n\tvar x_Save{$tt}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tdocument.getElementById('serverkerb-{$tt}').innerHTML='';\n\t\t\n\t\t\$('#table-{$t}').flexReload();\n\t\tif(results.length>3){\n\t\t\tdocument.getElementById('id-final-{$t}').innerHTML=\"<textarea style='margin-top:5px;font-family:Courier New;font-weight:bold;width:100%;height:520px;border:5px solid #8E8E8E;overflow:auto;font-size:11.5px' id='mibtxt{$t}'>\"+results+\"</textarea>\";\n\t\t}else{\n\t\t\tYahooWin2Hide();\n\t\t}\n\t\t\n\t}\n\t\n\tfunction Save{$tt}(){\n\t\tvar XHR = new XHRConnection();\n\t\tvar DeleteGroups=0;\n\t\tif(document.getElementById('DeleteGroups-{$t}').checked){DeleteGroups=1;}\n\t\tXHR.appendData('DeleteGroups',DeleteGroups);\n\t\tAnimateDiv('serverkerb-{$tt}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_Save{$tt});\n\t\n\t}\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 10
0
function main()
{
    $page = CurrentPageName();
    $user = new usersMenus();
    $round = new roundcube();
    $artica = new artica_general();
    $sock = new sockets();
    $debug_levela = array(1 => "log", 2 => "report", 4 => "show", 8 => "trace");
    $tpl = new templates();
    $RoundCubeHTTPSPort = intval($sock->GET_INFO("RoundCubeHTTPSPort"));
    $RoundCubeHTTPPort = intval($sock->GET_INFO("RoundCubeHTTPPort"));
    if ($RoundCubeHTTPSPort == 0) {
        $RoundCubeHTTPSPort = 449;
    }
    if ($RoundCubeHTTPPort == 0) {
        $RoundCubeHTTPPort = 8888;
    }
    $RoundCubeHTTPEngineEnabled = intval($sock->GET_INFO("RoundCubeHTTPEngineEnabled"));
    $RoundCubeUseSSL = intval($sock->GET_INFO("RoundCubeUseSSL"));
    $RoundCubeEnableLDAP = intval($sock->GET_INFO("RoundCubeEnableLDAP"));
    $RoundCubeUserLink = $sock->GET_INFO("RoundCubeUserLink");
    if ($RoundCubeUserLink == null) {
        $RoundCubeUserLink = "http://{$_SERVER["SERVER_NAME"]}:{$RoundCubeHTTPPort}";
        $sock->SET_INFO("RoundCubeUserLink", "http://{$_SERVER["SERVER_NAME"]}:{$RoundCubeHTTPPort}");
    }
    $RoundCubeDebugLevel = intval($sock->GET_INFO("RoundCubeDebugLevel"));
    $debug_level = Field_array_Hash($debug_levela, 'RoundCubeDebugLevel', $RoundCubeDebugLevel, "style:font-size:22px");
    $RoundCubeEnableCaching = intval($sock->GET_INFO("RoundCubeEnableCaching"));
    $RoundCubeAutoCreateuser = intval($sock->GET_INFO("RoundCubeAutoCreateuser"));
    $RoundCubeDefaultHost = $sock->GET_INFO("RoundCubeDefaultHost");
    if ($RoundCubeDefaultHost == null) {
        $RoundCubeDefaultHost = "127.0.0.1";
    }
    $RoundCubeSievePort = $sock->GET_INFO("RoundCubeSievePort");
    if ($RoundCubeSievePort == null) {
        $RoundCubeSievePort = $round->SieveListenIp . ":4190";
    }
    $RoundCubeUploadMaxFilesize = intval($sock->GET_INFO("RoundCubeUploadMaxFilesize"));
    if ($RoundCubeUploadMaxFilesize == 0) {
        $RoundCubeUploadMaxFilesize = 128;
    }
    $RoundeCubeLocalString = $sock->GET_INFO("RoundeCubeLocalString");
    if ($RoundeCubeLocalString == null) {
        $RoundeCubeLocalString = "us";
    }
    $RoundCubeProductName = $sock->GET_INFO("RoundCubeProductName");
    if ($RoundCubeProductName == null) {
        $RoundCubeProductName = "RoundCube Webmail for Artica";
    }
    $RoundCubeSkipDeleted = intval($sock->GET_INFO("RoundCubeSkipDeleted"));
    $RoundCubeFlagForDeletion = intval($sock->GET_INFO("RoundCubeFlagForDeletion"));
    $t = time();
    $html = "\n\t<form name='FFM1'>\n\t<div id='wait'></div>\n\t<div style='width:99%' class=form>\n\t<table style='width:99%'>\n\t<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{RoundCubePath}:</strong></td>\n\t<td valign='top' nowrap align='left'><strong style='font-size:22px'>{$user->roundcube_folder}</td>\n\t</tr>\n\t<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{roundcube_web_folder}:</strong></td>\n\t<td valign='top' nowrap align='left'><strong style='font-size:22px'>{$user->roundcube_web_folder}</td>\n\t</tr>\n\t<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{listen_port} SSL:</strong></td>\n\t<td valign='top' nowrap align='left'>" . Field_text('RoundCubeHTTPSPort', $RoundCubeHTTPSPort, 'width:110px;font-size:22px') . "</td>\n\t</tr>\n\t<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{listen_port} HTPP:</strong></td>\n\t<td valign='top' nowrap align='left'>" . Field_text('RoundCubeHTTPPort', $RoundCubeHTTPPort, 'width:110px;font-size:22px') . "</td>\n\t</tr>\t\t\t\n\t<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{UseSSL}:</strong></td>\n\t<td valign='top' nowrap align='left'>" . Field_checkbox_design('RoundCubeUseSSL', 1, $RoundCubeUseSSL) . "</td>\n\t</tr>\n<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{user_link}:</strong></td>\n\t<td valign='top' nowrap align='left'>" . Field_text('RoundCubeUserLink', $RoundCubeUserLink, 'width:595px;font-size:22px') . "</td>\n</tr>\n<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{roundcube_ldap_directory}:</strong></td>\n\t<td valign='top' nowrap align='left'>" . Field_checkbox_design('RoundCubeEnableLDAP', 1, $RoundCubeEnableLDAP) . "</td>\n</tr>\t\n<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{debug_level}:</strong></td>\n\t<td valign='top' nowrap align='left'><strong>{$debug_level}</td>\n</tr>\n<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{enable_caching}:</strong></td>\n\t<td valign='top' nowrap align='left'>" . Field_checkbox_design('RoundCubeEnableCaching', 1, $RoundCubeEnableCaching) . "</td>\n</tr>\n<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{upload_max_filesize}:</strong></td>\n\t<td valign='top' nowrap align='left' style='font-size:22px'>" . Field_text('RoundCubeUploadMaxFilesize', $RoundCubeUploadMaxFilesize, 'width:90px;font-size:22px') . "M</td>\n</tr>\n\n\t\t\n<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>{auto_create_user}:</strong></td>\n\t<td valign='top' nowrap align='left'>" . Field_checkbox_design('RoundCubeAutoCreateuser', 1, $RoundCubeAutoCreateuser) . "</td>\n</tr>\n<tr>\n\t<td align='right' class=legend style='font-size:22px'>{default_host}:</strong></td>\n\t<td>" . Field_text('RoundCubeDefaultHost', $RoundCubeDefaultHost, 'width:230px;font-size:22px') . "</td>\n</tr>\n\n<tr>\n\t<td valign='top' nowrap align='right' class=legend style='font-size:22px'>Sieve:</strong></td>\n\t<td valign='top' nowrap align='left' style='font-size:22px'>" . Field_text('RoundCubeSievePort', $RoundCubeSievePort, 'width:190px;font-size:22px') . "</td>\n</tr>\n\n<tr>\n\t<td align='right' class=legend style='font-size:22px'>{locale_string}:</strong></td>\n\t<td>" . Field_text('RoundeCubeLocalString', trim($RoundeCubeLocalString), 'width:60px;font-size:22px') . "</td>\n</tr>\t\t\n\t\t\n<tr>\n\t<td align='right' class=legend style='font-size:22px'>{product_name}:</strong></td>\n\t<td>" . Field_text('RoundCubeProductName', trim($RoundCubeProductName), 'width:550px;font-size:22px') . "</td>\n</tr>\t\n<tr>\n\t<td align='right' class=legend style='font-size:22px'>{skip_deleted}:</strong></td>\n\t<td>" . Field_checkbox_design('RoundCubeSkipDeleted', 1, $RoundCubeSkipDeleted) . "</td>\n</tr>\n<tr>\n\t<td align='right' class=legend style='font-size:22px'>{flag_for_deletion}:</strong></td>\n\t<td style='padding-left:-3px'>\n\t<table style='width:100%;margin-left:-4px;padding:0px'>\n\t<tr>\n\t<td width=1%  valign='top' style='padding-left:-3px'>\n\t" . Field_checkbox_design('RoundCubeFlagForDeletion', 1, $RoundCubeFlagForDeletion) . "</td>\n\t<td valign='center' >" . help_icon('{flag_for_deletion_text}', true) . "</td>\n\t</tr>\n\t</table>\n\t</td>\n</tr>\t\t\t\n\t\t\t\n\t\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'>\n\t\t\t" . button('{apply}', "SaveRoundCubeForm{$t}()", 40) . "\n\t</tr>\n\t\t\t</table>\n\t</form>\n</div>\n\t\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\t\t\nvar X_SaveRoundCubeForm{$t}= function (obj) {\n}\n\t\t\t\t\t\t\t\t\nfunction SaveRoundCubeForm{$t}(){\n\tvar XHR = new XHRConnection();\n\t\n\tif(document.getElementById('RoundCubeUseSSL').checked){XHR.appendData('RoundCubeUseSSL','1');}else{XHR.appendData('RoundCubeUseSSL','0');}\n\tif(document.getElementById('RoundCubeEnableLDAP').checked){XHR.appendData('RoundCubeEnableLDAP','1');}else{XHR.appendData('RoundCubeEnableLDAP','0');}\n\tif(document.getElementById('RoundCubeEnableCaching').checked){XHR.appendData('RoundCubeEnableCaching','1');}else{XHR.appendData('RoundCubeEnableCaching','0');}\n\tif(document.getElementById('RoundCubeSkipDeleted').checked){XHR.appendData('RoundCubeSkipDeleted','1');}else{XHR.appendData('RoundCubeSkipDeleted','0');}\n\tif(document.getElementById('RoundCubeFlagForDeletion').checked){XHR.appendData('RoundCubeFlagForDeletion','1');}else{XHR.appendData('RoundCubeFlagForDeletion','0');}\n\t\n\t\n\t\n\tXHR.appendData('RoundCubeProductName',document.getElementById('RoundCubeProductName').value);\n\tXHR.appendData('RoundCubeUploadMaxFilesize',document.getElementById('RoundCubeUploadMaxFilesize').value);\n\tXHR.appendData('RoundCubeSievePort',document.getElementById('RoundCubeSievePort').value);\n\tXHR.appendData('RoundeCubeLocalString',document.getElementById('RoundeCubeLocalString').value);\n\tXHR.appendData('RoundCubeDebugLevel',document.getElementById('RoundCubeDebugLevel').value);\n\tXHR.appendData('RoundCubeUserLink',document.getElementById('RoundCubeUserLink').value);\n\tXHR.appendData('RoundCubeHTTPSPort',document.getElementById('RoundCubeHTTPSPort').value);\n\tXHR.appendData('RoundCubeHTTPPort',document.getElementById('RoundCubeHTTPPort').value);\n\tXHR.sendAndLoad('{$page}', 'POST',X_SaveRoundCubeForm{$t});\n\t}\n</script>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 11
0
function popup_settings()
{
    $t = $_GET["t"];
    $sock = new sockets();
    $Key = md5("SMTPTESTS-{$_GET["servername"]}&ou={$_GET["ou"]}");
    $datas = unserialize(base64_decode($sock->GET_INFO($Key)));
    $page = CurrentPageName();
    $tpl = new templates();
    $html = "\n\t<div id='params-{$t}' style='text-align:right'><strong>Key:{$Key}</strong></div>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{smtp_sender}:</strong></td>\n\t\t<td>" . Field_text("smtp_sender-{$t}", trim($datas["smtp_sender"]), 'font-size:18px;padding:3px;width:100%') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{recipient}:</strong></td>\n\t\t<td>" . Field_text("smtp_dest-{$t}", trim($datas["smtp_dest"]), 'font-size:18px;padding:3px;width:100%') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{use_local_service}:</strong></td>\n\t\t<td>" . Field_checkbox_design("smtp_local-{$t}", 1, $datas["smtp_local"], "smtp_localcheck()") . "</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{relay}:</strong></td>\n\t\t<td>" . Field_text("relay-{$t}", trim($datas["relay"]), 'font-size:18px;padding:3px;width:100%') . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{authenticate}:</strong></td>\n\t\t<td>" . Field_checkbox_design("smtp_auth-{$t}", 1, $datas["smtp_auth"], "smtp_authCheck()") . "</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{smtp_auth_user}:</strong></td>\n\t\t<td>" . Field_text("smtp_auth_user-{$t}", trim($datas["smtp_auth_user"]), 'font-size:18px;padding:3px;width:150px') . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:18px'>{smtp_auth_passwd}:</strong></td>\n\t\t<td>" . Field_password("smtp_auth_passwd-{$t}", trim($datas["smtp_auth_passwd"]), 'font-size:18px;padding:3px;width:150px') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{save_and_send}", "SaveTestSend()", 35) . "</td>\n\t</tr>\n\t</table>\n\t<script>\n\tvar x_SaveTestSend= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tdocument.getElementById('params-{$t}').innerHTML='';\n\t\tif(results.length>0){alert(results);return;}\n\t\t\$('#flexRT{$t}').flexReload();\n\t\tYahooWin3Hide();\n\t}\n\t\n\tfunction smtp_localcheck(){\n\t\tdocument.getElementById('relay-{$t}').disabled=false;\n\t\tif(document.getElementById('smtp_local-{$t}').checked){\n\t\t\tdocument.getElementById('relay-{$t}').disabled=true;\n\t\t\t}\n\t}\n\t\n\tfunction smtp_authCheck(){\n\t\tdocument.getElementById('smtp_auth_user-{$t}').disabled=true;\n\t\tdocument.getElementById('smtp_auth_passwd-{$t}').disabled=true;\n\t\t\n\t\t\n\t\tif(document.getElementById('smtp_auth-{$t}').checked){\n\t\t\tdocument.getElementById('smtp_auth_user-{$t}').disabled=false;\n\t\t\tdocument.getElementById('smtp_auth_passwd-{$t}').disabled=false;\t\t\n\t\t}\n\t}\n\n\tfunction SaveTestSend(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('smtp_auth-{$t}').checked){XHR.appendData('smtp_auth',1);}else {XHR.appendData('smtp_auth',0);}\n\t\tif(document.getElementById('smtp_local-{$t}').checked){XHR.appendData('smtp_local',1);}else {XHR.appendData('smtp_local',0);}\n\t\tvar pp=encodeURIComponent(document.getElementById('smtp_auth_passwd-{$t}').value);\n\t\tXHR.appendData('relay',document.getElementById('relay-{$t}').value);\n\t\tXHR.appendData('smtp_sender',document.getElementById('smtp_sender-{$t}').value);\n\t\tXHR.appendData('smtp_dest',document.getElementById('smtp_dest-{$t}').value);\n\t\tXHR.appendData('smtp_sender',document.getElementById('smtp_sender-{$t}').value);\n\t\tXHR.appendData('smtp_auth_user',document.getElementById('smtp_auth_user-{$t}').value);\n\t\tXHR.appendData('servername','{$_GET["servername"]}');\n\t\tXHR.appendData('ou','{$_GET["ou"]}');\n\t\tXHR.appendData('smtp_auth_passwd',pp);\n\t\tAnimateDiv('params-{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveTestSend);\n\t}\n\tsmtp_authCheck();\n\tsmtp_localcheck();\n</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 12
0
function page()
{
    $sock = new sockets();
    $tpl = new templates();
    $t = time();
    $page = CurrentPageName();
    $NginxBehindLB = intval($sock->GET_INFO("NginxBehindLB"));
    $NginxLBIpaddr = $sock->GET_INFO("NginxLBIpaddr");
    $html = "<div style='font-size:40px;margin-bottom:30px'>{options}</div>\n\t\n\t<div style='width:98%' class=form>\t\n\t<div style='font-size:30px;margin-bottom:20px'>Load-balancer</div>\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{enable}:</td>\n\t\t<td>" . Field_checkbox_design("NginxBehindLB", 1, $NginxBehindLB, "Check{$t}()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{lb_ipaddr}:</td>\n\t\t<td>" . field_ipv4("NginxLBIpaddr", $NginxLBIpaddr, "font-size:22px") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'>" . button("{apply}", "Submit{$t}()", 32) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\n\tvar xSubmit{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\tLoadjs('nginx.restart.progress.php');\n\t}\n\t\n\t\n\tfunction Submit{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tvar NginxBehindLB=0;\n\t\tif(document.getElementById('NginxBehindLB').checked){NginxBehindLB=1;}\n\t\tXHR.appendData('NginxBehindLB',NginxBehindLB);\n\t\tXHR.appendData('NginxLBIpaddr',document.getElementById('NginxLBIpaddr').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\t\n\tfunction Check{$t}(){\n\t\t\n\t\tdocument.getElementById('NginxLBIpaddr').disabled=true;\n\t\tvar NginxBehindLB=0;\n\t\tif(document.getElementById('NginxBehindLB').checked){NginxBehindLB=1;}\n\t\tif(NginxBehindLB==1){\n\t\t\tdocument.getElementById('NginxLBIpaddr').disabled=false;\n\t\t}\n\t}\n\tCheck{$t}();\n\t</script>\t\t\t\n\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 13
0
function popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $q = new postgres_sql();
    $ligne = pg_fetch_assoc($q->QUERY_SQL("SELECT * FROM suricata_sig WHERE signature='{$_GET["sig"]}'"));
    $ligne2 = pg_fetch_assoc($q->QUERY_SQL("SELECT SUM(xcount) as tcount FROM suricata_events WHERE signature='{$_GET["sig"]}'"));
    $sum = FormatNumber($ligne2["tcount"]);
    $t = time();
    $html = "<div style='font-size:30px;margin-bottom:8px;'>{signature} {ID} <strong>{$_GET["sig"]}</strong></div>\n\t<div style='font-size:18px;margin-bottom:30px;border-top:1px solid #CCCCCC;padding-top:8px'><i>{$ligne["description"]}</i></div>\n\t<div style='width:98%' class=form>\n\t\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px'>{events}:</td>\n\t\t\t<td style='font-size:22px'>{$sum}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px'>{enabled}:</td>\n\t\t\t<td>" . Field_checkbox_design("enabled-{$t}", 1, $ligne["enabled"]) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px'>" . texttooltip("{firewall}", "{suricata_firewall}") . ":</td>\n\t\t\t<td>" . Field_checkbox_design("firewall-{$t}", 1, $ligne["firewall"]) . "</td>\n\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", 30) . "</td>\n\t</table>\n\t</div>\t\t\t\n\t<script>\n\tvar xSave{$t}=function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);return;}\n\t\t\$('#TABLE_SURICATA_EVENTS').flexReload();\n\t\tYahooWinHide();\n\t\tLoadjs('suricata.progress.php');\n\t}\t\n\t\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tvar enabled=0;\n\t\tvar firewall=0;\n\t\tif(document.getElementById('enabled-{$t}').checked){enabled=1;}\n\t\tif(document.getElementById('firewall-{$t}').checked){firewall=1;}\n\t\tXHR.appendData('enabled',enabled);\n\t\tXHR.appendData('firewall',firewall);\n\t\tXHR.appendData('sig','{$_GET["sig"]}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t}\t\n\n\t</script>\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 14
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $SquidNoAccessLogs = intval($sock->GET_INFO("SquidNoAccessLogs"));
    $t = time();
    $array = unserialize(base64_decode($sock->GET_INFO("SquidSyslogAdd")));
    if (trim($array["PERSO_EVENT"]) == null) {
        $array["PERSO_EVENT"] = "%>eui %>a %[ui %[un %tl %rm %ru HTTP/%rv %>Hs %<st %Ss:%Sh %{User-Agent}>h %{X-Forwarded-For}>h %<A %>A %tr %mt";
    }
    $html = "\n\t<div id='{$t}' style='width:98%' class=form>\n\t<table style='width:99%'>\n\t<tr>\n\t\t<td colspan=2>" . Paragraphe_switch_img("{activate} Syslog", "{squid_syslog_text}", "ENABLE-{$t}", $array["ENABLE"], null, 700, "SquidSyslogAddCheck()") . "</td>\n\t\t\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{remote_server} (local6):</td>\n\t\t<td>" . Field_text("SERVER-{$t}", $array["SERVER"], "font-size:22px;width:300px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{use_personalized_event}:</td>\n\t\t<td>" . Field_checkbox_design("ENABLE_PERSO_EVENT-{$t}", 1, $array["ENABLE_PERSO_EVENT"], "SquidSyslogAddCheck()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{remove_local_access_events}:</td>\n\t\t<td>" . Field_checkbox_design("SquidNoAccessLogs-{$t}", 1, $SquidNoAccessLogs) . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' colspan=2>{pattern}:</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' colspan=2>\n\t\t\t\t\n\t\t<textarea id='PERSO_EVENT-{$t}' style='font-size:16px !important;margin-top:10px;margin-bottom:10px;\n\t\tfont-family:\"Courier New\",Courier,monospace;padding:3px;border:3px solid #5A5A5A;font-weight:bolder;color:#5A5A5A;\n\t\twidth:100%;height:180px;overflow:auto'>{$array["PERSO_EVENT"]}</textarea>\t\t\n\t\t\t\t\n\t\t</td>\n\t</tr>\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "SaveSyslogSquid{$t}()", 28) . "</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\t\tvar x_SaveSyslogSquid{$t}= function (obj) {\n\t\t\tLoadjs('squid.compile.progress.php');\n\t\t\tYahooWin2Hide();\n\t\t}\n\t\n\t\n\tfunction SaveSyslogSquid{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('SERVER',document.getElementById('SERVER-{$t}').value);\n\t\tXHR.appendData('ENABLE',document.getElementById('ENABLE-{$t}').value);\n\t\tif(document.getElementById('ENABLE_PERSO_EVENT-{$t}').checked){XHR.appendData('ENABLE_PERSO_EVENT',1);}else{XHR.appendData('ENABLE_PERSO_EVENT',0); }\n\t\tif(document.getElementById('SquidNoAccessLogs-{$t}').checked){XHR.appendData('SquidNoAccessLogs',1);}else{XHR.appendData('SquidNoAccessLogs',0); }\n\t\tXHR.appendData('PERSO_EVENT',encodeURIComponent(document.getElementById('PERSO_EVENT-{$t}').value));\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveSyslogSquid{$t});\n\t}\n\t\n\tfunction SquidSyslogAddCheck(){\n\t\tdocument.getElementById('SERVER-{$t}').disabled=true;\n\t\tdocument.getElementById('PERSO_EVENT-{$t}').disabled=true;\n\t\tdocument.getElementById('SquidNoAccessLogs-{$t}').disabled=true;\n\t\t\n\t\t\n\t\t\n\t\tif(document.getElementById('ENABLE-{$t}').value==1){\n\t\t\tdocument.getElementById('SERVER-{$t}').disabled=false;\n\t\t\tdocument.getElementById('SquidNoAccessLogs-{$t}').disabled=false;\n\n\t\t\tif(document.getElementById('ENABLE_PERSO_EVENT-{$t}').checked){\n\t\t\t\tdocument.getElementById('PERSO_EVENT-{$t}').disabled=false;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}else{\n\t\t\tdocument.getElementById('SquidNoAccessLogs-{$t}').checked=false;\n\t\t\n\t\t}\n\t\t\n\t\tCheckBoxDesignRebuild();\n\t}\n\t\n\tSquidSyslogAddCheck();\n\n</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 15
0
function popup()
{
    $q = new mysql_squid_builder();
    $ID = $_GET["ID"];
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    if (!$q->FIELD_EXISTS("proxy_ports", "FTPProxyMaxClients")) {
        $q->QUERY_SQL("ALTER TABLE `proxy_ports` ADD `FTPProxyMaxClients` BIGINT(100) NOT NULL DEFAULT '64'");
        if (!$q->ok) {
            echo $q->mysql_error . "\n";
        }
    }
    if (!$q->FIELD_EXISTS("proxy_ports", "FTPProxyTimeOuts")) {
        $q->QUERY_SQL("ALTER TABLE `proxy_ports` ADD `FTPProxyTimeOuts` INT(100) NOT NULL DEFAULT '360'");
        if (!$q->ok) {
            echo $q->mysql_error . "\n";
        }
    }
    if (!$q->FIELD_EXISTS("proxy_ports", "FTPProxyDestinationTransferMode")) {
        $q->QUERY_SQL("ALTER TABLE `proxy_ports` ADD `FTPProxyDestinationTransferMode` VARCHAR(32) NOT NULL DEFAULT 'client'");
        if (!$q->ok) {
            echo $q->mysql_error . "\n";
        }
    }
    if (!$q->FIELD_EXISTS("proxy_ports", "FTPUserAuthMagic")) {
        $q->QUERY_SQL("ALTER TABLE `proxy_ports` ADD `FTPUserAuthMagic` VARCHAR(128) NOT NULL DEFAULT '@user'");
        if (!$q->ok) {
            echo $q->mysql_error . "\n";
        }
    }
    if (!$q->FIELD_EXISTS("proxy_ports", "FTPUseMagicChar")) {
        $q->QUERY_SQL("ALTER TABLE `proxy_ports` ADD `FTPUseMagicChar` VARCHAR(32) NOT NULL DEFAULT '@'");
        if (!$q->ok) {
            echo $q->mysql_error . "\n";
        }
    }
    if (!$q->FIELD_EXISTS("proxy_ports", "FTPAllowMagicUser")) {
        $q->QUERY_SQL("ALTER TABLE `proxy_ports` ADD `FTPAllowMagicUser` SMALLINT(1) NOT NULL DEFAULT '1'");
        if (!$q->ok) {
            echo $q->mysql_error . "\n";
        }
    }
    $DestinationTransferModeR["client"] = "client";
    $DestinationTransferModeR["passive"] = "passive";
    $DestinationTransferModeR["active"] = "active";
    $ligne = @mysql_fetch_array($q->QUERY_SQL("SELECT * FROM proxy_ports WHERE ID={$ID}"));
    $html = "\n<div style='width:98%' class=form>\n<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:20px'>{MaxClients}:</td>\n\t\t<td style='font-size:18px'>" . field_text("FTPProxyMaxClients-{$t}", $ligne["FTPProxyMaxClients"], "font-size:20px;width:120px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:20px'>{timeout2} ({seconds}):</td>\n\t\t<td style='font-size:18px'>" . field_text("FTPProxyTimeOuts-{$t}", $ligne["FTPProxyTimeOuts"], "font-size:20px;width:120px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:20px'>" . texttooltip("{FTPProxyDestinationTransferMode}", "{FTPProxyDestinationTransferMode_explain}") . ":</td>\n\t\t<td style='font-size:20px'>" . Field_array_Hash($DestinationTransferModeR, "FTPProxyDestinationTransferMode-{$t}", $ligne["FTPProxyDestinationTransferMode"], "style:font-size:20px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:20px'>" . texttooltip("{FTPAllowMagicUser}", "{FTPAllowMagicUser_explain}") . ":</td>\n\t\t\t<td style='font-size:20px'>" . Field_checkbox_design("FTPAllowMagicUser-{$t}", 1, $ligne["FTPAllowMagicUser"]) . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:20px'>" . texttooltip("{UserAuthMagic}", "{UserAuthMagic_explain}") . ":</td>\n\t\t<td style='font-size:18px'>" . field_text("FTPUserAuthMagic-{$t}", $ligne["FTPUserAuthMagic"], "font-size:20px;width:220px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:20px'>" . texttooltip("{FTPUseMagicChar}", "{FTPUseMagicChar_explain}") . ":</td>\n\t\t<td style='font-size:18px'>" . field_text("FTPUseMagicChar-{$t}", $ligne["FTPUseMagicChar"], "font-size:20px;width:220px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n<tr>\n\t<td colspan=2 align='right'><hr>" . button("{apply}", "Save{$t}()", 32) . "</td>\n</tr>\n</table>\n</div>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){ alert(results); return; }\n\tRefreshTab('main_proxy_listen_ports');\n}\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ID','{$ID}');\n\tXHR.appendData('FTPProxyMaxClients',document.getElementById('FTPProxyMaxClients-{$t}').value);\n\tXHR.appendData('FTPProxyTimeOuts',document.getElementById('FTPProxyTimeOuts-{$t}').value);\n\tXHR.appendData('FTPProxyDestinationTransferMode',document.getElementById('FTPProxyDestinationTransferMode-{$t}').value);\n\tXHR.appendData('FTPUserAuthMagic',document.getElementById('FTPUserAuthMagic-{$t}').value);\n\tXHR.appendData('FTPUseMagicChar',document.getElementById('FTPUseMagicChar-{$t}').value);\n\tif(document.getElementById('FTPAllowMagicUser-{$t}').checked){XHR.appendData('FTPAllowMagicUser',1);}else{XHR.appendData('FTPAllowMagicUser',0);}\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 16
0
function conf()
{
    $sock = new sockets();
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $DenyUfdbWriteConf = $sock->GET_INFO("DenyUfdbWriteConf");
    if (!is_numeric($DenyUfdbWriteConf)) {
        $DenyUfdbWriteConf = 0;
    }
    $sock->getFrameWork("squid.php?ufdbguardconf=yes");
    $datas = explode("\n", @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/ufdbGuard.conf"));
    $html = "<div id='{$t}'></div>\n\t<table>\n\t<tr>\n\t<td class=legend style='font-size:20px'>" . $tpl->_ENGINE_parse_body("{deny_artica_to_write_config}") . "</td>\n\t<td>" . Field_checkbox_design("DenyUfdbWriteConf", 1, $DenyUfdbWriteConf, "DenySquidWriteConfSave{$t}()") . "</td>\n\t</tr>\n\t</table><textarea \n\t\tstyle='width:98%;height:550px;overflow:auto;border:5px solid #CCCCCC;font-size:14px !important;\n\t\tfont-weight:bold;padding:3px;font-family:Courier New'\n\t\tid='SQUID_CONTENT-{$t}'>" . @implode("\n", $datas) . "</textarea>\n\t\t\n\t<center><hr>" . $tpl->_ENGINE_parse_body(button("{apply}", "SaveUserConfFile{$t}()", 22)) . "</center>\n\n\t<script>\n\t\tvar x_DenySquidWriteConfSave{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>3){alert(results);return;}\n\t\t}\n\t\n\tfunction DenySquidWriteConfSave{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tvar DenyUfdbWriteConf=0;\n\t\tif(document.getElementById('DenyUfdbWriteConf').checked){\n\t\t\tDenyUfdbWriteConf=1;\n\t\t}\n\t\tXHR.appendData('DenyUfdbWriteConf', DenyUfdbWriteConf);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_DenySquidWriteConfSave{$t});\n\t}\n\t\n\tvar x_SaveUserConfFile{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tdocument.getElementById('{$t}').innerHTML='';\n\t\t\tif(results.length>3){alert(results);return;}\n\t\t}\n\t\n\tfunction SaveUserConfFile{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('UFDB_CONTENT', encodeURIComponent(document.getElementById('SQUID_CONTENT-{$t}').value));\n\t\tAnimateDiv('{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveUserConfFile{$t});\n\t}\t\n</script>\t\n\t";
    echo $html;
}
Exemplo n.º 17
0
function popup()
{
    $user = new usersMenus();
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $SquidUrgency = intval($sock->GET_INFO("SquidUrgency"));
    $SquidSSLUrgency = intval($sock->GET_INFO("SquidSSLUrgency"));
    $StoreIDUrgency = intval($sock->GET_INFO("StoreIDUrgency"));
    $ActiveDirectoryEmergency = intval($sock->GET_INFO("ActiveDirectoryEmergency"));
    $LogsWarninStop = intval($sock->GET_INFO("LogsWarninStop"));
    $t = time();
    $SquidUrgency_admin = "<div style='font-size:16px' class=explain>{squid_urgency_explain}</div>";
    $html = "<div style='width:98%' class=form >\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' class=legend style='font-size:22px'>{global_urgency_mode}:</td>\n\t\t<td valign='top' >" . Field_checkbox_design("SquidUrgency-{$t}", 1, $SquidUrgency, "blur()") . "</td>\n\t\t<td valign='top' style='font-size:12px'>{squid_urgency_explain}</td>\n\t</tr>\n\t<tr style='height:30px;'><td style='text-align:right' colspan=3><hr></td></tR>\n\t<tr>\n\t\t<td valign='middle' class=legend style='font-size:22px'nowrap>Active Directory:</td>\n\t\t<td valign='top' >" . Field_checkbox_design("ActiveDirectoryEmergency-{$t}", 1, $ActiveDirectoryEmergency, "blur()") . "</td>\n\t\t<td valign='top' style='font-size:12px'>{activedirectory_emergency_mode_explain2}</td>\n\t</tr>\t\n\t<tr style='height:30px;'><td style='text-align:right' colspan=3><hr></td></tR>\t\t\n\t<tr>\n\t\t<td valign='middle' class=legend style='font-size:22px'>{ssl_methods}:</td>\n\t\t<td valign='top' >" . Field_checkbox_design("SquidSSLUrgency-{$t}", 1, $SquidSSLUrgency, "blur()") . "</td>\n\t\t<td valign='top' style='font-size:12px'>{SquidSSLUrgency_explain}</td>\n\t</tr>\n\t<tr style='height:30px;'><td style='text-align:right' colspan=3><hr></td></tR>\t\n\t<tr>\n\t\t<td valign='middle' class=legend style='font-size:22px'>HyperCache:</td>\n\t\t<td valign='top' >" . Field_checkbox_design("StoreIDUrgency-{$t}", 1, $StoreIDUrgency, "blur()") . "</td>\n\t\t<td valign='top' style='font-size:12px'>{StoreIDUrgency_explain}</td>\n\t</tr>\n\t<tr style='height:30px;'><td style='text-align:right' colspan=3><hr></td></tR>\t\t\t\t\t\n\t<tr>\n\t\t<td valign='middle' class=legend style='font-size:22px'>{logs}:</td>\n\t\t<td valign='top' >" . Field_checkbox_design("LogsWarninStop-{$t}", 1, $LogsWarninStop, "blur()") . "</td>\n\t\t<td valign='top' style='font-size:12px'>{enable_logs_urgency_explain}</td>\n\t</tr>\t\t\n\t<tr style='height:140px;'>\n\t\t<td style='text-align:right' colspan=3>" . button("{apply}", "Save{$t}()", 34) . "</td>\n\t</tr>\t\t\t\n\t</table>\n\t</div>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\t\n\tLoadjs('squid.compile.progress.php');\n}\t\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('SquidUrgency-{$t}').checked){XHR.appendData('SquidUrgency',1);}\n\telse{XHR.appendData('SquidUrgency',0);}\n\t\n\tif(document.getElementById('ActiveDirectoryEmergency-{$t}').checked){XHR.appendData('ActiveDirectoryEmergency',1);}\n\telse{XHR.appendData('ActiveDirectoryEmergency',0);}\n\n\tif(document.getElementById('SquidSSLUrgency-{$t}').checked){XHR.appendData('SquidSSLUrgency',1);}\n\telse{XHR.appendData('SquidSSLUrgency',0);}\n\n\tif(document.getElementById('StoreIDUrgency-{$t}').checked){XHR.appendData('StoreIDUrgency',1);}\n\telse{XHR.appendData('StoreIDUrgency',0);}\t\n\n\tif(document.getElementById('LogsWarninStop-{$t}').checked){XHR.appendData('LogsWarninStop',1);}\n\telse{XHR.appendData('LogsWarninStop',0);}\t\t\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 18
0
function page()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $q = new mysql();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM relay_host WHERE hostname='{$_GET["hostname"]}'", "artica_backup"));
    if (!$q->ok) {
        echo $q->mysql_error_html();
    }
    $t = time();
    if (!is_numeric($ligne["relay_port"])) {
        $ligne["relay_port"] = 25;
    }
    $form = "<div style='font-size:30px'>{relayhost}</div>\n\t<div class=explain style='font-size:18px'>{relayhost_text}</div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\t</tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:22px'>{enabled}:</strong></td>\n\t\t\t<td style='font-size:12px'>" . Field_checkbox_design("enabled-{$t}", 1, $ligne["enabled"], "CheckEnabled{$t}()") . "</td>\n\t\t</tr>\n\t\t\t\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:22px'>{relay_address}:</strong></td>\n\t\t\t<td style='font-size:22px'>" . Field_text("relay_address-{$t}", $ligne["relay"], "font-size:22px;padding:3px") . "</td>\n\t\t</tr>\n\t\t</tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:22px'>{smtp_port}:</strong></td>\n\t\t\t<td style='font-size:12px'>" . Field_text("relay_port-{$t}", $ligne["relay_port"], "font-size:22px;padding:3px;width:110px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td style='font-size:22px' class=legend>{MX_lookups}</td>\n\t\t\t<td>" . Field_checkbox_design("lookups-{$t}", 1, $ligne["lookups"]) . "</td>\n\t\t</tr>\t\t\t\t\t\n\t\t</tr>\n\t\t\t<td align='right' nowrap class=legend style='font-size:22px'>{authenticate}:</strong></td>\n\t\t\t<td style='font-size:12px'>" . Field_checkbox_design("enabledauth-{$t}", 1, $ligne["enabledauth"], "Checkenabledauth{$t}()") . "</td>\n\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t<tR>\n\t\t\t<td align='right' nowrap class=legend style='font-size:22px'>{username}:</strong></td>\n\t\t\t<td style='font-size:12px'>" . Field_text("relay_username-{$t}", $ligne["username"], "font-size:22px;padding:3px") . "</td>\n\t\t</tr>\n\t<tr>\n\t\t<td align='right' nowrap class=legend style='font-size:22px'>{password}:</strong></td>\n\t\t<td style='font-size:12px'>" . Field_password("relay_password-{$t}", $ligne["password"], "font-size:22px;padding:3px;") . "</td>\n\t</tr>\n\t<tr>\n\t<td align='right' colspan=2 align='right' style='font-size:22px'>\n\t\t\t\t<p>&nbsp;</p>" . button("{apply}", "Loadjs('postfix.sender.routing.progress.php?hostname={$_GET["hostname"]}')", 40) . "&nbsp;|&nbsp;" . button("{save}", "PostfixSaveRelayHost{$t}()", 40) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n<script>\nvar X_PostfixSaveRelayHost{$t}= function (obj) {\n\tvar results=trim(obj.responseText);\n\tif(results.length>2){alert(results);}\n}\nfunction PostfixSaveRelayHost{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\tXHR.appendData('relay_address',document.getElementById('relay_address-{$t}').value);\n\tXHR.appendData('relay_username',document.getElementById('relay_username-{$t}').value);\n\t\n\t\n\t\n\t\n\tXHR.appendData('relay_password',encodeURIComponent(document.getElementById('relay_password-{$t}').value));\n\tif(document.getElementById('enabled-{$t}').checked){XHR.appendData('enabled','1');}else{XHR.appendData('enabled','0');}\n\tif(document.getElementById('enabledauth-{$t}').checked){XHR.appendData('enabledauth','1');}else{XHR.appendData('enabledauth','0');}\n\tif(document.getElementById('lookups-{$t}').checked){XHR.appendData('lookups','1');}else{XHR.appendData('lookups','0');}\n\t\n\tXHR.appendData('relay_port',document.getElementById('relay_port-{$t}').value);\n\tXHR.sendAndLoad('{$page}', 'POST',X_PostfixSaveRelayHost{$t});\n\t\n\t}\nfunction CheckEnabled{$t}(){\n\tdocument.getElementById('relay_address-{$t}').disabled=true;\n\tdocument.getElementById('relay_port-{$t}').disabled=true;\n\tdocument.getElementById('relay_username-{$t}').disabled=true;\n\tdocument.getElementById('relay_password-{$t}').disabled=true;\n\tdocument.getElementById('lookups-{$t}').disabled=true;\n\n\tif(document.getElementById('enabled-{$t}').checked){\n\t\tdocument.getElementById('relay_address-{$t}').disabled=false;\n\t\tdocument.getElementById('relay_port-{$t}').disabled=false;\n\t\tdocument.getElementById('relay_username-{$t}').disabled=false;\n\t\tdocument.getElementById('relay_password-{$t}').disabled=false;\n\t\tdocument.getElementById('lookups-{$t}').disabled=false;\n\t}\n\tCheckenabledauth{$t}();\n}\n\nfunction Checkenabledauth{$t}(){\n\tdocument.getElementById('relay_username-{$t}').disabled=true;\n\tdocument.getElementById('relay_password-{$t}').disabled=true;\n\tif(!document.getElementById('enabled-{$t}').checked){return;}\n\tif(document.getElementById('enabledauth-{$t}').checked){\n\t\tdocument.getElementById('relay_username-{$t}').disabled=false;\n\t\tdocument.getElementById('relay_password-{$t}').disabled=false;\n\t}\n}\n\nCheckEnabled{$t}();\n\n</script>";
    echo $tpl->_ENGINE_parse_body("{$form}");
}
Exemplo n.º 19
0
function config()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $users = new usersMenus();
    $t = time();
    $t = time();
    $spam = new spamassassin();
    $SpamAssMilterEnabled = intval($sock->GET_INFO("SpamAssMilterEnabled"));
    $block_with_required_score = trim($sock->GET_INFO("SpamAssBlockWithRequiredScore"));
    if ($block_with_required_score == null) {
        $block_with_required_score = 5;
    }
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' style='width:350px'>\n\t\t\t<div style='width:98%' class=form>\n\t\t\t\t<div style='font-size:30px;margin-bottom:20px'>{services_status}</div>\n\t\t\t\t<div id='SpamAssMilter-status'></div>\n\t\t\t\t<div style='text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjax('SpamAssMilter-status','{$page}?services-status=yes')") . "</div>\n\t\t\t</div>\n\t\t\n\t\t\n\t\t</td>\n\t\t<td valign='top' style='padding-left:15px'>\n\t<div style='font-size:60px;margin-bottom:15px'>{APP_SPAMASS_MILTER}</div>\t\n\t<hr>\t\n\t<div id='test-{$t}'></div>\n\t<p>&nbsp;</p>\n\t<div style='width:98%' class=form>\n\t\t<table>\n\t\t<tr>\n\t\t<td colspan=2>" . Paragraphe_switch_img("{enable_spamasssin}", "{enable_spamasssin_text}", "SpamAssMilterEnabled", "{$SpamAssMilterEnabled}", null, 1050) . "</td>\n\t\t</tr>\n\t\t\t\t\t\t\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td style='font-size:22px' class=legend>" . texttooltip("{report_safe}", "{report_safe_text}") . ":</strong></td>\n\t\t\t<td valign='top'>" . Field_checkbox_design("report_safe-{$t}", $spam->main_array["report_safe"]) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td style='font-size:22px' class=legend>" . texttooltip("{use_bayes}", "{use_bayes}") . ":</strong></td>\n\t\t\t<td valign='top'>" . Field_checkbox_design("use_bayes-{$t}", $spam->main_array["use_bayes"]) . "</td>\n\t\t</tr>\t\t\t\n\t\t<tr>\n\t\t\t<td style='font-size:22px' class=legend>" . texttooltip("{auto_learn}", "{auto_learn}") . ":</strong></td>\n\t\t\t<td valign='top'>" . Field_checkbox_design("bayes_auto_learn-{$t}", $spam->main_array["bayes_auto_learn"]) . "</td>\n\t\t</tr>\t\n\t\n\t\t<tr>\n\t\t\t<td style='font-size:22px' class=legend>" . texttooltip("{required_score}", "{required_score_text}") . ":</strong></td>\n\t\t\t<td valign='top' colspan=2>" . Field_text("required_score-{$t}", $spam->main_array["required_score"], 'width:110px;font-size:22px', null, null, '{required_score_text}') . "</td>\n\t\t</tr>\t\t\t\n\t\t<tr>\n\t\t\t<td style='font-size:22px' class=legend>" . texttooltip("{block_with_required_score}", "{block_with_required_score_text}") . ":</strong></td>\n\t\t\t<td valign='top' colspan=2>" . Field_text("block_with_required_score-{$t}", $block_with_required_score, 'width:110px;font-size:22px', null, null) . "</td>\n\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td colspan=2  align='right'><hr>" . button("{apply}", "Save{$t}()", "40px") . "</td>\n\t\t</tr>\n</table>\n</div>\n</td>\n</tr>\n</table>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tLoadjs('postfix.milters.progress.php');\n\tRefreshTab('main_config_milter_spamass');\n}\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('SpamAssMilterEnabled',document.getElementById('SpamAssMilterEnabled').value);\n\tXHR.appendData('block_with_required_score',document.getElementById('block_with_required_score-{$t}').value);\n\tXHR.appendData('required_score',document.getElementById('required_score-{$t}').value);\n\tif(document.getElementById('report_safe-{$t}').checked){XHR.appendData('report_safe',1);}else{XHR.appendData('report_safe',0);}\n\tif(document.getElementById('use_bayes-{$t}').checked){XHR.appendData('use_bayes',1);}else{XHR.appendData('use_bayes',0);}\n\tif(document.getElementById('bayes_auto_learn-{$t}').checked){XHR.appendData('bayes_auto_learn',1);}else{XHR.appendData('bayes_auto_learn',0);}\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t},true);\n\n}\n\nfunction Check{$t}(){\n\tLoadAjax('SpamAssMilter-status','{$page}?services-status=yes');\n\t\n}\nCheck{$t}();\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 20
0
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $ID = $_GET["ID"];
    $t = time();
    $q = new mysql();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM haproxy_backends_groups WHERE ID='{$ID}'", "artica_backup"));
    $mode = array(0 => "TCP", 1 => "HTTP Web", 2 => "HTTP Proxy");
    $servicename = $ligne["servicename"];
    $hap = new haproxy_multi($servicename);
    $MainConfig = unserialize(base64_decode($ligne["MainConfig"]));
    if (!isset($MainConfig["loadbalancetype"])) {
        $MainConfig["loadbalancetype"] = $hap->loadbalancetype;
    }
    if (!isset($MainConfig["tunnel_mode"])) {
        $MainConfig["tunnel_mode"] = $hap->tunnel_mode;
    }
    if (!isset($MainConfig["dispatch_mode"])) {
        $MainConfig["dispatch_mode"] = $hap->dispatch_mode;
    }
    if (!isset($MainConfig["UseCookies"])) {
        $MainConfig["UseCookies"] = $hap->MainConfig["UseCookies"];
    }
    if (!isset($MainConfig["contimeout"])) {
        $MainConfig["contimeout"] = $hap->MainConfig["contimeout"];
    }
    if (!isset($MainConfig["srvtimeout"])) {
        $MainConfig["srvtimeout"] = $hap->MainConfig["srvtimeout"];
    }
    if (!isset($MainConfig["clitimeout"])) {
        $MainConfig["clitimeout"] = $hap->MainConfig["clitimeout"];
    }
    if (!isset($MainConfig["maxretries"])) {
        $MainConfig["maxretries"] = $hap->MainConfig["retries"];
    }
    if (!isset($MainConfig["NTLM_COMPATIBILITY"])) {
        $MainConfig["NTLM_COMPATIBILITY"] = $hap->MainConfig["NTLM_COMPATIBILITY"];
    }
    if (!is_numeric($MainConfig["maxretries"])) {
        $MainConfig["maxretries"] = 3;
    }
    $html = "<div style='width:100%;font-size:30px;margin-bottom:20px'>{$ligne["groupname"]}</div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:20px' nowrap>{default}:</td>\n\t\t\t<td width=99%>" . Field_checkbox_design("default-{$t}", 1, $ligne["default"]) . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:20px' nowrap>{groupname}:</td>\n\t\t\t<td width=99%>" . Field_text("groupname-{$t}", $ligne["groupname"], "font-size:20px;padding:3px") . "&nbsp;<span id='mode-options-{$t}'></span></td>\n\t\t</tr>\n\t\t\n\t\t\n\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:20px' nowrap>{method}:</td>\n\t\t\t<td width=99%>" . Field_array_Hash($mode, "loadbalancetype-{$t}", $MainConfig["loadbalancetype"], "blur()", null, 0, "font-size:20px;padding:3px") . "&nbsp;<span id='mode-options-{$t}'></span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:20px' nowrap>{tunnel_mode}:</td>\n\t\t\t<td width=99%>" . Field_checkbox_design("tunnel_mode-{$t}", 1, $MainConfig["tunnel_mode"], "blur()") . "&nbsp;<span id='mode-tunnel_mode-{$t}'></span></td>\n\t\t\t\t\n\t\t</tr>\t\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:20px' nowrap>{dispatch_method}:</td>\n\t\t\t<td width=99%>" . Field_array_Hash($hap->algo, "dispatch_mode-{$t}", $MainConfig["dispatch_mode"], "style:font-size:20px;padding:3px") . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:20px' nowrap>{UseCookies}:</td>\n\t\t\t<td width=99%>" . Field_checkbox_design("UseCookies-{$t}", 1, $MainConfig["UseCookies"]) . "</td>\n\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:20px' nowrap>" . texttooltip("{NTLM_COMPATIBLE}", "{HAP_NTLM_COMPATIBLE}") . ":</td>\n\t\t\t\t<td width=99%>" . Field_checkbox_design("NTLM_COMPATIBILITY-{$t}", 1, $MainConfig["NTLM_COMPATIBILITY"], "blur()") . "</td>\n\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:20px' nowrap>{contimeout}:</td>\n\t\t\t\t<td style='font-size:20px;'>" . Field_text("contimeout-{$t}", $MainConfig["contimeout"], "font-size:20px;padding:3px;width:100px", null, "contimeoutcalc{$t}()", null, false, "contimeout{$t}()", false) . "&nbsp;{milliseconds}&nbsp;<span id='contimeout-span-{$t}'></span></td>\n\t\t\t\t \n\t\t\t</tr>\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:20px' nowrap>{srvtimeout}:</td>\n\t\t\t\t<td style='font-size:20px;'>" . Field_text("srvtimeout-{$t}", $MainConfig["srvtimeout"], "font-size:20px;padding:3px;width:100px", null, "contimeoutcalc{$t}()", null, false, "contimeout{$t}()", false) . "&nbsp;{milliseconds}&nbsp;<span id='srvtimeout-span-{$t}'></span></td>\n\t\t\t\t \n\t\t\t</tr>\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:20px' nowrap>{clitimeout}:</td>\n\t\t\t\t<td style='font-size:20px;'>" . Field_text("clitimeout-{$t}", $MainConfig["clitimeout"], "font-size:20px;padding:3px;width:100px", null, "contimeoutcalc{$t}()", null, false, "contimeout{$t}()", false) . "&nbsp;{milliseconds}&nbsp;<span id='clitimeout-span-{$t}'></span></td>\n\t\t\t\t \n\t\t\t</tr>\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:20px' nowrap>{maxretries}:</td>\n\t\t\t\t<td style='font-size:20px;'>" . Field_text("maxretries-{$t}", $MainConfig["maxretries"], "font-size:20px;padding:3px;width:60px", null, "blur()", null, false, "blur()", false) . "&nbsp;{times}</td>\n\t\t\t\t \n\t\t\t</tr>\t\n\t\t\t\t\t\t<tr>\t\t\t\n\t\t\t\t<td colspan=2 align='right'>" . button("{apply}", "Save{$t}()", 30) . "</td>\n\t\t\t</tr>\n\t\n\t</table>\t\n\t</div>\n<script>\n\nvar xSave{$t}=function (obj) {\n\tvar servicename='{$servicename}';\n\tvar results=obj.responseText;\n\tif(results.length>2){alert(results);return;}\n\t\$('#MAIN_HAPROXY_BALANCERS_TABLE').flexReload();\n\t\$('#HAPROXY_GROUPS_TABLE').flexReload();\n\t\$('#HAPROXY_BROWSE_ACL_GROUPS_TOT').flexReload();\n\tRefreshTab('haproxy_group_{$ID}');\n}\t\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar pp=encodeURIComponent(document.getElementById('groupname-{$t}').value);\n\tXHR.appendData('groupsave','{$ID}');\n\tXHR.appendData('groupname',pp);\n    XHR.appendData('loadbalancetype',document.getElementById('loadbalancetype-{$t}').value);\n    XHR.appendData('dispatch_mode',document.getElementById('dispatch_mode-{$t}').value);\n    XHR.appendData('contimeout',document.getElementById('contimeout-{$t}').value);\n    XHR.appendData('clitimeout',document.getElementById('clitimeout-{$t}').value);\n    XHR.appendData('srvtimeout',document.getElementById('srvtimeout-{$t}').value);\n    XHR.appendData('maxretries',document.getElementById('maxretries-{$t}').value);\n    \t\t\n    \n    if( document.getElementById('default-{$t}').checked){XHR.appendData('default',1);}else{XHR.appendData('default',0);}\n    if( document.getElementById('UseCookies-{$t}').checked){XHR.appendData('UseCookies',1);}else{XHR.appendData('UseCookies',0);}\n    if( document.getElementById('tunnel_mode-{$t}').checked){XHR.appendData('tunnel_mode',1);}else{XHR.appendData('tunnel_mode',0);}\n    if( document.getElementById('NTLM_COMPATIBILITY-{$t}').checked){XHR.appendData('NTLM_COMPATIBILITY',1);}else{XHR.appendData('NTLM_COMPATIBILITY',0);}\n    XHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t\t\n}\n</script>\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 21
0
function otherpage()
{
    $page = CurrentPageName();
    $main = new maincf_multi($_GET["hostname"]);
    $enable_original_recipient = $main->GET("enable_original_recipient");
    $smtpd_discard_ehlo_keywords = $main->GET("smtpd_discard_ehlo_keywords");
    if (!is_numeric($enable_original_recipient)) {
        $enable_original_recipient = 1;
    }
    $undisclosed_recipients_header = $main->GET("undisclosed_recipients_header");
    if ($undisclosed_recipients_header == null) {
        $undisclosed_recipients_header = "To: undisclosed-recipients:;";
    }
    $t = time();
    $html = "\n<div id='otherpagedvi' style='width:98%' class=form>\n\t\t\n<table style='width:99%'>\n<tr>\n\t<td class=legend nowrap style='font-size:22px'>{undisclosed_recipients_header}:</td>\n\t<td>" . Field_text("undisclosed_recipients_header-{$t}", $undisclosed_recipients_header, 'width:90%;font-size:22px') . "</td>\n\t<td>" . help_icon("{undisclosed_recipients_header_text}") . "</td>\n</tr>\n<tr>\n\t<td class=legend nowrap style='font-size:22px'>{smtpd_discard_ehlo_keywords}:</td>\n\t<td>" . Field_text("smtpd_discard_ehlo_keywords-{$t}", $smtpd_discard_ehlo_keywords, 'width:90%;font-size:22px') . "</td>\n\t<td>" . help_icon("{smtpd_discard_ehlo_keywords_text}") . "</td>\n</tr>\t\t\t\n\t\t\t\n\t\t\t\n<tr>\n\t<td class=legend nowrap style='font-size:22px'>{enable_original_recipient}:</td>\n\t<td>" . Field_checkbox_design('enable_original_recipient', 1, $enable_original_recipient) . "</td>\n\t<td>" . help_icon("{enable_original_recipient_text}") . "</td>\n</tr>\n\n\n\n<tr><td colspan=2 align='right'><hr>" . button("{apply}", "SavePostfixOtherSection{$t}()", "36") . "</td></tr>\n</table>\n</div>\n<script>\n\tvar x_SavePostfixOtherSection= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);return;}\n\t\t\n\t}\t\n\t\n\tfunction SavePostfixOtherSection(){\n\t\tvar undisclosed_recipients_header=document.getElementById('undisclosed_recipients_header').value;\n\t\tvar enable_original_recipient=document.getElementById('enable_original_recipient').value;\t\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\t\tXHR.appendData('enable_original_recipient',document.getElementById('enable_original_recipient-{$t}').value);\n\t\tXHR.appendData('undisclosed_recipients_header',document.getElementById('undisclosed_recipients_header-{$t}').value);\n\t\tXHR.appendData('smtpd_discard_ehlo_keywords',document.getElementById('smtpd_discard_ehlo_keywords-{$t}').value);\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SavePostfixOtherSection{$t});\t\t  \n\t}\n</script>\t\t\n";
    $tpl = new Templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 22
0
function popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $squid = new squidbee();
    $sock = new sockets();
    $users = new usersMenus();
    $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance");
    $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
    if (!is_numeric($EnableWebProxyStatsAppliance)) {
        $EnableWebProxyStatsAppliance = 0;
    }
    if (!is_numeric($EnableRemoteStatisticsAppliance)) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    if ($users->WEBSTATS_APPLIANCE) {
        $EnableWebProxyStatsAppliance = 1;
    }
    $DisableTCPEn = intval($sock->GET_INFO("DisableTCPEn"));
    $DisableTCPWindowScaling = intval($sock->GET_INFO("DisableTCPWindowScaling"));
    $SquidUploadTimeouts = intval($sock->GET_INFO("SquidUploadTimeouts"));
    $SquidConnectRetries = intval($sock->GET_INFO("SquidConnectRetries"));
    $SquidSimpleConfig = $sock->GET_INFO("SquidSimpleConfig");
    if (!is_numeric($SquidSimpleConfig)) {
        $SquidSimpleConfig = 1;
    }
    $t = time();
    $Upload_timedout[0] = "{default}";
    $Upload_timedout[10] = "10 {minutes}";
    $Upload_timedout[15] = "15 {minutes}";
    $Upload_timedout[20] = "20 {minutes}";
    $Upload_timedout[30] = "30 {minutes}";
    $Upload_timedout[60] = "1 {hour}";
    $Upload_timedout[120] = "2 {hours}";
    $Upload_timedout[180] = "3 {hours}";
    $Upload_timedout[240] = "4 {hours}";
    for ($i = 0; $i < 11; $i++) {
        $SquidConnectRetriesZ[$i] = $i;
    }
    $SquidConnectRetriesZ[0] = "{nottoretry}";
    $html = "\n\t<div id='{$t}'></div>\n\t<table style='width:99%' class=form>\n\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:top'>" . texttooltip("{DisableTCPEn}", "{DisableTCPEn_explain}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_checkbox_design("DisableTCPEn-{$t}", 1, $DisableTCPEn) . "&nbsp;</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:top'>" . texttooltip("{DisableTCPWindowScaling}", "{DisableTCPWindowScaling_explain}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_checkbox_design("DisableTCPWindowScaling-{$t}", 1, $DisableTCPWindowScaling) . "&nbsp;</td>\n\t\t\t\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>{uploads_timeout}</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_array_Hash($Upload_timedout, "SquidUploadTimeouts-{$t}", $SquidUploadTimeouts, "SquidUploadTimeouts{$t}()", null, 0, "font-size:22px", false) . "&nbsp;</td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{forward_max_tries}", "{forward_max_tries_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("forward_max_tries-{$t}", $squid->forward_max_tries, 'width:60%;font-size:22px') . "&nbsp;</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{connect_retries}", "{connect_retries_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_array_Hash($SquidConnectRetriesZ, "SquidConnectRetries-{$t}", $SquidConnectRetries, "blur()", null, 0, "font-size:22px", false) . "&nbsp;</td>\n\t\t\t\n\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{forward_timeout}", "{forward_timeout_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("forward_timeout-{$t}", $squid->forward_timeout, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{client_lifetime}", "{client_lifetime_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("client_lifetime-{$t}", $squid->client_lifetime, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{shutdown_lifetime}", "{shutdown_lifetime_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("shutdown_lifetime-{$t}", $squid->shutdown_lifetime, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{read_timeout}", "{read_timeout_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("read_timeout-{$t}", $squid->read_timeout, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\t\n\t\t\t\t\t \t\n\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{dead_peer_timeout}", "{dead_peer_timeout_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("dead_peer_timeout-{$t}", $squid->dead_peer_timeout, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{dns_timeout}", "{dns_timeout_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("dns_timeout-{$t}", $squid->dns_timeout, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{connect_timeout}", "{connect_timeout_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("connect_timeout-{$t}", $squid->connect_timeout, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{peer_connect_timeout}", "{peer_connect_timeout_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("peer_connect_timeout-{$t}", $squid->peer_connect_timeout, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{persistent_request_timeout}", "{persistent_request_timeout_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("persistent_request_timeout-{$t}", $squid->persistent_request_timeout, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{pconn_timeout}", "{pconn_timeout_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("pconn_timeout-{$t}", $squid->pconn_timeout, 'width:60%;font-size:22px') . "&nbsp;{seconds}</td>\n\t\t\t\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td align='right' class=legend style='font-size:22px;vertical-align:middle'>" . texttooltip("{incoming_rate}", "{incoming_rate_text}") . "</strong>:</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle'>" . Field_text("incoming_rate-{$t}", $squid->incoming_rate, 'width:60%;font-size:22px') . "&nbsp;</td>\n\t\t</tr>\n\t\t\t\t\t \t\n\t\t\t\t\t\n\t\t\t\n\t\t<tr>\n\t\t<td align='right' colspan=2>\n\t\t\t<hr>" . button("{apply}", "SaveSNMP{$t}()", 42) . "\n\t\t</td>\n\t\t</tr>\n\t</table>\n\t\n\t<script>\n\tvar x_SaveSNMP{$t}=function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);return;}\n\t\tLoadjs('squid.restart.php?prepare-js=yes');\n\t\tYahooWin3Hide();\n\t}\t\n\t\n\tfunction SaveSNMP{$t}(){\n\t\tvar lock={$EnableRemoteStatisticsAppliance};\n\t\tif(lock==1){Loadjs('squid.newbee.php?error-remote-appliance=yes');return;}\t\n\t\tvar XHR = new XHRConnection();\n\t\tvar DisableTCPEn=0;\n\t\tvar DisableTCPWindowScaling=0;\n\t\tif(document.getElementById('DisableTCPEn-{$t}').checked){ DisableTCPEn=1 }\n\t\tif(document.getElementById('DisableTCPWindowScaling-{$t}').checked){ DisableTCPWindowScaling=1 }\n\t\t\n\t\tXHR.appendData('DisableTCPWindowScaling',DisableTCPWindowScaling);\n\t\tXHR.appendData('DisableTCPEn',DisableTCPEn);\n\t\tXHR.appendData('dead_peer_timeout',document.getElementById('dead_peer_timeout-{$t}').value);\n\t\tXHR.appendData('dns_timeout',document.getElementById('dns_timeout-{$t}').value);\n\t\tXHR.appendData('connect_timeout',document.getElementById('connect_timeout-{$t}').value);\n\t\tXHR.appendData('peer_connect_timeout',document.getElementById('peer_connect_timeout-{$t}').value);\n\t\tXHR.appendData('client_lifetime',document.getElementById('client_lifetime-{$t}').value);\n\t\tXHR.appendData('read_timeout',document.getElementById('read_timeout-{$t}').value);\n\t\tXHR.appendData('shutdown_lifetime',document.getElementById('shutdown_lifetime-{$t}').value);\n\t\tXHR.appendData('persistent_request_timeout',document.getElementById('persistent_request_timeout-{$t}').value);\n\t\tXHR.appendData('incoming_rate',document.getElementById('incoming_rate-{$t}').value);\n\t\tXHR.appendData('pconn_timeout',document.getElementById('pconn_timeout-{$t}').value);\n\t\tXHR.appendData('forward_max_tries',document.getElementById('forward_max_tries-{$t}').value);\n\t\tXHR.appendData('forward_timeout',document.getElementById('forward_timeout-{$t}').value);\n\t\tXHR.appendData('SquidUploadTimeouts',document.getElementById('SquidUploadTimeouts-{$t}').value);\n\t\tXHR.appendData('SquidConnectRetries',document.getElementById('SquidConnectRetries-{$t}').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveSNMP{$t});\t\n\t\t\n\t}\t\n\t\n\tfunction SquidUploadTimeouts{$t}(){\n\t\tvar SquidSimpleConfig={$SquidSimpleConfig};\n\t\t\n\t\tif(SquidSimpleConfig==1){\n\t\t\tdocument.getElementById('dead_peer_timeout-{$t}').disabled=true;\n\t\t\tdocument.getElementById('dns_timeout-{$t}').disabled=true;\n\t\t\tdocument.getElementById('connect_timeout-{$t}').disabled=true;\n\t\t\tdocument.getElementById('peer_connect_timeout-{$t}').disabled=true;\n\t\t\tdocument.getElementById('client_lifetime-{$t}').disabled=true;\n\t\t\tdocument.getElementById('read_timeout-{$t}').disabled=true;\n\t\t\tdocument.getElementById('persistent_request_timeout-{$t}').disabled=true;\n\t\t\tdocument.getElementById('incoming_rate-{$t}').disabled=true;\n\t\t\tdocument.getElementById('pconn_timeout-{$t}').disabled=true;\n\t\t\tdocument.getElementById('forward_timeout-{$t}').disabled=true;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t\n\t\tdocument.getElementById('read_timeout-{$t}').disabled=false;\n\t\tdocument.getElementById('pconn_timeout-{$t}').disabled=false;\n\t\tdocument.getElementById('persistent_request_timeout-{$t}').disabled=false;\n\t\t\n\t\t\n\t\tif(document.getElementById('SquidUploadTimeouts-{$t}').value>0){\n\t\t\tdocument.getElementById('read_timeout-{$t}').disabled=true;\n\t\t\tdocument.getElementById('pconn_timeout-{$t}').disabled=true;\n\t\t\tdocument.getElementById('persistent_request_timeout-{$t}').disabled=true;\n\t\t}\n\t\n\t}\n\tSquidUploadTimeouts{$t}();\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 23
0
function dhcp_form()
{
    $ldap = new clladp();
    $domains = $ldap->hash_get_all_domains();
    $dhcp = new dhcpd_sub($_GET["nic"]);
    $page = CurrentPageName();
    $users = new usersMenus();
    $t = time();
    if (count($domains) == 0) {
        $dom = Field_text("ddns_domainname-{$t}", $dhcp->ddns_domainname, "font-size:22px;");
    } else {
        $domains[null] = "{select}";
        $dom = Field_array_Hash($domains, "ddns_domainname-{$t}", $dhcp->ddns_domainname, null, null, null, ";font-size:22px;padding:3px");
    }
    $EnableDHCPUseHostnameOnFixed = Field_checkbox_design("EnableDHCPUseHostnameOnFixed-{$t}", 1, $dhcp->EnableDHCPUseHostnameOnFixed);
    $authoritative = Field_checkbox_design("authoritative-{$t}", 1, $dhcp->authoritative);
    $ping_check = Field_checkbox_design("ping_check-{$t}", 1, $dhcp->ping_check);
    $get_lease_hostnames = Field_checkbox_design("get_lease_hostnames-{$t}", 1, $dhcp->get_lease_hostnames);
    $nicz = new system_nic($_GET["nic"]);
    $ipaddrEX = explode(".", $nicz->IPADDR);
    unset($ipaddrEX[3]);
    if ($dhcp->subnet == null) {
        $dhcp->subnet = @implode(".", $ipaddrEX) . ".0";
    }
    if ($dhcp->netmask == null) {
        $dhcp->netmask = $nicz->NETMASK;
    }
    if ($dhcp->gateway == null) {
        $dhcp->gateway = $nicz->GATEWAY;
    }
    if ($dhcp->range1 == null) {
        $dhcp->range1 = @implode(".", $ipaddrEX) . ".50";
    }
    if ($dhcp->range2 == null) {
        $dhcp->range2 = @implode(".", $ipaddrEX) . ".254";
    }
    if ($dhcp->broadcast == null) {
        $dhcp->broadcast = @implode(".", $ipaddrEX) . ".255";
    }
    $html = "<div id='dhscpsettings' class=form>\n\t<div class='BodyContent'>\n\t<table style='width:98%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{enabled}:</td>\n\t\t<td>" . Field_checkbox_design("EnableDHCPServer-{$t}", 1, $dhcp->EnableDHCPServer) . "</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{EnableDHCPUseHostnameOnFixed}:</td>\n\t\t<td>{$EnableDHCPUseHostnameOnFixed}</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>" . help_icon('{EnableDHCPUseHostnameOnFixed_explain}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{authoritative}:</td>\n\t\t<td>{$authoritative}</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>" . help_icon('{authoritativeDHCP_explain}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{DHCPPing_check}:</td>\n\t\t<td>{$ping_check}</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>" . help_icon('{ping_check_explain}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{get_lease_hostnames}:</td>\n\t\t<td>{$get_lease_hostnames}</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>" . help_icon('{get_lease_hostnames_text}') . "</td>\n\t</tr>\n<tr>\n\t<td colspan=4>\n\t\t\t\t<div style='margin:10px;border:1px solid #CCCCCC;padding:10px'>\n\t\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px;font-weight:bold;width:607px'>{ipfrom}:</td>\n\t\t\t\t\t<td>" . field_ipv4("range1-{$t}", $dhcp->range1, 'font-size:22px;padding:3px;font-weight:bold') . "&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px;font-weight:bold'>{ipto}:</td>\n\t\t\t\t\t<td>" . field_ipv4("range2-{$t}", $dhcp->range2, 'font-size:22px;padding:3px;font-weight:bold') . "&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t</div>\t\t\t\t\t\n\t\t</td>\n</tr>\t\t\t\t\t\n\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{ddns_domainname}:</td>\n\t\t<td>{$dom}</td>\n\t\t<td>&nbsp;</td>\n\t\t<td width=1% nowrap>" . imgtootltip("plus-16.png", null, "Loadjs('domains.edit.domains.php?js-all-localdomains=yes')") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{max_lease_time}:</td>\n\t\t<td style='font-size:16px'>" . Field_text("max_lease_time-{$t}", $dhcp->max_lease_time, 'width:90px;font-size:22px;padding:3px') . "&nbsp;{seconds}</td>\n\t\t<td>&nbsp;</td>\n\t\t<td >" . help_icon('{max_lease_time_text}') . "</td>\n\t</tr>\n\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{wpad_label}:</td>\n\t\t<td>" . Field_text("local_pac_server-{$t}", $dhcp->local_pac_server, 'width:300px;font-size:22px;padding:3px', false) . "</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>" . help_icon('{wpad_label_text}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{subnet}:</td>\n\t\t<td>" . field_ipv4("subnet-{$t}", $dhcp->subnet, "font-size:22px;padding:3px;font-weight:bold", false) . "</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{netmask}:</td>\n\t\t<td>" . field_ipv4("netmask-{$t}", $dhcp->netmask, 'font-size:22px;padding:3px;font-weight:bold') . "&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{gateway}:</td>\n\t\t<td>" . field_ipv4("gateway-{$t}", $dhcp->gateway, 'font-size:22px;padding:3px;font-weight:bold') . "&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t\t\t\t\n\t\t\t\t\n\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{DNSServer} 1:</td>\n\t\t<td>" . field_ipv4("DNS_1-{$t}", $dhcp->DNS_1, 'font-size:22px;padding:3px;font-weight:bold') . "&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{DNSServer} 2:</td>\n\t\t<td>" . field_ipv4("DNS_2-{$t}", $dhcp->DNS_2, 'font-size:22px;padding:3px;font-weight:bold') . "&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{wins_server}:</td>\n\t\t<td>" . field_ipv4("WINS-{$t}", $dhcp->WINS, 'font-size:22px;padding:3px') . "&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{ntp_server} <span style='font-size:10px'>({optional})</span>:</td>\n\t\t<td>" . Field_text("ntp_server-{$t}", $dhcp->ntp_server, 'width:228px;font-size:22px;padding:3px') . "&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{broadcast}:</td>\n\t\t<td>" . field_ipv4("broadcast-{$t}", $dhcp->broadcast, 'font-size:22px;padding:3px') . "&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=4 align='right'><hr>" . button("{apply}", "SaveDHCPSettings{$t}()", 40) . "</td>\n\t</tr>\n</table>\n</div>\n</div>\n<br>\n<script>\nvar x_SaveDHCPSettings{$t}= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\tLoadjs('dhcpd.progress.php');\n\t}\t\t\n\t\t\n\tfunction SaveDHCPSettings{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('nic','{$_GET["nic"]}');\n\t\tXHR.appendData('range1',document.getElementById('range1-{$t}').value);\n\t\tXHR.appendData('range2',document.getElementById('range2-{$t}').value);\n\t\tXHR.appendData('gateway',document.getElementById('gateway-{$t}').value);\n\t\tXHR.appendData('netmask',document.getElementById('netmask').value);\n\t\tXHR.appendData('DNS_1',document.getElementById('DNS_1-{$t}').value);\n\t\tXHR.appendData('DNS_2',document.getElementById('DNS_2-{$t}').value);\n\t\tXHR.appendData('max_lease_time',document.getElementById('max_lease_time-{$t}').value);\n\t\tXHR.appendData('ntp_server',document.getElementById('ntp_server-{$t}').value);\n\t\tXHR.appendData('subnet',document.getElementById('subnet-{$t}').value);\n\t\tXHR.appendData('broadcast',document.getElementById('broadcast-{$t}').value);\n\t\tXHR.appendData('WINS',document.getElementById('WINS-{$t}').value);\n\t\tXHR.appendData('local_pac_server',document.getElementById('local_pac_server-{$t}').value);\n\t\t\n\t\tif(document.getElementById('EnableDHCPServer-{$t}').checked){\n\t\tXHR.appendData('EnableDHCPServer',1);}else{XHR.appendData('EnableDHCPServer',0);}\n\t\t\n\t\tif(document.getElementById('EnableDHCPUseHostnameOnFixed-{$t}').checked){XHR.appendData('EnableDHCPUseHostnameOnFixed',1);}else{XHR.appendData('EnableDHCPUseHostnameOnFixed',0);}\n\t\tif(document.getElementById('ping_check-{$t}').checked){XHR.appendData('ping_check',1);}else{XHR.appendData('ping_check',0);}\n\t\tif(document.getElementById('authoritative-{$t}').checked){XHR.appendData('authoritative',1);}else{XHR.appendData('authoritative',0);}\n\t\tXHR.appendData('ddns_domainname',document.getElementById('ddns_domainname-{$t}').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveDHCPSettings{$t});\t\n\n\t}\n</script>\n";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 24
0
function popup()
{
    $users = new usersMenus();
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $servicename = $_GET["servicename"];
    $hap = new haproxy_multi($servicename);
    if (!is_numeric($hap->MainConfig["http-use-proxy-header"])) {
        $hap->MainConfig["http-use-proxy-header"] = 1;
    }
    if (!is_numeric($hap->MainConfig["forwardfor"])) {
        $hap->MainConfig["forwardfor"] = 1;
    }
    if (!is_numeric($hap->MainConfig["originalto"])) {
        $hap->MainConfig["originalto"] = 1;
    }
    $html = "\n\t\n\t<div id='{$t}-defaults' style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:20px'>{http_use_proxy_header}:</td>\n\t\t<td>" . Field_checkbox_design("http-use-proxy-header-{$t}", 1, $hap->MainConfig["http-use-proxy-header"]) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:20px'>{xforwardfor}:</td>\n\t\t<td>" . Field_checkbox_design("forwardfor-{$t}", 1, $hap->MainConfig["forwardfor"]) . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:20px'>{xoriginalto}:</td>\n\t\t<td>" . Field_checkbox_design("originalto-{$t}", 1, $hap->MainConfig["originalto"]) . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "SaveHTTPOptions{$t}()", '30px') . "</td>\n\t</tr>\n\t\n\t</table>\n\t</div>\n\t<script>\n\t\tvar x_SaveHTTPOptions{$t}=function (obj) {\n\t\t    var servicename='{$servicename}';\n\t\t\tvar results=obj.responseText;\n\t\t\tdocument.getElementById('{$t}-defaults').innerHTML='';\n\t\t\tYahooWin6Hide();\n\t\t}\t\n\t\n\t\n\t\tfunction SaveHTTPOptions{$t}(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('servicename','{$servicename}');\n\t\t\tif( document.getElementById('http-use-proxy-header-{$t}').checked){XHR.appendData('http-use-proxy-header',1);}else{XHR.appendData('http-use-proxy-header',0);}\n\t\t\tif( document.getElementById('forwardfor-{$t}').checked){XHR.appendData('forwardfor',1);}else{XHR.appendData('forwardfor',0);}\n\t\t\tif( document.getElementById('originalto-{$t}').checked){XHR.appendData('originalto',1);}else{XHR.appendData('originalto',0);}\n\t\t\tAnimateDiv('{$t}-defaults');\n    \t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveHTTPOptions{$t});\n    \t\t\n    \t}\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 25
0
function ACIVE_DIRECTORY_PAGE()
{
    $t = time();
    $watchdog = new squid_watchdog();
    $MonitConfig = $watchdog->MonitConfig;
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $ActiveDirectoryWatchdogINTS[1] = "1 {minute}";
    for ($i = 1; $i < 16; $i++) {
        $ActiveDirectoryWatchdogINTS[$i] = "{$i} {minutes}";
    }
    $array["none"] = "{none}";
    $array["restart"] = "{restart_services}";
    $array["failover"] = "{failover}";
    $array["disable_ad"] = "{emergency_mode}";
    $array["reboot"] = "{reboot}";
    $html = "<div style='width:98%' class=form>\n\t\t\t" . Paragraphe_switch_img("{activedirectory_checking}", "{activedirectory_checking_watchdog}", "CHECK_AD", $MonitConfig["CHECK_AD"], null, 1400) . "\n\t\t\t\t\t\t\t\n\t<div style='width:100%;margin-top:15px;text-align:right'>\n\t\n\t\t<a href=\"javascript:blur();\" \n\t\tOnClick=\"javascript:GotoWatchDogSMTPNotifs();\"\n\t\tstyle='text-decoration:underline;font-size:18px'>\t\t\t\t\t\n\t\t{see_how_to_receive_smtp_notifications}</a></div>\n\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:26px'>{interval}):</td>\n\t\t<td\tstyle='font-size:26px'>" . Field_array_Hash($ActiveDirectoryWatchdogINTS, "CHECK_AD_INTERVAL", $MonitConfig["CHECK_AD_INTERVAL"], null, null, 0, "font-size:26px") . "</td>\n\t</tr>\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:26px'>{ifconnection_broken} (MAX):</td>\n\t\t<td\tstyle='font-size:18px'>" . Field_text("CHECK_AD_MAX_ATTEMPTS", $MonitConfig["CHECK_AD_MAX_ATTEMPTS"], "font-size:26px;width:110px") . "</td>\n\t\t\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:26px;vertical-align:middle'>{ping_kdc}:</td>\n\t\t<td\tstyle='font-size:18px'>" . Field_checkbox_design("CHECK_AD_FAILED_PING", 1, $MonitConfig["CHECK_AD_FAILED_PING"]) . "&nbsp;</td>\n\t</tr>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:26px'>{action}:</td>\n\t\t<td\tstyle='font-size:26px'>" . Field_array_Hash($array, "CHECK_AD_ACTION", $MonitConfig["CHECK_AD_ACTION"], null, '', 0, "font-size:26px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "Save{$t}()", 40) . "</td>\n\t\t</tr>\n\t\t</table>\n\t\t</div>\n\t\t<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tUnlockPage();\n\tRefreshTab('watchdog_settings_tabs');\n}\n\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('SAVEGLOBAL','yes');\n\tif(document.getElementById('CHECK_AD_FAILED_PING').checked){XHR.appendData('CHECK_AD_FAILED_PING',1);}else{XHR.appendData('CHECK_AD_FAILED_PING',0);}\n\tXHR.appendData('CHECK_AD',document.getElementById('CHECK_AD').value);\n\tXHR.appendData('CHECK_AD_MAX_ATTEMPTS',document.getElementById('CHECK_AD_MAX_ATTEMPTS').value);\n\tXHR.appendData('CHECK_AD_ACTION',document.getElementById('CHECK_AD_ACTION').value);\n\tXHR.appendData('CHECK_AD_INTERVAL',document.getElementById('CHECK_AD_INTERVAL').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
function params()
{
    $sql = "SELECT * FROM freeweb WHERE servername='{$_GET["servername"]}'";
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql();
    $sock = new sockets();
    $FreeWebsEnableModSecurity = $sock->GET_INFO("FreeWebsEnableModSecurity");
    $FreeWebsEnableModEvasive = $sock->GET_INFO("FreeWebsEnableModEvasive");
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    $Params = unserialize(base64_decode($ligne["Params"]));
    $apache_auth_ip_explain = $tpl->javascript_parse_text("{apache_auth_ip_explain}");
    $users = new usersMenus();
    $APACHE_MOD_AUTHNZ_LDAP = 0;
    $APACHE_MOD_GEOIP = 0;
    if ($users->APACHE_MOD_AUTHNZ_LDAP) {
        $APACHE_MOD_AUTHNZ_LDAP = 1;
    }
    if ($users->APACHE_MOD_GEOIP) {
        $APACHE_MOD_GEOIP = 1;
    }
    $ServerSignature = $sock->GET_INFO("ApacheServerSignature");
    if (!is_numeric($ServerSignature)) {
        $ServerSignature = 1;
    }
    if (!is_numeric($FreeWebsEnableModSecurity)) {
        $FreeWebsEnableModSecurity = 0;
    }
    if (!is_numeric($FreeWebsEnableModEvasive)) {
        $FreeWebsEnableModEvasive = 0;
    }
    $ZarafaWebNTLM = 0;
    $t = time();
    $add = $tpl->_ENGINE_parse_body("{add}");
    $address = $tpl->_ENGINE_parse_body("{address}");
    $enable_limit_by_addresses = $tpl->_ENGINE_parse_body("{enable_limit_by_addresses}");
    $title = $tpl->javascript_parse_text("{clients_restrictions}");
    $buttons = "buttons : [\n\t{name: '<strong style=font-size:18px>{$add}</strong>', bclass: 'Add', onpress : AuthIpAdd},\n\t\t],\t";
    echo "\n<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{$enable_limit_by_addresses}:</td>\n\t\t<td>" . Field_checkbox_design("LimitByIp", 1, $Params["LimitByIp"]["enabled"], "enable_ip_authentication_save{$t}()") . "</td>\n\t</tr>\t\n</table>\n<table class='{$t}' style='display: none' id='{$t}' style='width:99%'></table>\n<script>\nvar MEMMDAUTH='';\n\$(document).ready(function(){\n\$('#{$t}').flexigrid({\n\turl: '{$page}?query=yes&servername={$_GET["servername"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t\t{display: '&nbsp;', name : 'zDate', width : 40, sortable : false, align: 'left'},\t\n\t\t\t{display: '{$address}', name : 'address', width :685, sortable : false, align: 'left'},\n\t\t\t{display: '&nbsp;', name : 'none2', width : 40, sortable : false, align: 'left'},\n\t\t\n\t],\n{$buttons}\n\tsearchitems : [\n\t\t{display: '{$address}', name : 'address'}\n\t\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:30px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 300,\n\tsingleSelect: true\n\t\n\t});   \n});\n\t\n\n\t\n\t\tfunction RefreshAuthIp(){\n\t\t\t\$('#{$t}').flexReload();\n\t\t}\n\t\t\n\t\tfunction enable_ip_authentication_save{$t}(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(document.getElementById('LimitByIp').checked){XHR.appendData('LimitByIp',1);}else{XHR.appendData('LimitByIp',0);}\n\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\n    \t\tXHR.sendAndLoad('{$page}', 'POST',x_AuthIpAdd{$t});\n\t\t}\n\t\t\n\t\tvar x_AuthIpAdd{$t}=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tRefreshAuthIp();\t\t\t\n\t\t}\n\n\t\tvar x_AuthIpDel=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);return;}\n\t\t\t\$('#row'+MEMMDAUTH).remove();\t\t\n\t\t}\t\t\n\t\t\n\t\tfunction AuthIpAdd(){\n\t\t\tvar ip=prompt('{$apache_auth_ip_explain}');\n\t\t\tif(ip){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('authip-add',ip);\n\t\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\n\t\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_AuthIpAdd{$t});\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction AuthIpDel(ip,id){\n\t\t\t\tMEMMDAUTH=id;\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('authip-del',ip);\n\t\t\t\tXHR.appendData('servername','{$_GET["servername"]}');\n\t\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_AuthIpDel);\n\t\t\t\n\t\t}\t\t\t\n\n\t</script>\n\t\n\t\n\t\n\t";
}
function page()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $NoDryReboot = $sock->GET_INFO("NoDryReboot");
    $NoOutOfMemoryReboot = $sock->GET_INFO("NoOutOfMemoryReboot");
    if (!is_numeric($NoOutOfMemoryReboot)) {
        $NoOutOfMemoryReboot = 0;
    }
    if (!is_numeric($NoDryReboot)) {
        $NoDryReboot = 0;
    }
    $AutoRebootSchedule = $sock->GET_INFO("AutoRebootSchedule");
    $AutoRebootScheduleText = trim($sock->GET_INFO("AutoRebootScheduleText"));
    if (!is_numeric($AutoRebootSchedule)) {
        $AutoRebootSchedule = 0;
    }
    $DisableForceFCK = intval($sock->GET_INFO("DisableForceFCK"));
    $t = $_GET["t"];
    $html = "\t\t\n\t<div style='width:98%' class=form>\n\t<input type='hidden' id='AutoRebootScheduleText' value='{$AutoRebootScheduleText}'>\t\n\t<table style='width:100%'>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td colspan=3><div style='font-size:32px;margin-bottom:20px'>{reboot}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td nowrap width=1% align='right' class=legend style='font-size:22px'>{NoDryReboot}:</td>\n\t\t\t\t<td>" . Field_checkbox_design("NoDryReboot", 1, $NoDryReboot) . "</td>\n\t\t\t\t<td>" . help_icon("{NoDryReboot_explain}") . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td nowrap width=1% align='right' class=legend style='font-size:22px'>{DisableForceFCK}:</td>\n\t\t\t\t<td>" . Field_checkbox_design("DisableForceFCK", 1, $DisableForceFCK) . "</td>\n\t\t\t\t<td>" . help_icon("{DisableForceFCK_explain}") . "</td>\n\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td nowrap width=1% align='right' class=legend style='font-size:22px'>{NoOutOfMemoryReboot}:</td>\n\t\t\t\t<td>" . Field_checkbox_design("NoOutOfMemoryReboot", 1, $NoOutOfMemoryReboot) . "</td>\n\t\t\t\t<td>" . help_icon("{NoOutOfMemoryReboot_explain}") . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td nowrap width=1% align='right' class=legend style='font-size:22px'>{scheduled_reboot}:</td>\n\t\t\t\t<td>" . Field_checkbox_design("AutoRebootSchedule", 1, $AutoRebootSchedule, 'CheckRebootSchedule()') . "</td>\n\t\t\t\t<td align=left><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('cron.php?field=AutoRebootScheduleText')\" style='font-size:22px;text-decoration:underline;color:black' id='scheduleAID2'>{schedule}</a></td>\n\t\t\t</tr>\n\t\t</tr>\t\t\n\t\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "SavePerformancesReboot{$t}()", 34) . "</td>\n\t\t</tr>\t\t\t\n\t\t</tbody>\t\t\t\t\t\t\t\n\t\t</table>\n<script>\n\n\tvar x_SavePerformancesReboot{$t}=function (obj) {\n\t\tLoadRebootSection();\n\t}\t\n\n\n\t  function SavePerformancesReboot{$t}(){\n\t  \tvar XHR = new XHRConnection();\n\t  \t\n\t  \tif(document.getElementById('DisableForceFCK').checked){XHR.appendData('DisableForceFCK',1);}else{XHR.appendData('DisableForceFCK',0);}\n\t  \tif(document.getElementById('NoDryReboot').checked){XHR.appendData('NoDryReboot',1);}else{XHR.appendData('NoDryReboot',0);}\n\t  \tif(document.getElementById('NoOutOfMemoryReboot').checked){XHR.appendData('NoOutOfMemoryReboot',1);}else{XHR.appendData('NoOutOfMemoryReboot',0);}\n\t  \tif(document.getElementById('AutoRebootSchedule').checked){XHR.appendData('AutoRebootSchedule',1);}else{XHR.appendData('AutoRebootSchedule',0);}\n\t  \tXHR.appendData('AutoRebootScheduleText',document.getElementById('AutoRebootScheduleText').value);\n\t  \tAnimateDiv('{$t}-reboot');\n\t  \tXHR.sendAndLoad('{$page}', 'POST',x_SavePerformancesReboot{$t});\n\t  }\n\n\n\n\n\t\tfunction CheckRebootSchedule(){\n\t\t\tif(!document.getElementById('AutoRebootSchedule').checked){\n\t\t\t\tdocument.getElementById('scheduleAID2').style.color='#CCCCCC';\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('scheduleAID2').style.color='black';\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\tCheckRebootSchedule();\n</script>\t\t\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 28
0
function FreshClamOptions()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $FreshClamCheckDay = intval($sock->GET_INFO("FreshClamCheckDay"));
    $FreshClamMaxAttempts = intval($sock->GET_INFO("FreshClamMaxAttempts"));
    $EnableFreshClam = intval($sock->GET_INFO("EnableFreshClam"));
    if ($FreshClamCheckDay == 0) {
        $FreshClamCheckDay = 16;
    }
    if ($FreshClamMaxAttempts == 0) {
        $FreshClamMaxAttempts = 5;
    }
    for ($i = 1; $i < 25; $i++) {
        $FreshClamCheckDayZ[$i] = "{$i} {times}";
    }
    $t = time();
    $EnableClamavUnofficial = intval($sock->GET_INFO("EnableClamavUnofficial"));
    $SecuriteInfoCode = $sock->GET_INFO("SecuriteInfoCode");
    $html = "\n<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{service_status}:</td>\n\t\t<td><div id='freshclam-status'></div></td>\n\t</tr>\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{enable_service}:</td>\n\t\t<td>" . Field_checkbox_design("EnableFreshClam", 1, $EnableFreshClam) . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>" . texttooltip("{MaxAttempts}", "{MaxAttempts_text}") . ":</td>\n\t\t<td>" . Field_text('FreshClamMaxAttempts', $FreshClamMaxAttempts, 'width:150px;font-size:18px') . "</td>\n\t</tr>\t\t\t\n\t<tr>\n\t\t<td valign='top' class=legend style='font-size:18px'>" . texttooltip("{check_times}", "{FreshClamCheckDay}") . "</td>\n\t\t<td>" . Field_array_Hash($FreshClamCheckDayZ, "FreshClamCheckDay", $FreshClamCheckDay, "style:font-size:18px") . "</td>\n\t</tr>\t\t\t\n\t\t\t\n\t<tr>\n\t\t<td valign='top' class=legend style='font-size:18px'>" . texttooltip("{clamav_unofficial}", "<strong>{enable_clamav_unofficial}</strong>{clamav_unofficial_text}") . "</td>\n\t\t<td>" . Field_checkbox_design("EnableClamavUnofficial", 1, $EnableClamavUnofficial) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' class=legend style='font-size:18px'>" . texttooltip("{securiteinfo_code}", "{securiteinfo_code_explain}") . "</td>\n\t\t<td>" . Field_text("SecuriteInfoCode", $SecuriteInfoCode, "font-size:18px;width:400px") . "</td>\n\t</tr>\n\n\t<tr style='height:80px'>\n\t\t<td colspan=2 align='right'>" . button("{apply}", "Save{$t}()", 26) . "</td>\n\t</tr>\n\t</table>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar response=obj.responseText;\n\tif(response){alert(response);}\n    Loadjs('clamav.freshclam.progress.php');\n\t}\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('EnableClamavUnofficial').checked){\n\t\tXHR.appendData('EnableClamavUnofficial',1);\n\t}else{\n\t\tXHR.appendData('EnableClamavUnofficial',0);\n\t}\n\t\n\t\n\tif(document.getElementById('EnableFreshClam').checked){\n\t\tXHR.appendData('EnableFreshClam',1);\n\t}else{\n\t\tXHR.appendData('EnableFreshClam',0);\n\t}\t\n\tXHR.appendData('FreshClamCheckDay',document.getElementById('FreshClamCheckDay').value);\n\tXHR.appendData('SecuriteInfoCode',document.getElementById('SecuriteInfoCode').value);\n\tXHR.appendData('FreshClamMaxAttempts',document.getElementById('FreshClamMaxAttempts').value);\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t\n\t}\n\t\n\tLoadAjax('freshclam-status','{$page}?freshclam-status=yes');\n\t\n</script>\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 29
0
function accounts_popup()
{
    $ID = $_GET["ID"];
    $t = $_GET["t"];
    $tt = $_GET["tt"];
    $userid = $_GET["userid"];
    $t = time();
    $services["RDP"] = "RDP";
    $services["VNC"] = "VNC";
    $page = CurrentPageName();
    $tpl = new templates();
    $btname = "{add}";
    $q = new mysql_squid_builder();
    if ($ID > 0) {
        $btname = "{apply}";
        $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM rdpproxy_items WHERE ID='{$ID}'"));
    }
    if (!is_numeric($ligne["alive"])) {
        $ligne["alive"] = 720000;
    }
    if (!is_numeric($ligne["is_rec"])) {
        $ligne["is_rec"] = 0;
    }
    if (!is_numeric($ligne["serviceport"])) {
        $ligne["serviceport"] = 3389;
    }
    $distance = time() + $ligne["alive"];
    $dis = distanceOfTimeInWords(time(), $distance, true);
    $html = "<div id='anim-{$t}'></div>\n\t<div style='width:98%' class=form>\n\t<table style='width:99%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{hostname}:</td>\n\t\t<td>" . Field_text("service-{$t}", $ligne["service"], "font-size:22px;width:430px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{type}:</td>\n\t\t<td>" . Field_array_Hash($services, "servicetype-{$t}", $ligne["servicetype"], "style:font-size:22px") . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{ipaddr}:</td>\n\t\t<td>" . Field_text("rhost-{$t}", $ligne["rhost"], "font-size:22px;width:430px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{listen_port}:</td>\n\t\t<td>" . Field_text("serviceport-{$t}", $ligne["serviceport"], "font-size:22px;width:430px") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{username}:</td>\n\t\t<td>" . Field_text("username-{$t}", $ligne["username"], "font-size:22px;width:430px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{domain}:</td>\n\t\t<td>" . Field_text("domain-{$t}", $ligne["domain"], "font-size:22px;width:430px") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{password}:</td>\n\t\t<td>" . Field_password("password-{$t}", $ligne["password"], "font-size:22px;width:430px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{alive}:</td>\n\t\t<td style='font-size:16px'>" . Field_text("alive-{$t}", $ligne["alive"], "font-size:22px;width:160px") . "&nbsp;{seconds}</td>\n\t</tr>\t\n\t<tr><td colspan=2 align='right'><span style='font-size:16px'><i>{$dis}</i></span></td></tr>\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{record_session}:</td>\n\t\t<td style='font-size:22px'>" . Field_checkbox_design("is_rec-{$t}", 1, $ligne["is_rec"]) . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td colspan=2 align=right><hr>" . button("{$btname}", "Save{$t}()", 30) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n<script>\nvar x_Save{$t}= function (obj) {\n\tvar ID='{$ID}';\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);document.getElementById('{$t}').innerHTML='';return;}\n\tif(document.getElementById('{$t}')){document.getElementById('{$t}').innerHTML='';}\n\tif(document.getElementById('anim-{$t}')){document.getElementById('anim-{$t}').innerHTML='';}\n\tif(ID==0){YahooWin3Hide();}\n\t\$('#flexRT{$_GET["t"]}').flexReload();\n\t\$('#flexRT{$_GET["tt"]}').flexReload();\n}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar is_rec=0;\n\tif( document.getElementById('is_rec-{$t}').checked){is_rec=1;}\n\tXHR.appendData('username', encodeURIComponent(document.getElementById('username-{$t}').value));\n\tXHR.appendData('password', encodeURIComponent(document.getElementById('password-{$t}').value));\n\tXHR.appendData('rhost', encodeURIComponent(document.getElementById('rhost-{$t}').value));\n\tXHR.appendData('serviceport', encodeURIComponent(document.getElementById('serviceport-{$t}').value));\n\tXHR.appendData('username', encodeURIComponent(document.getElementById('username-{$t}').value));\n\tXHR.appendData('domain', encodeURIComponent(document.getElementById('domain-{$t}').value));\n\tXHR.appendData('service', encodeURIComponent(document.getElementById('service-{$t}').value));\n\tXHR.appendData('servicetype', encodeURIComponent(document.getElementById('servicetype-{$t}').value));\n\t\n\t\n\tXHR.appendData('alive', encodeURIComponent(document.getElementById('alive-{$t}').value));\n\tXHR.appendData('ID', '{$ID}');\n\tXHR.appendData('userid', '{$userid}');\n\tXHR.appendData('is_rec', is_rec);\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',x_Save{$t});\n}\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemplo n.º 30
0
function ipv6()
{
    $sock = new sockets();
    $smtp_bind_address6 = $sock->GET_INFO("smtp_bind_address6");
    $PostfixEnableIpv6 = $sock->GET_INFO("PostfixEnableIpv6");
    $tpl = new templates();
    $page = CurrentPageName();
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%>\n\t<img src='img/folder-network-128.png' id='smtp_bind_address6_img'>\n\t</td>\n\t<td valign='top' style='padding-left:15px'>\n\t<div class=explain style='font-size:18px'>{smtp_bind_address6}</div>\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:26px'>{enable_ipv6}:</td>\n\t\t<td>" . Field_checkbox_design("PostfixEnableIpv6", 1, $PostfixEnableIpv6, "PostfixEnableIpv6Check()") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:26px'>{addr}:</td>\n\t\t<td>" . Field_text("smtp_bind_address6", $smtp_bind_address6, "font-size:26px;padding:3px;width:520px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align=right><hr>" . button("{apply}", "smtp_bind_address6_save()", 40) . "</td>\n\t</tr>\n\t</table>\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\tvar x_smtp_bind_address6_save= function (obj) {\n\t\t\tif(document.getElementById('main_config_postfix_net')){RefreshTab('main_config_postfix_net');}\n\t\t\tif(document.getElementById('main_config_postfix')){RefreshTab('main_config_postfix');}\n\t\t\t}\t\n\t\n\t\n\t\tfunction smtp_bind_address6_save(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('smtp_bind_address6',document.getElementById('smtp_bind_address6').value);\n\t\t\tdocument.getElementById('smtp_bind_address6_img').src='img/wait_verybig.gif';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_smtp_bind_address6_save);\t\t\t\n\t\t}\n\t\t\n\t\tfunction PostfixEnableIpv6Check(){\n\t\t\tdocument.getElementById('smtp_bind_address6').disabled=true;\n\t\t\tif(document.getElementById('PostfixEnableIpv6').checked){\n\t\t\t\tdocument.getElementById('smtp_bind_address6').disabled=false;\n\t\t\t}\n\t\t}\nPostfixEnableIpv6Check();\n\t</script>\n\t\t\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}