function popup() { $priv = new usersMenus(); $ct = new user($_GET["popup"]); $sock = new sockets(); $lvm = new lvm_org($ct->ou); $array = $lvm->disklist; $paths["/home/{$ct->uid}"] = "/home/{$ct->uid} ({system_disk})"; if (is_array($array)) { while (list($num, $val) = each($array)) { $sock = new sockets(); $results = $sock->getFrameWork("cmd.php?fstab-get-mount-point=yes&dev={$num}"); $array2 = unserialize(base64_decode($results)); while (list($num, $mounted) = each($array2)) { $paths[trim("{$mounted}/{$ct->uid}")] = dirname(trim($mounted . '/' . $ct->uid) . "({dedicated_storage})"); } } } $loginShell_hidden = Field_hidden('loginShell', $us->loginShell) . Field_hidden('uidNumber', $us->uidNumber); $loginShell = "<tr>\n\t\t\t\t\t<td align='right' nowrap class=legend {$styleTDRight}>{loginShell}:</strong>\n\t\t\t\t\t<td {$styleTDLeft}>\n\t\t\t\t\t\t\t<table style='width:100%;margin-left:-4px;'>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align=left width=1%>" . Field_text('loginShell', $us->loginShell, 'width:90px') . "</td>\n\t\t\t\t\t\t\t<td align=left>" . help_icon('{loginShellText}', true) . "</td>\n\t\t\t\t\t\t\t<td class=legend nowrap>{UidNumber}:</td>\n\t\t\t\t\t\t\t<td align=left width=1%>" . Field_text('uidNumber', $us->uidNumber, 'width:90px') . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>"; $dotclear = "<tr>\n\t\t<td class=legend nowrap>{DotClearUserEnabled}:</td>\n\t\t<td align=left width=1%>" . Field_numeric_checkbox_img('DotClearUserEnabled', $us->DotClearUserEnabled) . "</td>\n\t\t<td align=left>" . help_icon('{DotClearUserEnabledText}', true) . "</td>\n\t</tr>"; $form = Field_hidden('USER_SYSTEM_INFOS_UID', $ct->uid) . "\n\t<div style='text-align:right;margin-top:-5px;margin-bottom:9px;'><code>{home}:{$ct->homeDirectory}</code></div>\n\t<div id='ChangeUserPasswordID'>\n\t<table style='width:100%'>\n\t\n\t<tr>\n\t\t<td class=legend nowrap>{loginShell}:</td>\n\t\t<td align=left width=1%>" . Field_text('loginShell', $ct->loginShell, 'width:190px') . "</td>\n\t\t<td align=left>" . help_icon('{loginShellText}', true) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap>{homeDirectory}:</td>\n\t\t<td align=left width=1%>" . Field_array_Hash($paths, 'homeDirectory', $ct->homeDirectory) . "</td>\n\t\t<td align=left>" . help_icon('{homeDirectoryText}', true) . "</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td class=legend nowrap>{UidNumber}:</td>\n\t\t<td align=left width=1%>" . Field_text('UidNumber', $ct->uidNumber, 'width:90px') . "</td>\n\t\t<td align=left>" . help_icon('{UidNumberText}', true) . "</td>\n\t</tr>\n\t\t\n\t\t\n\t<tr><td colspan=3><hr></td></tr>\n\t<tr>\n\t\t<td colspan=3 align='right'>" . button("{edit}", "UserSystemInfosSave()") . "\n\t</tr>\n\t</table>\n\t</div>\n\t"; $form = RoundedLightWhite($form); $safebox = Paragraphe("safe-box-64.png", "{coffrefort}", "{coffrefort_create_user}", "javascript:Loadjs('domains.edit.user.safebox.php?uid={$ct->uid}')"); if (!$priv->CRYPTSETUP_INSTALLED) { $safebox = null; } $html = "<H1>{UserSystemInfos}</H1>\n\t<div style='margin-top:-35px;text-align:right;margin-bottom:30px;width:95%'>\n\t\t<i style='font-size:16px;font-weight:bold;padding-bottom:4px;color:white'>{$ct->DisplayName}</i>\n\t</div>\n\t<div id='UserSystemInfosSave'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t{$safebox}\n\t\t</td>\n\t\t<td valign='top'>\n\t\t\t{$form}\n\t\t</td>\n\t</tr>\n\t</table>\n\t\n\t</div>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function popup_add_contact() { $page = CurrentPageName(); $ou_decrypted = base64_decode($_GET["ou"]); $ID = $_GET["ID"]; $q = new mysql(); $sql = "SELECT * FROM emailing_db_paths WHERE ou='{$ou_decrypted}' and merged=0 ORDER BY ID DESC"; $results = $q->QUERY_SQL($sql, "artica_backup"); while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { $databasename = $ligne["databasename"]; $hash[$databasename] = $databasename; } $dbs = Field_array_Hash($hash, "database", null, null, null, 0, "font-size:13px;padding:3px"); $logo = "contact-card-add-128.png"; $button_title = "{add}"; $resfresh_after = "RefreshTab('emailing_campaigns');"; if ($_GET["dbname"] != null) { $dbs = Field_hidden("database", $_GET["dbname"]) . "<span style='font-size:13px'>{$_GET["dbname"]}</span>"; $js_add = "ContactHideDBADD()"; if ($ID != null) { $logo = "contact-card-show-128.png"; $button_title = "{edit}"; $resfresh_after = null; $sql = "SELECT * FROM emailing_{$_GET["dbname"]} WHERE ID={$ID}"; $q = new mysql(); $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); } } $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=1%>\n\t\t<img src='img/{$logo}'>\n\t\t</td>\n\t\t<td valign='top'>\n\t\t\t<div id='emailing_add_contact_div'>\n\t\t\t" . Field_hidden("ID", $_GET["ID"]) . "\n\t\t\t<table style='width:100%'>\n\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:13px'>{gender}:</td>\n\t\t\t\t\t<td>" . Field_text("gender", $ligne["gender"], "font-size:13px;padding:3px", null, null, null, false, "AddContactPressKey(event)") . "</td>\n\t\t\t\t</tr>\t\t\t\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:13px'>{firstname}:</td>\n\t\t\t\t\t<td>" . Field_text("firstname", $ligne["firstname"], "font-size:13px;padding:3px", null, null, null, false, "AddContactPressKey(event)") . "</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:13px'>{lastname}:</td>\n\t\t\t\t\t<td>" . Field_text("lastname", $ligne["lastname"], "font-size:13px;padding:3px", null, null, null, false, "AddContactPressKey(event)") . "</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:13px'>{email}:</td>\n\t\t\t\t\t<td>" . Field_text("email", $ligne["email"], "font-size:13px;padding:3px", null, null, null, false, "AddContactPressKey(event)") . "</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:13px'>{phone}:</td>\n\t\t\t\t\t<td>" . Field_text("phone", $ligne["phone"], "font-size:13px;padding:3px", null, null, null, false, "AddContactPressKey(event)") . "</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:13px'>{city}:</td>\n\t\t\t\t\t<td>" . Field_text("city", $ligne["city"], "font-size:13px;padding:3px", null, null, null, false, "AddContactPressKey(event)") . "</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:13px'>{CP}:</td>\n\t\t\t\t\t<td>" . Field_text("cp", $ligne["cp"], "font-size:13px;padding:3px", null, null, null, false, "AddContactPressKey(event)") . "</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:13px'>{PostalAddress}:</td>\n\t\t\t\t\t<td><textarea name='postaladdress' id='postaladdress' style='font-size:13px;width:100%;height:80px'>{$ligne["postaladdress"]}</textarea></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:13px'>{database}:</td>\n\t\t\t\t\t<td>{$dbs}</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:13px'>{or_add_db}:</td>\n\t\t\t\t\t<td>" . Field_text("db_add", null, "font-size:13px;padding:3px", null, null, null, false, "AddContactPressKey(event)") . "</td>\n\t\t\t\t</tr>\t\t\t\t\t\t\t\t\n\t\t\t\t<tr><td colspan=2 align='right'><hr>" . button("{$button_title}", "eMailingAddContact()") . "</td></tr>\n\t\t\t\t</table>\n\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t</td>\n\t</tr>\n\t</table>\n\t<script>\n\t\t\n\tvar x_eMailingAddContact= function (obj) {\n\t\t\tvar tempvalue=obj.responseText;\n\t\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\t\tYahooWin5Hide();\n\t\t\t{$resfresh_after}\n\t\t\t\n\t\t}\t\t\n\t\n\t\tfunction eMailingAddContact(){\n\t\t\t \tvar XHR = new XHRConnection();\n\t \t\tXHR.appendData('add-contact','yes');\n\t \t\tXHR.appendData('ou','{$_GET["ou"]}');\n\t \t\tXHR.appendData('gender',document.getElementById('gender').value);\n\t \t\tXHR.appendData('firstname',document.getElementById('firstname').value);\n\t \t\tXHR.appendData('lastname',document.getElementById('lastname').value);\n\t \t\tXHR.appendData('email',document.getElementById('email').value);\n\t \t\tXHR.appendData('phone',document.getElementById('phone').value);\n\t \t\tXHR.appendData('city',document.getElementById('city').value);\n\t \t\tXHR.appendData('cp',document.getElementById('cp').value);\n\t \t\tXHR.appendData('postaladdress',document.getElementById('postaladdress').value);\n\t \t\tXHR.appendData('database',document.getElementById('database').value);\n\t \t\tXHR.appendData('db_add',document.getElementById('db_add').value);\n\t \t\tXHR.appendData('ID',document.getElementById('ID').value);\n\t \t\tdocument.getElementById('emailing_add_contact_div').innerHTML='<center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center>';\n\t\t \t\tXHR.sendAndLoad('{$page}', 'GET',x_eMailingAddContact);\t\n\t\t\t\t\n\t\t}\n\t\t\n\t\tfunction ContactHideDBADD(){\n\t\t\tdocument.getElementById('db_add').disabled=true;\n\t\t}\n\t\t\n\t\t\n\tfunction AddContactPressKey(e){\n\t\tif(checkEnter(e)){eMailingAddContact();}\n\t}\n\t\n\t{$js_add}\n\t</script>\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body("{$html}"); }
function popup() { $ou = base64_decode($_GET["ou"]); $sql = "SELECT ID,enabled,report_datas FROM reports WHERE ou='{$ou}' AND report_type=1"; $q = new mysql(); $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); $array = unserialize(base64_decode($ligne["report_datas"])); if ($array["day"] == null) { $array["day"] = 1; } if ($array["hour"] == null) { $array["hour"] = "5"; } if ($array["min"] == null) { $array["min"] = "0"; } if ($array["lastdays"] == null) { $array["lastdays"] = "7"; } $cron = new cron_macros(1); $days = $cron->cron_days; for ($i = 1; $i < 60; $i++) { $lastdays[$i] = $i; } $html = "\n\t" . Field_hidden("ID", $ligne["ID"]) . "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'><img src='img/postmaster-identity-128.png' id='report-image'></td>\n\t\t<td>\n\t\t<div style='font-size:14px' class=explain>{global_director_report_explain}</div>\n\t\t<table style='width:99%' class=form>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{enabled}:</td>\n\t\t\t<td>" . Field_checkbox("report_enabled", 1, $ligne["enabled"]) . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{generate_report_each}:</td>\n\t\t\t<td>" . Field_array_Hash($days, "day", $array["day"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{time}:</td>\n\t\t\t<td><table style='width:1%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t" . Field_array_Hash($cron->cron_hours, "hour", $array["hour"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t\t\t\t<td width=1% style='font-size:13px'>:</td>\n\t\t\t\t\t<td>" . Field_array_Hash($cron->cron_mins, "min", $array["min"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{recipient}:</td>\n\t\t\t<td>" . Field_text("recipient", $array["recipient"], "font-size:13px;padding:3px") . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:13px'>{last_days}:</td>\n\t\t\t<td>" . Field_array_Hash($lastdays, "lastdays", $array["lastdays"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t\t<td colspan='2' align='right'><hr>" . button("{apply}", "DIRECTOR_SAVE()") . "</td>\n\t\t</tr>\n\t\t\n\t\t</table>\n\t\t\n\t\t\n\t\t</td>\n\t</tr>\n\t</table>\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function popup() { $ou = $_GET["ou"]; $t = $_GET["t"]; $ldap = new clladp(); $tpl = new templates(); $page = CurrentPageName(); if (!is_numeric($t)) { $t = time(); } $EnCryptedFunction = $_GET["EnCryptedFunction"]; if (strlen($EnCryptedFunction) > 3) { $EnCryptedFunction = base64_decode($EnCryptedFunction) . "\n"; } else { $EnCryptedFunction = null; } if ($ou == null) { if (isAdmin()) { $OUS = $ldap->hash_get_ou(true); $FieldOu = Field_array_Hash($OUS, "ou-{$t}", null, null, null, 0, "font-size:18px"); } else { $FieldOu = Field_hidden("ou-{$t}", $_SESSION["ou"]) . "<span style='font-size:18px'>{$_SESSION["ou"]}</span>"; } } else { $FieldOu = Field_hidden("ou-{$t}", $ou) . "<span style='font-size:18px'>{$_SESSION["ou"]}</span>"; } $html = "\n\t\t\t\n\t<div id='animate-{$t}'></div>\t\t\n\t<table style='width:98%' class=form>\n\t\t<tr>\n\t\t <td class=legend style='font-size:18px'>{domain}:</td>\n\t\t <td>" . Field_text("domain-{$t}", null, "font-size:18px;font-weigth:bold", null, null, null, false, "AddDomainCk{$t}(event)") . "</td>\n\t\t</tr>\n\t\t<td class=legend style='font-size:18px'>{organization}:</td> \t\t\n\t\t <td>{$FieldOu}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=2 align='right'>" . button("{add}", "AddDomain{$t}()", "20px") . "</td>\n\t\t</tr>\n\t</table>\n\t\t\t\t\t\n<script>\nvar x_AddDomain{$t}=function(obj){\n\tdocument.getElementById('animate-{$t}').innerHTML='';\n\tvar text;\n\ttext=obj.responseText;\n\tif(text.length>3){alert(text);return;}\n\t\$('#flexRT{$t}').flexReload();\n\tYahooUserHide();\n\t{$EnCryptedFunction}\n\t\n\t\n}\n\nfunction AddDomainCk{$t}(e){\n\tif(checkEnter(e)){ AddDomain{$t}();}\n}\n\nfunction AddDomain{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('perform','yes');\n\tvar ou=document.getElementById('ou-{$t}').value;\n\tif(ou.length<3){alert('Organization:`'+ou+'` not supported');return;}\n\tXHR.appendData('ou',document.getElementById('ou-{$t}').value);\n\tXHR.appendData('domain',document.getElementById('domain-{$t}').value);\n\tAnimateDiv('animate-{$t}');\n\tXHR.sendAndLoad('{$page}', 'POST',x_AddDomain{$t}); \n}\n</script>\t\t\t\t\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function INDEX_CREATE() { $ldap = new clladp(); if ($_GET["ou"] == null) { die; } $_GET["ou"] = base64_decode($_GET["ou"]); $hash = $ldap->hash_groups($_GET["ou"], 1); $domains = $ldap->hash_get_domains_ou($_GET["ou"]); if (count($domains) == 0) { $users = new usersMenus(); if ($users->POSTFIX_INSTALLED) { $field_domains = Field_text('user_domain', "{$_GET["ou"]}.com", "width:85px"); } else { if (!preg_match("#(.+?)\\.(.+)#", $_GET["ou"])) { $dom = "{$_GET["ou"]}.com"; } else { $dom = "{$_GET["ou"]}"; } $field_domains = "<code><strong>{$dom}</strong></code>" . Field_hidden('user_domain', "{$dom}", "width:120px"); } } else { $field_domains = Field_array_Hash($domains, 'user_domain', "style:font-size:18px;padding:3px"); } $tpl = new templates(); $hash[null] = "{select}"; $groups = Field_array_Hash($hash, 'group_id', $_GET["gpid"], "style:font-size:18px;padding:3px"); $error_no_password = $tpl->javascript_parse_text("{error_no_password}"); $error_no_userid = $tpl->javascript_parse_text("{error_no_userid}"); $t = time(); $title = "{$_GET["ou"]}:{create_user}"; $step1 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(1)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre1_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{name_the_new_account_title}:</div>\n\t" . Field_text('new_userid', null, "font-size:18px;padding:3px;font-weight:bold;color:#C80000", null, "UserAutoChange_eMail()", null, false, "UserADDCheck(event)") . "\n\n\t</td>\n\t</tr>\n\t</table></div>"; $step2 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(2)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre2_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{email}</div><br>\n\t<input type='hidden' name='email' value='' id='email'>\n\t<span id='prefix_email' style='width:90px;border:1px solid #CCCCCC;padding:2px;font-size:18px;font-weight:bold;margin:2px'>\n\t</span>@{$field_domains} \n\t<div style='text-align:right;font-size:14px;'><i><a href='javascript:ChangeAddUsereMail();'>{change}</a></i>\n\t\n\t</td>\n\t</tr>\n\t</table></div>"; $step3 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(4)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre3_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{password}</div>\n\t" . Field_password("password-{$t}", null, "font-size:18px;padding:3px;width:190px;letter-spacing:3px", null, null, null, false, "UserADDCheck(event)") . "\n\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t"; $step4 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(3)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre4_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{group}</div>\n\t<div style='font-size:18px;margin-bottom:5px'>{select_user_group_title}:</div><br>{$groups}\n\t</td>\n\t</tr>\n\t</table></div>\n\t"; if ($_GET["gpid"] > 0) { $step4 = "<input type='hidden' id='group_id' value='{$_GET["gpid"]}'>"; } $html = "\n\t<input type='hidden' id='ou-mem-add-form-user' value='{$_GET["ou"]}'>\n\t<input type='hidden' id='ou' value='{$_GET["ou"]}'>\n\t<div id='adduser_ajax_newfrm' style='margin-top:5px'>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%' class=TableRemove>\n\t<tr>\n\t<td valign='top' style='width:450px;vertical-align:top'>\n\t\t<table style='width:450px'>\n\t\t<tr>\n\t\t\t<td valign='top' width=290px>{$step1}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top'>{$step2}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top'><br>{$step3}</td>\n\t\t</tr>\n\t\t\t<td valign='top'><br>{$step4}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'>\n\t\t\t\t<hr>" . button("{add}", "UserADDSubmit()", 26) . "\n\t\t\t</td>\n\t\t</tr>\t\t\t\n\t\t</table>\n\t</td>\n\t<td valign='top' style='width:50%'>\n\t\t\t<center style='margin-bottom:8px'><img src='img/add-woman-256.png'></center>\n\t\t\t<div style='padding-left:10px'>\t\t\n\t\t\t\t<div class=text-info id='text-1' style='font-size:16px'>{name_the_new_account_explain}</div>\n\t\t\t\t<div class=text-info id='text-2' style='font-size:16px'>{user_email_text}</div>\n\t\t\t\t<div class=text-info id='text-3' style='font-size:16px'>{select_user_group_text}</div>\n\t\t\t\t<div class=text-info id='text-4' style='font-size:16px'>{give_password_text}</div>\n\t\t\t</div>\n\t\t\t\n\t</td>\n\t</tr>\t\n\t</table>\n\t</div>\n\t</div>\n\t<input type='hidden' id='flexRTMEM' value='{$_GET["flexRT"]}'>\n\t<script>\n\t\tfunction VerifyFormAddUserCheck(){\n\t\t\tvar pass;\n\t\t\tvar uid;\n\t\t\tpass=document.getElementById('password-{$t}').value;\n\t\t\tuid=document.getElementById('new_userid').value;\n\t\t\tif(uid.length<1){alert('{$error_no_userid}');return false;}\n\t\t\tif(pass.length<1){alert('{$error_no_password}');return false;}\n\t\t\treturn true;\n\t\t\t}\n\t\t\n\t\tfunction UserADDSubmit(){\n\t\t\tif(!VerifyFormAddUserCheck()){return;}\n\t\t\tUserADD{$t}();\n\t\t}\n\t\n\t\n\t\tfunction UserADDCheck(e){\n\t\t\tif(checkEnter(e)){UserADDSubmit();}\n\t\t}\n\t\t\n\t\tfunction HideExplainAll(id){\n\t\t\tdocument.getElementById('text-1').style.display='none';\n\t\t\tdocument.getElementById('text-2').style.display='none';\n\t\t\tdocument.getElementById('text-3').style.display='none';\n\t\t\tdocument.getElementById('text-4').style.display='none'; \n\t\t\tif(document.getElementById('text-'+id)){\n\t\t\t\tdocument.getElementById('text-'+id).style.display='block';\n\t\t\t\t} \n\t\t\t\n\t\t}\n\t\t\nfunction UserADD{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tvar ou=document.getElementById('ou').value;\n\t\tif(ou.length==0){if(document.getElementById('ou-mem-add-form-user')){ou=document.getElementById('ou-mem-add-form-user').value;}}\n\t\tif(ou.length==0){Alert('Unable to stat Organization name (ou field is empty)');return;}\n\t\t\n\t\tXHR.appendData('ou',ou);\n\t\tXHR.appendData('new_userid',document.getElementById('new_userid').value);\n\t\tXHR.appendData('password',document.getElementById('password-{$t}').value);\n\t\tXHR.appendData('group_id',document.getElementById('group_id').value);\n\t\tXHR.appendData('email',document.getElementById('email').value);\n\t\tXHR.appendData('user_domain',document.getElementById('user_domain').value);\n\t\t\n\t\tif(document.getElementById('adduser_ajax_newfrm')){AnimateDiv('adduser_ajax_newfrm');}\n\t\tif(document.getElementById('bglego')){document.getElementById('bglego').src='img/wait_verybig.gif';}\n\t\tif(document.getElementById('member_add_to_wait')){AnimateDiv('member_add_to_wait');}\n\t\tXHR.sendAndLoad('domains.edit.user.php', 'POST',X_UserADD);\t\n\t}\t\t\n\t\n\t\n\t\t\n\t\tHideExplainAll();\n</script>\t\n\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function INDEX_CREATE() { $ldap = new clladp(); if ($_GET["ou"] == null) { die; } $_GET["ou"] = base64_decode($_GET["ou"]); $hash = $ldap->hash_groups($_GET["ou"], 1); $domains = $ldap->hash_get_domains_ou($_GET["ou"]); if (count($domains) == 0) { $users = new usersMenus(); if ($users->POSTFIX_INSTALLED) { $field_domains = Field_text('user_domain', "{$_GET["ou"]}.com", "width:85px"); } else { if (!preg_match("#(.+?)\\.(.+)#", $_GET["ou"])) { $dom = "{$_GET["ou"]}.com"; } else { $dom = "{$_GET["ou"]}"; } $field_domains = "<code><strong>{$dom}</strong></code>" . Field_hidden('user_domain', "{$dom}", "width:120px"); } } else { $field_domains = Field_array_Hash($domains, 'user_domain'); } $hash[null] = "{select}"; $groups = Field_array_Hash($hash, 'group_id', $_GET["gpid"]); $title = "{$_GET["ou"]}:{create_user}"; $step1 = "<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre1.png'></td>\n\t<td valign='top'>\n\t<H3>{name_the_new_account_title}</H3><br>\n\t<strong>{name_the_new_account_field}:</strong>\n\t<br>" . Field_text('new_userid', null, null, null, "UserAutoChange_eMail()") . "\n\t<div class=caption>{name_the_new_account_explain}</div>\n\t</td>\n\t</tr>\n\t</table>"; $step2 = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre2.png'></td>\n\t<td valign='top'>\n\t<H3>{email}</H3><br>\n\t<strong>{email}:</strong>\n\t<br><input type='hidden' name='email' value='' id='email'>\n\t<span id='prefix_email' style='width:90px;border:1px solid #CCCCCC;padding:2px;font-size:11px;font-weight:bold;margin:2px'></span>@{$field_domains} <a href='javascript:ChangeAddUsereMail();'>[{change}]</a>\n\t<div class=caption>{user_email_text}</div>\n\t</td>\n\t</tr>\n\t</table>"; $step3 = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre3.png'></td>\n\t<td valign='top'>\n\t<H3>{password}</H3><br>\n\t<strong>{give_password}:</strong>\n\t<br>" . Field_password('password') . "\n\t<div class=caption>{give_password_text}</div>\n\t</td>\n\t</tr>\n\t</table>\n\t"; $step4 = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre4.png'></td>\n\t<td valign='top'>\n\t<H3>{group}</H3><br>\n\t<strong>{select_user_group_title}:</strong>{$groups}\n\t<div class=caption>{select_user_group_text}</div>\n\t</td>\n\t</tr>\n\t</table>\n\t"; if ($_GET["gpid"] > 0) { $step4 = "<input type='hidden' id='group_id' value='{$_GET["gpid"]}'>"; } $html = "\n\t<input type='hidden' id='ou-mem-add-form-user' value='{$_GET["ou"]}'>\n\t<input type='hidden' id='ou' value='{$_GET["ou"]}'>\n\t<div style='float:right'><img src='img/64_bg_lego.png'></div><H1>{$title}</H1>\n\t<p class=caption>{create_user_text}</p>\n\t<div id='adduser_ajax_newfrm'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>{$step1}</td>\n\t<td valign='top'>{$step2}</td>\n\t</tr>\n\t<tr>\n\t<td valign='top'><br>{$step3}\n\t</td>\n\t<td valign='top'><br>{$step4}</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2>\n\t<hr>\n\t<div style='padding:10px;text-align:right'>\n\t\t" . button("{add}", "UserADD()") . "\n\t\n\t</td>\n\t</tr>\t\t\n\t\n\t</table>\n\t</div>\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function vps_edit_params() { $sock = new sockets(); $LXCBridged = $sock->GET_INFO("LXCBridged"); $LXCInterface = $sock->GET_INFO("LXCInterface"); if (!is_numeric($LXCBridged)) { $LXCBridged = 0; } $page = CurrentPageName(); $users = new usersMenus(); $tpl = new templates(); $q = new mysql(); if ($users->AsVirtualBoxManager) { $AsVirtualBoxManager = 1; } else { $AsVirtualBoxManager = 0; } $sql = "SELECT * FROM lxc_machines WHERE ID={$_GET["ID"]}"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); $button_text = "{apply}"; if ($_GET["ID"] == 0) { $button_text = "{add}"; } $machine_name = $ligne["machine_name"]; $hostname = $ligne["hostname"]; $rootpwd = $ligne["rootpwd"]; $ChangeMac = $ligne["ChangeMac"]; if ($ligne["MacAddr"] == null) { $mc = new MACAddress(); $mc->separator = ":"; $ligne["MacAddr"] = $mc->_generateMAC2(); } $MacAddr = explode(":", $ligne["MacAddr"]); $templates = unserialize(base64_decode($sock->getFrameWork("lxc.php?lxc-templates=yes"))); $UsePhys = $ligne["UsePhys"]; $PhysNic = $ligne["PhysNic"]; $uid = $ligne["uid"]; $net = new networking(); $interfaces = $net->Local_interfaces(true); while (list($iet, $iet2) = each($interfaces)) { $sql = "SELECT PhysNic FROM lxc_machines WHERE ID!={$_GET["ID"]} AND PhysNic='{$iet}'"; if ($iet == $LXCInterface) { continue; } if ($iet == "eth0") { continue; } if ($iet == "br5") { continue; } $lignePhysNic = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if ($lignePhysNic["PhysNic"] != null) { continue; } $interfacesR[$iet] = $iet; } $interfacesR[$PhysNic] = $PhysNic; $interfacesR[null] = "{select}"; $physCardTable = "\n\t\t<tr>\n\t\t\t<td class=legend>{UsePhysCard}:</td>\n\t\t\t<td>" . Field_checkbox("UsePhys", 1, $UsePhys, "ChangeMacCheck()") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{nic}:</td>\n\t\t\t<td>" . Field_array_Hash($interfacesR, "PhysNic", $PhysNic, "style:font-size:14px;padding:3px") . "</td>\n\t\t</tr>\t\t\n\t\t\n\t\t"; //AA:86:D7:23:0E:51 $macaddrtable = "\n\t\t<table>\n\t\t<tr>\n\t\t\t<td class=legend>{change_mac_address}:</td>\n\t\t\t<td>" . Field_checkbox("ChangeMac", 1, $ChangeMac, "ChangeMacCheck()") . "</td>\n\t\t</tr>\n\t\t</tr>\n\t\t</table>\n\t\t\t\n\t\t<table style='width:1%'>\n\t\t<tr>\n\t\t<td>\n\t\t\t<td>" . Field_text("MAC1", $MacAddr[0], "font-size:14px;padding:3px;width:26px") . "</td>\n\t\t\t<td style='font-size:14px'>:</td>\n\t\t\t<td>" . Field_text("MAC2", $MacAddr[1], "font-size:14px;padding:3px;width:26px") . "</td>\n\t\t\t<td style='font-size:14px'>:</td>\n\t\t\t<td>" . Field_text("MAC3", $MacAddr[2], "font-size:14px;padding:3px;width:26px") . "</td>\n\t\t\t<td style='font-size:14px'>:</td>\n\t\t\t<td>" . Field_text("MAC4", $MacAddr[3], "font-size:14px;padding:3px;width:26px") . "</td>\n\t\t\t<td style='font-size:14px'>:</td>\n\t\t\t<td>" . Field_text("MAC5", $MacAddr[4], "font-size:14px;padding:3px;width:26px") . "</td>\n\t\t\t<td style='font-size:14px'>:</td>\n\t\t\t<td>" . Field_text("MAC6", $MacAddr[5], "font-size:14px;padding:3px;width:26px") . "</td>\n\t\t\t\n\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t</table>"; while (list($filename, $arraytpl) = each($templates)) { $TPLR[$filename] = "{$arraytpl["TYPE"]} {$arraytpl["PROC"]} - v{$arraytpl["VERSION"]}"; } $TPLR[null] = "{select}"; $field_template = Field_array_Hash($TPLR, 'lxc_template', $ligne["template"], "CheckTemplate()", null, 0, "font-size:13px;padding:3px"); if ($_GET["ID"] == 0) { $template = "\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{template}:</td>\n\t\t\t\t<td>{$field_template}</td>\n\t\t\t</tr>"; } $ipaddr = "\n<tr>\n\t<td class=legend>{ipaddr}:</td>\n\t<td>" . Field_text("ipaddr", $ligne["ipaddr"], "font-size:14px;padding:3px;width:120px") . "</td>\n</tr>"; if ($LXCBridged == 0) { $sql = "SELECT nic,ID,ipaddr FROM nics_virtuals WHERE org='LXC-INTERFACES' ORDER BY ID"; $results = $q->QUERY_SQL($sql, "artica_backup"); while ($ligne3 = mysql_fetch_array($results, MYSQL_ASSOC)) { $sql = "SELECT VirtualInterface FROM lxc_machines WHERE VirtualInterface='{$ligne3["nic"]}:{$ligne3["ID"]}'"; $ligne2 = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if ($ligne["VirtualInterface"] != null) { continue; } $Interfaces["{$ligne3["nic"]}:{$ligne3["ID"]}"] = "{$ligne3["nic"]}:{$ligne3["ID"]} ({$ligne3["ipaddr"]})"; } if (count($Interfaces) > 0) { $ipaddr = "<tr>\n\t\t<td class=legend>{ipaddr}:</td>\n\t\t<td colspan=2>" . Field_array_Hash($Interfaces, "VirtualInterface", $ligne["VirtualInterface"], "style:font-size:14px;padding:3px") . "</td>\n\t</tr>"; } else { if (preg_match("#(.+?):(.+)#", $ligne["VirtualInterface"], $re)) { $sql = "SELECT nic,ID,ipaddr FROM nics_virtuals WHERE ID='{$re[2]}'"; $ligne2 = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); } $ipaddr = "<tr>\n\t\t<td class=legend>{ipaddr}:</td>\n\t\t<td colspan=2>" . Field_hidden("VirtualInterface", $ligne["VirtualInterface"]) . "<span style='font-size:14px'>{$ligne["VirtualInterface"]} ({$ligne2["ipaddr"]})</span></td>\n\t\t\n\t</tr>"; } } $BrowseUser = "******"javascript:Loadjs('MembersBrowse.php?field-user=lxc-member&OnlyUsers=yes');\" value='{browse}...'>"; if ($AsVirtualBoxManager == 0) { $BrowseUser = "******"; } $html = "\n<div id='lxc_host_{$_GET["ID"]}'>\n<table style='width:100%' class=form>\n{$template}\n<tr>\n\t<td class=legend>{member}:</td>\n\t<td>" . Field_text("lxc-member", $uid, "font-size:14px;padding:3px;width:210px") . "</td>\n\t<td>{$BrowseUser}</td>\n</tr>\n<tr>\n\t<td class=legend>{computer_name}:</td>\n\t<td colspan=2>" . Field_text("machine_name", $machine_name, "font-size:14px;padding:3px;width:210px") . "</td>\n\t\n</tr>\n<tr>\n\t<td class=legend>{hostname}:</td>\n\t<td colspan=2>" . Field_text("hostname", $hostname, "font-size:14px;padding:3px;width:210px") . "</td>\n\t\n</tr>\n{$ipaddr}\n{$physCardTable}\n<tr>\n\t<td class=legend>{ComputerMacAddress}:</td>\n\t<td colspan=2>{$macaddrtable}</td>\n</tr>\n<tr>\n\t<td class=legend>{rootpwd}:</td>\n\t<td colspan=2>" . Field_password("rootpwd", $rootpwd, "font-size:14px;padding:3px;width:210px") . "</td>\n</tr>\n\n\n\n\n<tr>\n\t<td colspan=3 align='right'><hr>" . button($button_text, "SaveVPSServerSingle{$_GET["ID"]}()") . "</td>\n</tR>\n</table>\n\n\n\n<hr>\n<div style='font-size:16px'>{start_options}</div>\n<div class=explain>{lxc_start_options_text}</div>\n<table style='width:100%' class=form>\n<tr>\n\t<td class=legend>{autostart}:</td>\n\t<td>" . Field_checkbox("autostart", 1, $ligne["autostart"]) . "</td>\n\t<td width=1%>" . help_icon("{lxc_autostart_explain}") . "</td>\n</tr>\n<tr>\n\t<td class=legend>{enable_service}:</td>\n\t<td>" . Field_checkbox("enabledvps", 1, $ligne["enabled"]) . "</td>\n\t<td width=1%> </td>\n</tr>\n<tr>\n\t<td colspan=2 align='right'><hr>" . button($button_text, "SaveVPSServerSingle{$_GET["ID"]}()") . "</td>\n</tR>\n</table>\n\n\n<script>\nvar x_SaveVPSServerSingle{$_GET["ID"]}= function (obj) {\n\t\tvar results=trim(obj.responseText);\n\t\tif(results.length>0){alert(results);}\n\t\tvar ID={$_GET["ID"]};\n\t\tif(ID==0){YahooWinHide();}else{RefreshTab('main_config_vps{$_GET["ID"]}');}\n\t\tRefreshTab('main_config_vpssrv');\n\t}\t\t\n\n\n\tfunction SaveVPSServerSingle{$_GET["ID"]}(){\n\t\t\tCheckTemplate();\n\t\t\tvar XHR = new XHRConnection();\t\n\t\t\tvar ID={$_GET["ID"]};\n\t\t\tif(ID==0){\n\t\t\t\tvar tpl=document.getElementById('lxc_template').value;\n\t\t\t\tif(tpl.length==0){return;}\n\t\t\t\tXHR.appendData('template',tpl);\n\t\t\t}\n\t\t\tvar rootpwd=document.getElementById('rootpwd').value;\n\t\t\tXHR.appendData('form-vps-edit','yes');\n\t\t\tXHR.appendData('machine_name',document.getElementById('machine_name').value);\n\t\t\tif(document.getElementById('ipaddr')){\n\t\t\t\tXHR.appendData('ipaddr',document.getElementById('ipaddr').value);\n\t\t\t}\n\t\t\t\n\t\t\tif(document.getElementById('VirtualInterface')){\n\t\t\t\tXHR.appendData('VirtualInterface',document.getElementById('VirtualInterface').value);\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\tif(document.getElementById('ChangeMac').checked){XHR.appendData('ChangeMac',1);}else{XHR.appendData('ChangeMac',0);}\n\t\t\tif(document.getElementById('UsePhys').checked){XHR.appendData('UsePhys',1);}else{XHR.appendData('UsePhys',0);}\n\t\t\t\n\t\t\t\n\t\t\tvar mcaddr=document.getElementById('MAC1').value+':'+document.getElementById('MAC2').value+':'+document.getElementById('MAC3').value+':';\n\t\t\tmcaddr=mcaddr+document.getElementById('MAC4').value+':'+document.getElementById('MAC5').value+':'+document.getElementById('MAC6').value\n\t\t\t\n\t\t\tXHR.appendData('MacAddr',mcaddr);\n\t\t\tXHR.appendData('rootpwd',rootpwd);\n\t\t\tXHR.appendData('hostname',document.getElementById('hostname').value);\n\t\t\tXHR.appendData('PhysNic',document.getElementById('PhysNic').value);\n\t\t\tXHR.appendData('member',document.getElementById('lxc-member').value);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(document.getElementById('autostart').checked){XHR.appendData('autostart',1);}else{XHR.appendData('autostart',0);}\n\t\t\tif(document.getElementById('enabledvps').checked){XHR.appendData('enabled',1);}else{XHR.appendData('enabled',0);}\n\t\t\tXHR.appendData('ID','{$_GET["ID"]}');\n\t\t\tdocument.getElementById('lxc_host_{$_GET["ID"]}').innerHTML='<center style=\"width:100%\"><img src=img/wait_verybig.gif></center>'; \n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveVPSServerSingle{$_GET["ID"]});\t\t\n\t}\n\n\tfunction CheckTemplate(){\n\t\tvar ID={$_GET["ID"]};\n\t\tChangeMacCheck();\n\t\tif(ID>0){CheckTemplateRights();return;}\n\t\tdocument.getElementById('machine_name').disabled=true;\n\t\tif(document.getElementById('ipaddr')){document.getElementById('ipaddr').disabled=true;}\n\t\tif(document.getElementById('VirtualInterface')){document.getElementById('VirtualInterface').disabled=true;}\n\t\tdocument.getElementById('rootpwd').disabled=true;\n\t\tdocument.getElementById('hostname').disabled=true;\n\t\tdocument.getElementById('autostart').disabled=true;\n\t\tdocument.getElementById('enabledvps').disabled=true;\n\t\tvar tpl=document.getElementById('lxc_template').value;\n\t\tif(tpl.length==0){\n\t\t\tCheckTemplateRights();\n\t\t\treturn;\n\t\t}\n\t\tif(document.getElementById('ipaddr')){document.getElementById('ipaddr').disabled=false;}\n\t\tif(document.getElementById('VirtualInterface')){document.getElementById('VirtualInterface').disabled=false;}\n\t\tdocument.getElementById('rootpwd').disabled=false;\n\t\tdocument.getElementById('hostname').disabled=false;\n\t\tdocument.getElementById('autostart').disabled=false;\n\t\tdocument.getElementById('enabledvps').disabled=false;\n\t\tdocument.getElementById('machine_name').disabled=false;\n\t\tdocument.getElementById('lxc_template').disabled=false;\t\n\t\tCheckTemplateRights();\n\t\t\n\t\n\t}\n\t\n\tfunction CheckTemplateRights(){\n\t\tvar AsVirtualBoxManager={$AsVirtualBoxManager};\n\t\tif(document.getElementById('ipaddr')){document.getElementById('ipaddr').disabled=true;}\n\t\tdocument.getElementById('lxc-member').disabled=true;\n\t\tdocument.getElementById('UsePhys').disabled=true;\n\t\tdocument.getElementById('ChangeMac').disabled=true;\n\t\tif(AsVirtualBoxManager==0){return;}\n\t\tif(document.getElementById('ipaddr')){document.getElementById('ipaddr').disabled=false;}\n\t\tdocument.getElementById('lxc-member').disabled=false;\n\t\tdocument.getElementById('UsePhys').disabled=false;\n\t\tdocument.getElementById('ChangeMac').false;\n\t}\n\t\n\t\n\t\tfunction ChangeMacCheck(){\n\t\t\tif(!document.getElementById('UsePhys').checked){\n\t\t\t\tdocument.getElementById('PhysNic').disabled=true;\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('PhysNic').disabled=false;\n\t\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\tdocument.getElementById('MAC1').disabled=true;\n\t\t\tdocument.getElementById('MAC2').disabled=true;\n\t\t\tdocument.getElementById('MAC3').disabled=true;\n\t\t\tdocument.getElementById('MAC4').disabled=true;\n\t\t\tdocument.getElementById('MAC5').disabled=true;\n\t\t\tdocument.getElementById('MAC6').disabled=true;\n\t\t\tif(!document.getElementById('ChangeMac').checked){return;}\n\t\t\tdocument.getElementById('MAC1').disabled=false;\n\t\t\tdocument.getElementById('MAC2').disabled=false;\n\t\t\tdocument.getElementById('MAC3').disabled=false;\n\t\t\tdocument.getElementById('MAC4').disabled=false;\n\t\t\tdocument.getElementById('MAC5').disabled=false;\n\t\t\tdocument.getElementById('MAC6').disabled=false;\t\t\t\n\t\t\t\n\t\t\n\t\t}\t\n\t\n\tCheckTemplate();\n\n</script>\n\n"; echo $tpl->_ENGINE_parse_body($html); }
function TOOLS_SYNC() { $uid = $_GET["uid"]; $user = new usersMenus(); $content = Field_hidden('export_from_uid', $uid) . "\n\n<table style='width:100%'>\n<tr>\n\t<td class=legend nowrap>{sync_find_user}:</td>\n\t<td>" . Field_text('sync_find_user', null, null, null) . "</td>\n\t<td><input type='button' OnClick=\"javascript:ExpFindUser();\" value='{search} »'></td>\n\t</tr>\n</table>\n\n"; if (!$user->mailsync_installed) { $content = Paragraphe('add-remove-64.png', '{imapsync_not_installed}', '{imapsync_not_installed_text}', 'setup.index.php', null, 290); } $html = "\n\t<H1>{$uid} {export_mailbox}</H1>\n\t<p class=caption>{export_mailbox_text}</p>\n\t<center>\n\t{$content}\n\t</center>\n\t<div id='imapsync_logs'></div>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function settings() { $tpl = new templates(); $sock = new sockets(); $page = CurrentPageName(); $users = new usersMenus(); $influx = new influx(); $t = time(); $ERROR_PERF = null; $InfluxAdminDisabled = intval($sock->GET_INFO("InfluxAdminDisabled")); $InfluxAdminPort = intval($sock->GET_INFO("InfluxAdminPort")); if ($InfluxAdminPort == 0) { $InfluxAdminPort = 8083; } $InfluxAdminEnabled = 1; if ($InfluxAdminDisabled == 1) { $InfluxAdminEnabled = 0; } $InfluxAdminRetentionTime = intval($sock->GET_INFO("InfluxAdminRetentionTime")); $UserAgentsStatistics = intval($sock->GET_INFO("UserAgentsStatistics")); $ResolvIPStatistics = intval($sock->GET_INFO("ResolvIPStatistics")); $EnableQuotasStatistics = intval($sock->GET_INFO("EnableQuotasStatistics")); $QuotasStatisticsInterval = intval($sock->GET_INFO("QuotasStatisticsInterval")); $InfluxListenInterface = intval($sock->GET_INFO("InfluxListenInterface")); if ($InfluxListenInterface == null) { $InfluxListenInterface = "lo"; } $EnableInfluxDB = intval($sock->GET_INFO("EnableInfluxDB")); $SquidPerformance = intval($sock->GET_INFO("SquidPerformance")); $MySQLStatisticsRetentionDays = intval($sock->GET_INFO("MySQLStatisticsRetentionDays")); if ($MySQLStatisticsRetentionDays == 0) { $MySQLStatisticsRetentionDays = 5; } $bt_disconnect = null; $STATS_APPLIANCE = 0; $sys = new networking(); $influxstop = null; $Local_interfaces = $sys->Local_interfaces(); if (!$users->STATS_APPLIANCE) { $Local_interfaces["lo"] = "loopback"; } else { $STATS_APPLIANCE = 1; } $Local_interfaces["ALL"] = "{all}"; if ($InfluxAdminRetentionTime == 0) { $InfluxAdminRetentionTime = 365; } $users = new usersMenus(); $InfluxAdminRetention[7] = "7 {days}"; $InfluxAdminRetention[15] = "15 {days}"; $InfluxAdminRetention[30] = "1 {month}"; $InfluxAdminRetention[90] = "3 {months}"; $InfluxAdminRetention[180] = "6 {months}"; $InfluxAdminRetention[365] = "1 {year}"; $InfluxAdminRetention[730] = "2 {years}"; $InfluxAdminRetention[1095] = "3 {years}"; $MySQLStatisticsRetention[1] = "1 {day}"; $MySQLStatisticsRetention[2] = "2 {days}"; $MySQLStatisticsRetention[3] = "3 {days}"; $MySQLStatisticsRetention[4] = "4 {days}"; $MySQLStatisticsRetention[5] = "5 {days}"; $MySQLStatisticsRetention[6] = "6 {days}"; $MySQLStatisticsRetention[7] = "7 {days}"; $MySQLStatisticsRetention[8] = "8 {days}"; $MySQLStatisticsRetention[9] = "9 {days}"; $MySQLStatisticsRetention[10] = "10 {days}"; $QuotasStatisticsIntervalA[5] = "5 {minutes}"; $QuotasStatisticsIntervalA[10] = "10 {minutes}"; $QuotasStatisticsIntervalA[15] = "15 {minutes}"; $QuotasStatisticsIntervalA[30] = "30 {minutes}"; if ($QuotasStatisticsInterval == 0) { $QuotasStatisticsInterval = 15; } $CORP_LICENSE = 1; $explain_retention = " "; $field_ret = Field_array_Hash($InfluxAdminRetention, "InfluxAdminRetentionTime", "{$InfluxAdminRetentionTime}", "blur()", null, 0, "font-size:22px"); if (!$users->CORP_LICENSE) { $InfluxAdminRetentionTime = 7; $CORP_LICENSE = 0; $field_ret = Field_hidden("InfluxAdminRetentionTime", 5) . "5 {days}<div><i style='font-size:16px'>{retention_time_limited_license}</i></div>"; } if ($EnableInfluxDB == 0) { $influxstop = "<div class=explain style='font-size:18px'>{influxdb_is_disabled}</div>"; } $InFluxBackupDatabaseDir = $sock->GET_INFO("InFluxBackupDatabaseDir"); if ($InFluxBackupDatabaseDir == null) { $InFluxBackupDatabaseDir = "/home/artica/influx/backup"; } $InFluxBackupDatabaseMaxContainers = intval("InFluxBackupDatabaseMaxContainers"); if ($InFluxBackupDatabaseMaxContainers == 0) { $InFluxBackupDatabaseMaxContainers = 5; } $InFluxBackupDatabaseInterval = intval("InFluxBackupDatabaseInterval"); if ($InFluxBackupDatabaseInterval == 0) { $InFluxBackupDatabaseInterval = 10080; } if ($InFluxBackupDatabaseInterval < 1440) { $InFluxBackupDatabaseInterval = 1440; } $influxdb_snapshotsize = @file_get_contents("{$GLOBALS["BASEDIR"]}/influxdb_snapshotsize"); $InfluxDBAllowBrowse = intval($sock->GET_INFO("InfluxDBAllowBrowse")); $InfluxUseRemote = intval($sock->GET_INFO("InfluxUseRemote")); $InfluxUseRemoteIpaddr = $sock->GET_INFO("InfluxUseRemoteIpaddr"); $InfluxRemoteDB = $sock->GET_INFO("InfluxRemoteDB"); $InfluxUseRemotePort = intval($sock->GET_INFO("InfluxUseRemotePort")); $InfluxUseRemoteArticaPort = intval($sock->GET_INFO("InfluxUseRemoteArticaPort")); if ($InfluxRemoteDB == null) { $InfluxRemoteDB = $influx->db; } if ($InfluxUseRemotePort == 0) { $InfluxUseRemotePort = 8086; } if ($InfluxUseRemoteArticaPort == 0) { $InfluxUseRemoteArticaPort = 9000; } $InfluxDBPassword = $sock->GET_INFO("InfluxDBPassword"); $ArticaInfluxUsername = $sock->GET_INFO("ArticaInfluxUsername"); if ($ArticaInfluxUsername == null) { $ArticaInfluxUsername = "******"; } $InfluxSyslogRemote = intval($sock->GET_INFO("InfluxSyslogRemote")); $NoCompressStatisticsByHour = intval($sock->GET_INFO("NoCompressStatisticsByHour")); $ArticaInfluxPassword = $sock->GET_INFO("ArticaInfluxPassword"); if ($SquidPerformance > 2) { $ERROR_PERF = "<p class=text-error style='font-size:16px'>{INFLUX_DISABLED_PROXY_PERFORMANCE}</p>\n\t\t<div style='margin-top:10px;text-align:right'>" . button("{performance}", "GotoSquidPerformances()", 16) . "</div>"; } if ($InfluxUseRemote == 1) { if ($InfluxUseRemoteIpaddr != null) { $bt_disconnect = "\n\t\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px;text-align:right' colspan=2><p> </p></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px;text-align:right' colspan=2>" . button("{disconnect}", "Loadjs('influxdb.disconnect.progress.php');", 22) . "</td>\n\t\t\t</tr>"; } } $Intervals[1440] = "1 {day}"; $Intervals[2880] = "1 {days}"; $Intervals[7200] = "5 {days}"; $Intervals[10080] = "1 {week}"; $Intervals[20160] = "2 {weeks}"; $password = "******" . Field_password("InfluxDBPassword", $InfluxDBPassword, "font-size:22px;width:310px") . "</td>\n\t\t<td style='font-size:22px;text-decoration:underline'>{username}: «root»</td>\n\t</tr>"; $date_start = $tpl->time_to_date(intval(@file_get_contents("{$GLOBALS["BASEDIR"]}/DATE_START")), true); $date_end = $tpl->time_to_date(intval(@file_get_contents("{$GLOBALS["BASEDIR"]}/DATE_END")), true); $html = "\n\t{$ERROR_PERF}\t\t\n\t<div style='width:98%;margin-top:20px' class=form>\n\t{$influxstop}\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{date_start}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>{$date_start}</td>\n\t\t\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{last_date}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>{$date_end}</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'>" . button("{refresh}", "Loadjs('influxdb.refresh.progress.php')") . "</td>\n\t</tr>\n\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{no_hourly_compression}", "{no_hourly_compression_explain}") . ":</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("NoCompressStatisticsByHour", 1, $NoCompressStatisticsByHour, "") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{ResolvIPStatistics}", "{ResolvIPStatistics_explain}") . ":</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("ResolvIPStatistics", 1, $ResolvIPStatistics, "") . "</td>\n\t</tr>\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{MySQLStatisticsRetentionDays}", "{MySQLStatisticsRetentionDays_explain}") . ":</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_array_Hash($MySQLStatisticsRetention, "MySQLStatisticsRetentionDays", "{$MySQLStatisticsRetentionDays}", "blur()", null, 0, "font-size:22px") . "</td>\n\t</tr>\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{useragents_statistics}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("UserAgentsStatistics", 1, $UserAgentsStatistics, "") . "</td>\n\t\t\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{quota_statistics}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("EnableQuotasStatistics", 1, $EnableQuotasStatistics, "EnableQuotasStatisticsCheck()") . "</td>\n\t\t\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{interval}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_array_Hash($QuotasStatisticsIntervalA, "QuotasStatisticsInterval", "{$QuotasStatisticsInterval}", "blur()", null, 0, "font-size:22px") . "</td>\n\t</tr>\t\n\t</table>\n\t<div id='influx-local-service-id'>\n\t<table style='width:100%'>\n\t<tr style='height:80px;'>\n\t\t<td colspan=3 style='font-size:30px'>{service_parameters}:</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{query_interface}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold'>" . Field_checkbox_design("InfluxAdminEnabled", 1, $InfluxAdminEnabled, "InfluxAdminEnabledCheck()") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{listen_interface}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_array_Hash($Local_interfaces, "InfluxListenInterface", "{$InfluxListenInterface}", "blur()", null, 0, "font-size:22px") . "</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$InfluxListenInterface}:8086</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{listen_port}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InfluxAdminPort", $InfluxAdminPort, "font-size:22px;width:120px") . "</td>\n\t\t<td style='font-size:22px;text-decoration:underline'><a href=\"http://{$_SERVER["SERVER_ADDR"]}:{$InfluxAdminPort}\" target=_new>{browse}</a></td>\n\t</tr>\t\n\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{retention_time}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>{$field_ret}{$explain_retention}</td>\n\t</tr>\n\t<tr style='height:80px;'>\n\t\t<td colspan=3 align='right' style='padding-top:30px'><hr>" . button("{apply}", "Save{$t}()", 40) . "</td>\n\t</tr>\t\n\t</table>\n\t</div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t<div id='influx-remote-service-id'>\n\t\t<table style='width:100%'>\n\t\t<tr style='height:80px;'>\n\t\t\t<td colspan=3 style='font-size:30px'>{remote_server}:</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px' nowrap>{use_remote_server}:</td>\t\t\n\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_checkbox_design("InfluxUseRemote", 1, $InfluxUseRemote, "InfluxUseRemoteCheck()") . "</td>\n\t\t</tr>\t\n\t\t</table>\n\t\t<div id='influx-remote-service-options'>\n\t\t\t<table style='width:100%'>\n{$bt_disconnect}\t\t\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{send_syslog_logs}", "{send_syslog_explain}") . ":</td>\t\t\n\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_checkbox_design("InfluxSyslogRemote", 1, $InfluxSyslogRemote) . "</td>\n\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:22px' nowrap>{remote_server_address}:</td>\t\t\n\t\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InfluxUseRemoteIpaddr", $InfluxUseRemoteIpaddr, "font-size:22px;width:291px") . "</td>\n\t\t\t\t\n\t\t\t</tr>\n\t\t\t\t\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:22px'>{remote_port}:</td>\t\t\n\t\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InfluxUseRemotePort", $InfluxUseRemotePort, "font-size:22px;width:120px") . "</td>\n\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:22px'>{artica_username}:</td>\n\t\t\t\t\t<td style='font-size:18px'>" . Field_text("ArticaInfluxUsername", $ArticaInfluxUsername, "font-size:22px;width:240px") . "</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'>{artica_password}:</td>\n\t\t\t\t\t<td style='font-size:18px'>" . Field_password("ArticaInfluxPassword", $ArticaInfluxPassword, "font-size:22px;width:240px") . "</td>\n\t\t\t\t</tr>\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:22px'>{remote_artica_port}:</td>\t\t\n\t\t\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InfluxUseRemoteArticaPort", $InfluxUseRemoteArticaPort, "font-size:22px;width:120px") . "</td>\n\t\t\t</tr>\t\t\t\t\n\t\t\t<tr style='height:80px;'>\n\t\t\t\t<td colspan=2 align='right' style='padding-top:30px'>\n\t\t\t\t\t\t\t<hr>" . button("{apply}", "SaveRemote{$t}()", 40) . "</td>\n\t\t\t</tr>\n\t\t\t\t\t\t\n\t\t\t</table>\n\t\t</div>\n\t</div>\t\t\t\n\t\t\t\t\n\t<div id='influx-backup-service-id'>\n\t<table style='width:100%'>\n\t<tr style='height:80px;'>\n\t\t<td colspan=3 style='font-size:26px'>{backup}:</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{backup_each}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_array_Hash($Intervals, "InFluxBackupDatabaseInterval", "{$InFluxBackupDatabaseInterval}", "blur()", null, 0, "font-size:22px") . "</td>\n\t\t\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>{backup_directory}:</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold'>" . Field_text("InFluxBackupDatabaseDir", $InFluxBackupDatabaseDir, "font-size:22px;width:291px") . "</td>\n\t\t<td>" . button_browse("InFluxBackupDatabaseDir") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap colspan=2 align='right'>\n\t\t\t\t<a href=\"/backup-influx/\" style='text-decoration:underline'>{backup_directory} " . FormatBytes($influxdb_snapshotsize / 1024) . "</a>\n\t\t</td>\n\t\t<td> </td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px' nowrap>" . texttooltip("{allow_browse_directory}", "{allow_browse_directory_web_explain}") . ":</td>\t\t\n\t\t<td style='font-size:22px;font-weight:bold' colspan=2>" . Field_checkbox_design("InfluxDBAllowBrowse", 1, $InfluxDBAllowBrowse, "") . "</td>\n\t\t\t\t\n\t</tr>\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t<tr>\n\t\t<td colspan=3 align='right' style='font-size:18px'>\n\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:GotoSquidNasStorage()\" \n\t\t\t\tstyle='text-decoration:underline;font-size:18px'>{also_see_backup_to_nas}</a>\n\t\t</td>\n\t</tr>\n\t<tr style='height:80px;'>\n\t\t<td colspan=3 align='right' style='padding-top:30px'><hr>" . button("{apply}", "Save{$t}()", 40) . "</td>\n\t</tr>\t\t\t\n\t</table>\n\t</div>\n\t</div>\n<script>\nvar xSave{$t}= function (obj) {\t\n\tvar res=obj.responseText;\n\tif(res.length>3){alert(res);return;}\n\tLoadjs('influxdb.restart.progress.php');\n}\t\nvar xSaveRemote{$t}= function (obj) {\t\n\tvar res=obj.responseText;\n\tif(res.length>3){alert(res);return;}\n\tLoadjs('influxdb.remote.progress.php');\n}\n\nfunction SaveRemote{$t}(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('InfluxUseRemote').checked){XHR.appendData('InfluxUseRemote', 1);}else{XHR.appendData('InfluxUseRemote', 0);}\n\tif(document.getElementById('InfluxSyslogRemote').checked){XHR.appendData('InfluxSyslogRemote', 1);}else{XHR.appendData('InfluxSyslogRemote', 0);}\n\tXHR.appendData('InfluxUseRemoteIpaddr', document.getElementById('InfluxUseRemoteIpaddr').value);\n\tXHR.appendData('InfluxUseRemotePort', document.getElementById('InfluxUseRemotePort').value);\n\tXHR.appendData('InfluxUseRemoteArticaPort', document.getElementById('InfluxUseRemoteArticaPort').value);\n\tXHR.appendData('ArticaInfluxPassword', encodeURIComponent(document.getElementById('ArticaInfluxPassword').value));\n\tXHR.appendData('ArticaInfluxUsername', document.getElementById('ArticaInfluxUsername').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSaveRemote{$t}); \n\n}\n\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\t\n\tif(document.getElementById('NoCompressStatisticsByHour').checked){XHR.appendData('NoCompressStatisticsByHour', 1);\t}else{XHR.appendData('NoCompressStatisticsByHour', 0);}\n\tif(document.getElementById('ResolvIPStatistics').checked){XHR.appendData('ResolvIPStatistics', 1);\t}else{XHR.appendData('ResolvIPStatistics', 0);}\n\tif(document.getElementById('InfluxAdminEnabled').checked){XHR.appendData('InfluxAdminEnabled', 1);\t}else{XHR.appendData('InfluxAdminEnabled', 0);}\n\tif(document.getElementById('EnableQuotasStatistics').checked){XHR.appendData('EnableQuotasStatistics', 1);\t}else{XHR.appendData('EnableQuotasStatistics', 0);}\n\tif(document.getElementById('UserAgentsStatistics').checked){XHR.appendData('UserAgentsStatistics', 1);\t}else{XHR.appendData('UserAgentsStatistics', 0);}\n\tif(document.getElementById('InfluxDBAllowBrowse').checked){XHR.appendData('InfluxDBAllowBrowse', 1);\t}else{XHR.appendData('InfluxDBAllowBrowse', 0);}\n \t//XHR.appendData('InfluxDBPassword', encodeURIComponent(document.getElementById('InfluxDBPassword').value));\n\t\n\t\n\tXHR.appendData('MySQLStatisticsRetentionDays', document.getElementById('MySQLStatisticsRetentionDays').value);\n\tXHR.appendData('InfluxAdminPort', document.getElementById('InfluxAdminPort').value);\n\tXHR.appendData('InfluxAdminRetentionTime', document.getElementById('InfluxAdminRetentionTime').value);\t\t\n\tXHR.appendData('QuotasStatisticsInterval', document.getElementById('QuotasStatisticsInterval').value);\n\tXHR.appendData('InfluxListenInterface', document.getElementById('InfluxListenInterface').value);\n\tXHR.appendData('InFluxBackupDatabaseInterval', document.getElementById('InFluxBackupDatabaseInterval').value);\n\tXHR.appendData('InFluxBackupDatabaseDir', document.getElementById('InFluxBackupDatabaseDir').value);\n\t\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t}); \t\t\t\n}\n\nfunction EnableQuotasStatisticsCheck(){\n\tdocument.getElementById('QuotasStatisticsInterval').disabled=true;\n\tif(document.getElementById('EnableQuotasStatistics').checked){\n\t\tdocument.getElementById('QuotasStatisticsInterval').disabled=false;\n\t}\n}\n\nfunction InfluxUseRemoteCheck(){\n\tif(document.getElementById('InfluxUseRemote').checked){\n\t\tdocument.getElementById('influx-local-service-id').style.display='none';\n\t\tdocument.getElementById('influx-backup-service-id').style.display='none';\n\t\tdocument.getElementById('influx-remote-service-options').style.display='';\n\t\t\n\t}else{\n\t\tdocument.getElementById('influx-local-service-id').style.display='';\n\t\tdocument.getElementById('influx-backup-service-id').style.display='';\n\t\tdocument.getElementById('influx-remote-service-options').style.display='none';\n\t\n\t}\n\t\n\tvar STATS_APPLIANCE={$STATS_APPLIANCE};\n\tif(STATS_APPLIANCE==1){\n\t\tdocument.getElementById('influx-remote-service-id').style.display='none';\n\t}\n}\n\n\nfunction checkt{$t}(){\n\tvar CORP_LICENSE={$CORP_LICENSE};\n\tdocument.getElementById('InfluxAdminRetentionTime').disabled=true;\n\tif(CORP_LICENSE==1){document.getElementById('InfluxAdminRetentionTime').disabled=false;}\n}\n\nEnableQuotasStatisticsCheck();\ncheckt{$t}();\nInfluxUseRemoteCheck();\nLoadAjaxRound('influx-db-status','{$page}?service-status=yes');\t\t\t\t\n</script>\n\t\t\t\t\n\t\t\t\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function add_new_disk_popup() { $t = time(); $page = CurrentPageName(); $squid = new squidbee(); $tpl = new templates(); $sock = new sockets(); $caches_types = unserialize(base64_decode($sock->getFrameWork("squid.php?caches-types=yes"))); $caches_types[null] = '{select}'; unset($caches_types["rock"]); $type = $tpl->_ENGINE_parse_body(Field_array_Hash($caches_types, "cache_type-{$t}", "aufs", "CheckCachesTypes()", null, 0, "font-size:16px;padding:3px")); $WARN_OPE_RESTART_SQUID_ASK = $tpl->javascript_parse_text("{WARN_OPE_RESTART_SQUID_ASK}"); $currentsize = Calculate_maxcachessize(); $maxCacheSizeInt = 0; $maxCacheSize = 0; $BUTTON_NAME = "{add}"; $DefaultmaxCacheSize = round($maxCacheSize / 4, 1); $NextCache = count($squid->cache_list) + 1; $defaultCachedir = "/home/squid/cache/squid0{$NextCache}"; $cachedirtext = "\n\t\t<tr>\n\t\t<td class=legend style='font-size:16px' nowrap>{directory}:</td>\n\t\t<td>" . Field_text("cache_directory-{$t}", $defaultCachedir, "width:270px;font-size:16px;padding:3px", null, "Slider{$t}()") . "</td>\n\t\t<td>" . button("{browse}...", "Loadjs('SambaBrowse.php?no-shares=yes&field=cache_directory-{$t}&functionAfter=Slider{$t}')", 12) . "</td>\n\t\t</tr>"; $SliderDef = 1; $cache_dir_level1_def = 16; $LockOthers = 0; if (isset($_GET["chdef"])) { $DF = unserialize(base64_decode($sock->getFrameWork("system.php?DF_SATUS_K=" . urlencode($squid->CACHE_PATH)))); $BUTTON_NAME = "{apply}"; $SIZE = round($DF["SIZE"] / 1024 / 1024); $maxCacheSize = round($SIZE * 0.9); $cachedirtext = "<tr>\n\t\t<td class=legend style='font-size:16px' nowrap>{directory}:</td>\n\t\t<td><strong style='font-size:14px'>{$squid->CACHE_PATH}</strong>" . Field_hidden("cache_directory-{$t}", $squid->CACHE_PATH) . "</td>\n\t\t<td> </td>\n\t\t</tr>"; if ($squid->CACHE_TYPE == null) { $squid->CACHE_TYPE = "aufs"; } $type = $tpl->_ENGINE_parse_body(Field_array_Hash($caches_types, "cache_type-{$t}", $squid->CACHE_TYPE, "CheckCachesTypes()", null, 0, "font-size:16px;padding:3px")); $SliderDef = round($squid->CACHE_SIZE / 1000); $DefaultmaxCacheSize = $squid->CACHE_SIZE / 1000; $XHRADD = "XHR.appendData('DEFAULT_CACHE_SAVE_TRUE','OK');"; $LockOthers = 1; } $html = "\t<div id='waitcache-{$t}'></div>\n\t\n\t<div style='width:98%' class=form>\n\t<table style='width:99%'>\n\t\t{$cachedirtext}\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px' nowrap>{type}:</td>\n\t\t\t<td>{$type}</td>\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px;;vertical-align:middle' nowrap>{cache_size}:</td>\n\t\t\t<td style='font-size:16px;vertical-align:middle' width=1% >" . Field_text("squid-cache-size-{$t}", $SliderDef, "font-size:16px;width:90px", null, "Slider{$t}()", null, false, "Slider{$t}()") . "<strong style='font-size:16px'> G </td>\n\t\t\t<td style='width:1%'><div style='font-size:22px;font-weight:bold;text-align:right;letter-spacing:3px;width:220px' id='{$t}-value'>{max_size}:{$maxCacheSize}G</div></td>\n\t\t\t<td>" . help_icon('{cache_size_text}', false, 'squid.index.php') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=4>\n\t\t\t\t\t\n\t\t\t\t\t<input type='hidden' id='{$t}-mem' value='{$SquidBoosterMem}'>\n\t\t\t\t\t<div class=explain style='font-size:13px'>{warn_calculate_nothdsize}</div></td>\t\t\n\n\t\t<tr>\n\t\t\t<td class=legend nowrap style='font-size:16px'>{cache_dir_level1}:</td>\n\t\t\t<td>" . Field_text("cache_dir_level1-{$t}", 16, 'width:50px;font-size:16px;padding:3px') . "</td>\n\t\t\t<td> </td>\n\t\t\t<td>" . help_icon('{cache_dir_level1_text}', false, 'squid.index.php') . "</td>\n\t\t</tr>\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend nowrap style='font-size:16px'>{cache_dir_level2}:</td>\n\t\t\t<td>" . Field_text("cache_dir_level2-{$t}", 256, 'width:50px;font-size:16px;padding:3px') . "</td>\n\t\t\t<td> </td>\n\t\t\t<td>" . help_icon('{cache_dir_level2_text}', false, 'squid.index.php') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap style='font-size:16px'>{max_objects_size}:</td>\n\t\t\t<td style='font-size:16px'>" . Field_text("cache_maxsize-{$t}", $s->cache_list[$cache]["cache_maxsize"], 'width:50px;font-size:16px;padding:3px', null, "calculateSize()", null, false, null) . " Mbytes <span id='squid-maxsize-vals'></span></td>\n\t\t\t<td> </td>\n\t\t\t<td>" . help_icon('{squid_rock_maxsize}', false, 'squid.index.php') . "</td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t<td align='right' colspan=4><hr>" . button($BUTTON_NAME, "AddNewCacheSave{$t}()", 18) . "</td>\n\t\t</tr>\n\t</table>\n\t</div>\n<script>\n\n\t\t\n\t\t\n\n\t\tfunction CheckCachesTypes(){\n\t\t\tcachetypes=document.getElementById('cache_type-{$t}').value;\n\t\t\tvar LockOthers={$LockOthers};\n\t\t\tif(LockOthers==1){\n\t\t\t\tdocument.getElementById('cache_dir_level2-{$t}').disabled=true;\n\t\t\t\tdocument.getElementById('cache_dir_level1-{$t}').disabled=true;\n\t\t\t\tdocument.getElementById('cache_maxsize-{$t}').disabled=true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\tvar x_AddNewCacheSave{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){\n\t\t\t\talert(results);\n\t\t\t\tdocument.getElementById('waitcache').innerHTML='';\n\t\t\t\t}\n\t\t\tYahooWin3Hide();\n\t\t\tSaveSquid32CachesStatus();\n\t\t\tExecuteByClassName('SearchFunction');\n\t\t}\t\t\n\t\n\tfunction AddNewCacheSave{$t}(){\n\t\tif(confirm('{$WARN_OPE_RESTART_SQUID_ASK}')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\t{$XHRADD}\n\t\t\tXHR.appendData('cache_directory',document.getElementById('cache_directory-{$t}').value);\n\t\t\tXHR.appendData('cache_type',document.getElementById('cache_type-{$t}').value);\n\t\t\tXHR.appendData('size',document.getElementById('squid-cache-size-{$t}').value);\n\t\t\tXHR.appendData('cache_dir_level1',document.getElementById('cache_dir_level1-{$t}').value);\n\t\t\tXHR.appendData('cache_dir_level2',document.getElementById('cache_dir_level2-{$t}').value);\n\t\t\tXHR.appendData('cache_maxsize',document.getElementById('cache_maxsize-{$t}').value);\n\t\t\tAnimateDiv('waitcache-{$t}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_AddNewCacheSave{$t});\n\t\t\t}\n\t\t}\t\t\n\t\t\n\tfunction Slider{$t}(){\n\t\tLoadjs('{$page}?slider-t=yes&t={$t}');\n\t\n\t}\n\t\t\n\t\tCheckCachesTypes();\n\t\tSlider{$t}();\n</script>"; echo $tpl->_ENGINE_parse_body($html); }
function change_field() { $type = $_GET["type"]; $t = $_GET["t"]; $tpl = new templates(); $q = new mysql(); $sql = "SELECT uid FROM postfix_transport_mailbox WHERE `ID`='{$_POST["key"]}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if ($type == 0) { echo Field_text("uid-{$t}", $ligne["uid"], "font-size:16px;width:180px"); return; } $ldap = new clladp(); $users = new usersMenus(); if ($users->AsSystemAdministrator) { $ous = $ldap->hash_get_ou(true); $ous[null] = "{select}"; echo $tpl->_ENGINE_parse_body(Field_array_Hash($ous, "uid-{$t}", $ligne["uid"], "blur()", null, 0, "font-size:16px")); return; } echo Field_hidden("uid-{$t}", $_SESSION["ou"]) . "<span style='font-size:16px'>{$_SESSION["ou"]}</span>"; }
function main_artica_update_config() { $page = CurrentPageName(); $users = new usersMenus(); $tpl = new templates(); $sock = new sockets(); $ini = new Bs_IniHandler(); $configDisk = trim($sock->GET_INFO('ArticaAutoUpdateConfig')); $cannot_schedule_update_without_schedule = $tpl->javascript_parse_text("{cannot_schedule_update_without_schedule}"); $ini->loadString($configDisk); $AUTOUPDATE = $ini->_params["AUTOUPDATE"]; $EnableNightlyInFrontEnd = $sock->GET_INFO("EnableNightlyInFrontEnd"); $EnableRebootAfterUpgrade = $sock->GET_INFO("EnableRebootAfterUpgrade"); $EnableScheduleUpdates = $sock->GET_INFO("EnableScheduleUpdates"); $EnablePatchUpdates = $sock->GET_INFO("EnablePatchUpdates"); $ArticaScheduleUpdates = $sock->GET_INFO("ArticaScheduleUpdates"); $DisableInstantLDAPBackup = $sock->GET_INFO("DisableInstantLDAPBackup"); $EnableSystemUpdates = $sock->GET_INFO("EnableSystemUpdates"); $EnableArticaMetaClient = intval($sock->GET_INFO("EnableArticaMetaClient")); $ArticaUpdateIntervalAllways = intval($sock->GET_INFO("ArticaUpdateIntervalAllways")); if (!is_numeric($DisableInstantLDAPBackup)) { $DisableInstantLDAPBackup = 0; } if (!is_numeric($EnableNightlyInFrontEnd)) { $EnableNightlyInFrontEnd = 1; } if (!is_numeric($EnableScheduleUpdates)) { $EnableScheduleUpdates = 0; } if (!is_numeric($EnableRebootAfterUpgrade)) { $EnableRebootAfterUpgrade = 0; } if (!is_numeric($EnablePatchUpdates)) { $EnablePatchUpdates = 0; } if (!is_numeric($EnableSystemUpdates)) { $EnableSystemUpdates = 0; } //CURLOPT_MAX_RECV_SPEED_LARGE writelogs("EnableScheduleUpdates = {$EnableScheduleUpdates}", __FUNCTION__, __FILE__, __LINE__); if (trim($AUTOUPDATE["uri"]) == null) { $AUTOUPDATE["uri"] = "http://articatech.net/auto.update.php"; } if (trim($AUTOUPDATE["enabled"]) == null) { $AUTOUPDATE["enabled"] = "yes"; } if (trim($AUTOUPDATE["autoinstall"]) == null) { $AUTOUPDATE["autoinstall"] = "yes"; } if (trim($AUTOUPDATE["CheckEveryMinutes"]) == null) { $AUTOUPDATE["CheckEveryMinutes"] = "60"; } if (trim($AUTOUPDATE["front_page_notify"]) == null) { $AUTOUPDATE["front_page_notify"] = "yes"; } if (trim($AUTOUPDATE["samba_notify"]) == null) { $AUTOUPDATE["samba_notify"] = "no"; } if (trim($AUTOUPDATE["auto_apt"]) == null) { $AUTOUPDATE["auto_apt"] = "no"; } $action_http_proxy = "\t<td valign='top' width=33%>\n\t" . Paragraphe("proxy-64.png", "{http_proxy}", "{http_proxy_text}", "javascript:Loadjs('artica.settings.php?js=yes&func-ProxyInterface=yes');", 300, null, $nowrap = 1) . "\n\t</td>"; $action_update_now = "\t<td valign='top' width=33%>\n\t" . Paragraphe('64-recycle.png', '{update_now}', '{perform_update_text}', "javascript:Loadjs('artica.update.progress.php',true)", "{perform_update_text}", 300, null, $nowrap = 1) . "\n\t</td>"; $action_refresh_index = "<td colspan=2 align='right'>" . button("{refresh_index_file}", "Loadjs('setup.index.php?TestConnection-js=yes')") . "</td>"; if ($EnableArticaMetaClient == 1) { $action_http_proxy = null; $action_update_now = null; $action_refresh_index = null; } $CURVER = @file_get_contents("VERSION"); if (preg_match("#^2\\.#", $CURVER)) { $UpgradeTov10 = intval($sock->GET_INFO("UpgradeTov10")); if ($UpgradeTov10 == 0) { $html = FATAL_INFO_SHOW_128("{need_to_upgrade_to_v10}") . "<center style='margin:50px'>" . button("{perform_upgrade}", "Loadjs('squid.upgradev10.progress.php')", 42) . "</center>"; echo $tpl->_ENGINE_parse_body($html); return; } } $CUR_BRANCH = @file_get_contents("/usr/share/artica-postfix/MAIN_RELEASE"); $html = "\n\t<input type='hidden' id='perform_update_text' value='{perform_update_text}'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>\n\t<td valign='top' width=33%>\n\t" . Paragraphe("64-download.png", "{manual_update}", "{artica_manual_update_text}", "javascript:Loadjs('artica.update-manu.php');", 300, null, $nowrap = 1) . "\n\t</td>\t\n\t</td>\n\t{$action_http_proxy}\n\t{$action_update_now}\n\t</tr>\t\t\t\t\t\n\t</table>\n\t"; if ($AUTOUPDATE["nightlybuild"] == "yes") { $AUTOUPDATE["nightlybuild"] = 1; } else { $AUTOUPDATE["nightlybuild"] = 0; } if ($AUTOUPDATE["front_page_notify"] == "yes") { $AUTOUPDATE["front_page_notify"] = 1; } else { $AUTOUPDATE["front_page_notify"] = 0; } if ($AUTOUPDATE["autoinstall"] == "yes") { $AUTOUPDATE["autoinstall"] = 1; } else { $AUTOUPDATE["autoinstall"] = 0; } if ($AUTOUPDATE["enabled"] == "yes") { $AUTOUPDATE["enabled"] = 1; } else { $AUTOUPDATE["enabled"] = 0; } if ($AUTOUPDATE["samba_notify"] == "yes") { $AUTOUPDATE["samba_notify"] = 1; } else { $AUTOUPDATE["samba_notify"] = 0; } $form = Field_hidden("EnablePatchUpdates", $EnablePatchUpdates) . Field_hidden("EnableSystemUpdates", $EnableSystemUpdates) . "\n\t\t\t\n\t<div id='ArticaUpdateForm' class='form' style='width:95%'>\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td style='width:30%' valign=middle><div id='status-versions'></div></td>\n\t\t<td style='width:70%'>\n\t<div class=explain style='font-size:16px'>\n\t\t<div style='margin-bottom:5px;text-align:right;padding-bottom:1px;border-bottom:1px solid #999999;width:97%'>\n\t\t\t<strong style='font-size:22px'>{current} Artica v.{$CURVER} Branch v.{$CUR_BRANCH}</strong>\n\t\t</div>{autoupdate_text}\n\t</div>\n\t</td>\n\t</tr>\n\t</tr>\n\t\t{$action_refresh_index}\n\t</tr>\n\t</table>\n\t<script>LoadAjax('status-versions','{$page}?status-versions=yes');</script>\n\t\n\t<form name='ffm1' >\n\t<table style='width:99%' >\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend class=legend style='font-size:16px'>{enable_autoupdate}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('enabled', 1, $AUTOUPDATE["enabled"]) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{enable_autoinstall}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('autoinstall', 1, $AUTOUPDATE["autoinstall"]) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{enable_nightlybuild}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('nightlybuild', 1, $AUTOUPDATE["nightlybuild"]) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{free_update_during_the_day}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('ArticaUpdateIntervalAllways', 1, $ArticaUpdateIntervalAllways) . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{EnableNightlyInFrontEnd}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('EnableNightlyInFrontEnd', 1, $EnableNightlyInFrontEnd) . "</td>\n\t</tr>\n\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{front_page_notify}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('front_page_notify', 1, $AUTOUPDATE["front_page_notify"]) . "</td>\n\t</tr>"; if ($users->SAMBA_INSTALLED) { $form = $form . "<td width=1% nowrap align='right' class=legend style='font-size:16px'>{samba_notify}:</strong></td>\n\t<td align='left'>" . Field_checkbox_design('samba_notify', 1, $AUTOUPDATE["samba_notify"]) . "</td>\n\t</tr>"; } $form = $form . "\n\t<tr><td colspan=2> </td></tr>\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{DisableInstantLDAPBackup}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('DisableInstantLDAPBackup', 1, $DisableInstantLDAPBackup) . "</td>\n\t</tr>\t\n\t\n\t"; $ip = new networking(); while (list($eth, $cip) = each($ip->array_TCP)) { if ($cip == null) { continue; } $arrcp[$cip] = $cip; } $arrcp[null] = "{default}"; $WgetBindIpAddress = $sock->GET_INFO("WgetBindIpAddress"); $CurlBandwith = $sock->GET_INFO("CurlBandwith"); $CurlTimeOut = $sock->GET_INFO("CurlTimeOut"); if (!is_numeric($CurlBandwith)) { $CurlBandwith = 0; } if (!is_numeric($CurlTimeOut)) { $CurlTimeOut = 3600; } if ($CurlTimeOut < 720) { $CurlTimeOut = 3600; } $NoCheckSquid = $sock->GET_INFO("NoCheckSquid"); if (!is_numeric($NoCheckSquid)) { $NoCheckSquid = 0; } $WgetBindIpAddress = Field_array_Hash($arrcp, "WgetBindIpAddress", $WgetBindIpAddress, null, null, 0, "font-size:16px;padding:3px;"); $RebootAfterArticaUpgrade = $sock->GET_INFO("RebootAfterArticaUpgrade"); if (!is_numeric($RebootAfterArticaUpgrade)) { $RebootAfterArticaUpgrade = 0; } $form = $form . "\n\t<tr>\n\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{WgetBindIpAddress}:</strong></td>\n\t<td align='left'>{$WgetBindIpAddress}</td>\n\t</tr>\t\t\t\n\t<tr>\n\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{CheckEveryMinutes}:</strong></td>\n\t<td align='left'>" . Field_text('CheckEveryMinutes', $AUTOUPDATE["CheckEveryMinutes"], 'font-size:16px;padding:3px;width:90px') . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{NoCheckSquid}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('NoCheckSquid', 1, $NoCheckSquid) . " </td>\n\t</tr>\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{HTTP_TIMEOUT}:</strong></td>\n\t\t<td align='left' style='font-size:16px'>" . Field_text('CurlTimeOut', $CurlTimeOut, 'font-size:16px;padding:3px;width:90px') . " {seconds}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{limit_bandwidth}:</strong></td>\n\t\t<td align='left' style='font-size:16px'>" . Field_text('CurlBandwith', $CurlBandwith, 'font-size:16px;padding:3px;width:90px') . " kb/s</td>\n\t</tr>\t\t\t\t\t\t\t\t\t\t\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{EnableScheduleUpdates}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('EnableScheduleUpdates', 1, $EnableScheduleUpdates, "CheckSchedules()") . " \n\t\t<a href=\"javascript:blur()\" OnClick=\"javascript:Loadjs('cron.php?field=ArticaScheduleUpdates&function2=SaveArticaUpdateForm')\" style='font-size:16px;text-decoration:underline;color:black' id='scheduleAID'>{schedule}</a>\n\t</td>\n\t<tr>\n\t\t<td width=1% nowrap align='right' class=legend style='font-size:16px'>{RebootAfterArticaUpgrade}:</strong></td>\n\t\t<td align='left'>" . Field_checkbox_design('RebootAfterArticaUpgrade', 1, $RebootAfterArticaUpgrade, "RebootAfterArticaUpgradeCheck()") . " \n\t</tr>\t\n\t\n\t\n\t\n\t</tr>\t\n\n\t<tr>\n\t<td width=1% align='right' class=legend style='font-size:16px;vertical-align:top' nowrap>{uri}:</strong></td>\n\t<td align='left'>\n\t\t\t" . Field_text('uri', $AUTOUPDATE["uri"], 'font-size:16px;padding:3px;width:390px') . "\n\t\t\t\n\t</td>\n\t</tr>\t\n\t<tr>\n\t<td colspan=2 align='right'>\n\t<hr>\n\t" . button("{apply}", "SaveArticaUpdateForm()", 28) . "\n\t</tr>\t\t\t\n\t</table>\n\t</form>\n\t</div>\n\t<input type='hidden' id='ArticaScheduleUpdates' value='{$ArticaScheduleUpdates}'>\n\t<script>\n\t\tfunction CheckSchedules(){\n\t\t\tdocument.getElementById('CheckEveryMinutes').disabled=true;\n\t\t\tif(!document.getElementById('EnableScheduleUpdates').checked){\n\t\t\t\tdocument.getElementById('CheckEveryMinutes').disabled=false;\n\t\t\t\tdocument.getElementById('scheduleAID').style.color='#CCCCCC';\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('scheduleAID').style.color='black';\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t\n\n\t\n\t\n\tCheckSchedules();\n\t\n\t\nvar x_SaveArticaUpdateForm= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tRefreshTab('main_config_artica_update');\n\t\t\t}\n\n\t\t\t\n\tfunction RebootAfterArticaUpgradeCheck(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('RebootAfterArticaUpgrade').checked){XHR.appendData('RebootAfterArticaUpgrade','1');}else{XHR.appendData('RebootAfterArticaUpgrade','0');}\n\t\tXHR.sendAndLoad('{$page}', 'POST');\n\t}\n\t\n\t\n\tfunction SaveArticaUpdateForm(){\n\t\tvar XHR = new XHRConnection();\n\t\t\n\t\tif(document.getElementById('enabled')){\n\t\t\tif(document.getElementById('enabled').checked){XHR.appendData('enabled','yes');}else{XHR.appendData('enabled','no');}\n\t\t}\n\t\t\n\t\tif(document.getElementById('autoinstall')){\n\t\t\tif(document.getElementById('autoinstall').checked){XHR.appendData('autoinstall','yes');}else{XHR.appendData('autoinstall','no');}\n\t\t}\n\t\t\n\t\tif(document.getElementById('nightlybuild')){\n\t\t\tif(document.getElementById('nightlybuild').checked){\n\t\t\t\tXHR.appendData('nightlybuild','yes');}else{XHR.appendData('nightlybuild','no');}\n\t\t}\t\t\n\t\t\n\t\tif(document.getElementById('front_page_notify')){\n\t\t\tif(document.getElementById('front_page_notify').checked){XHR.appendData('front_page_notify','yes');}else{XHR.appendData('front_page_notify','no');}\n\t\t}\n\t\t\n\t\tif(document.getElementById('EnableNightlyInFrontEnd')){\n\t\t\tif(document.getElementById('EnableNightlyInFrontEnd').checked){XHR.appendData('EnableNightlyInFrontEnd','1');}else{XHR.appendData('EnableNightlyInFrontEnd','0');}\n\t\t}\n\t\t\n\t\tif(document.getElementById('ArticaUpdateIntervalAllways')){\n\t\t\tif(document.getElementById('ArticaUpdateIntervalAllways').checked){XHR.appendData('ArticaUpdateIntervalAllways','1');}else{XHR.appendData('ArticaUpdateIntervalAllways','0');}\n\t\t}\t\t\n\t\t\n\t\t\n\t\tif(document.getElementById('EnablePatchUpdates')){\n\t\t\tif(document.getElementById('EnablePatchUpdates').checked){XHR.appendData('EnablePatchUpdates','1');}else{XHR.appendData('EnablePatchUpdates','0');}\n\t\t}\n\t\tif(document.getElementById('EnableSystemUpdates')){\n\t\t\tif(document.getElementById('EnableSystemUpdates').checked){\n\t\t\tXHR.appendData('EnableSystemUpdates','1');\n\t\t\t\t}else{\n\t\t\tXHR.appendData('EnableSystemUpdates','0');\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t\n\t\tif(document.getElementById('EnableScheduleUpdates')){\n\t\t\tif(document.getElementById('EnableScheduleUpdates').checked){\n\t\t\t\tvar ArticaScheduleUpdates=document.getElementById('ArticaScheduleUpdates').value;\n\t\t\t\tif(ArticaScheduleUpdates.length==0){\n\t\t\t\t\talert('{$cannot_schedule_update_without_schedule}');\n\t\t\t\t}\n\t\t\t\tXHR.appendData('EnableScheduleUpdates','1');}\n\t\t\telse{XHR.appendData('EnableScheduleUpdates','0');}\n\t\t}\n\t\t\n\t\tif(document.getElementById('samba_notify')){if(document.getElementById('samba_notify').checked){XHR.appendData('samba_notify','yes');}else{XHR.appendData('samba_notify','no');}}\n\t\t\n\t\t\n\t\n\t\tif(document.getElementById('DisableInstantLDAPBackup')){\n\t\t\tif(document.getElementById('DisableInstantLDAPBackup').checked){XHR.appendData('DisableInstantLDAPBackup','1');}else{XHR.appendData('DisableInstantLDAPBackup','0');}\n\t\t}\n\t\t\n\t\tif(document.getElementById('ArticaScheduleUpdates')){\n\t\t\tXHR.appendData('ArticaScheduleUpdates',document.getElementById('ArticaScheduleUpdates').value);\n\t\t}\t\t\t\n\t\tif(document.getElementById('WgetBindIpAddress')){\n\t\t\tXHR.appendData('WgetBindIpAddress',document.getElementById('WgetBindIpAddress').value);\n\t\t}\n\t\tif(document.getElementById('CheckEveryMinutes')){\n \t\tXHR.appendData('CheckEveryMinutes',document.getElementById('CheckEveryMinutes').value);\n \t}\n \tif(document.getElementById('uri')){\n \t\tXHR.appendData('uri',document.getElementById('uri').value);\n \t}\n\t\tif(document.getElementById('CurlBandwith')){\n \t\tXHR.appendData('CurlBandwith',document.getElementById('CurlBandwith').value);\n \t}\n\t\tif(document.getElementById('CurlTimeOut')){\n \t\tXHR.appendData('CurlTimeOut',document.getElementById('CurlTimeOut').value);\n \t} \n\n \tif(document.getElementById('NoCheckSquid')){\n \t\tif(document.getElementById('NoCheckSquid').checked){XHR.appendData('NoCheckSquid','1');}else{XHR.appendData('NoCheckSquid','0');}\n \t}\n \t\n \t\n \tAnimateDiv('ArticaUpdateForm');\n \tXHR.sendAndLoad('{$page}', 'GET',x_SaveArticaUpdateForm);\n\t\t}\t\n\t\n\t</script>\n\t"; $tpl = new templates(); return $tpl->_ENGINE_parse_body($html . $form); }
function rule_popup(){ $page=CurrentPageName(); $tpl=new templates(); $sock=new sockets(); $eth=$_GET["eth"]; $ethC=new system_nic($eth); $table=$_GET["table"]; $ID=$_GET["ID"]; $t=time(); $title="$eth::".$tpl->_ENGINE_parse_body("{new_rule}"); $bt="{add}"; $enabled=1; $LOCKFORWARD=1; $HIDEFORMARK=0; $EnableL7Filter=intval($sock->GET_INFO("EnableL7Filter")); $EnableQOS=intval($sock->GET_INFO("EnableQOS")); if($ID>0){ $q=new mysql(); $ligne=mysql_fetch_array($q->QUERY_SQL("SELECT * FROM iptables_main WHERE ID='$ID'","artica_backup")); $title="$eth::".$tpl->javascript_parse_text($ligne["rulename"]); $enabled=$ligne["enabled"]; $table=$ligne["MOD"]; $eth=$ligne["eth"]; $bt="{apply}"; $jlog=$ligne["jlog"]; } $L7Mark=intval($ligne["L7Mark"]); if($EnableL7Filter==1){ $q=new mysql(); $L7Filters[0]="{select}"; $sql="SELECT ID,keyitem FROM `l7filters_items` WHERE enabled=1"; $resultsL7Filter = $q->QUERY_SQL($sql,"artica_backup"); while ($ligneL7Filter = mysql_fetch_assoc($resultsL7Filter)) { $L7Filters[$ligneL7Filter["ID"]]=strtoupper($ligneL7Filter["keyitem"]); $L7Field="<tr><td colspan=3><div style='height:30px'> </div></td></tr> <tr> <td class=legend style='font-size:22px' nowrap>{applications}:</td> <td colspan=2>". Field_array_Hash($L7Filters,"L7Mark-$t",$L7Mark,"style:font-size:22px")."</td> </tr> "; } } $nic=new networking(); $nicZ=$nic->Local_interfaces(); unset($nicZ[$eth]); $ForwardNICs[null]="{none}"; while (list ($yinter, $line) = each ($nicZ) ){ $znic=new system_nic($yinter); if($znic->Bridged==1){continue;} $ForwardNICs[$yinter]="$yinter - $znic->NICNAME"; } $FORWARD_NIC="<tr> <td class=legend style='font-size:22px' nowrap>{output_interface}:</td> <td>". Field_array_Hash($ForwardNICs,"ForwardNIC-$t",$ligne["ForwardNIC"],"style:font-size:22px")."</td> <td width=1%> </td> </tr>"; if($table=="FORWARD"){$LOCKFORWARD=0;} $rulename=$ligne["rulename"]; $proto=$ligne["proto"]; $accepttype=$ligne["accepttype"]; $source_group=intval($ligne["source_group"]); $dest_group=intval($ligne["dest_group"]); $destport_group=intval($ligne["destport_group"]); if($proto==null){$proto="tcp";} $protos[null]="{all}"; $protos["udp"]="UDP"; $protos["tcp"]="tcp"; $accepttypes["ACCEPT"]="{accept}"; $accepttypes["DROP"]="{drop}"; $accepttypes["RETURN"]="{return}"; $accepttypes["LOG"]="{log_only}"; if($table=="MARK"){ $LOCKFORWARD=1; $HIDEFORMARK=1; $accepttypes=array(); $accepttypes["MARK"]="{MARK}"; if($EnableQOS==1){$containers=containers_from_eth($eth);} $MARK_SECTION=" <table> <tr><td colspan=3> </td></tr> <tr> <td class=legend style='font-size:22px' nowrap>{Q.O.S} {containers}:</td> <td>". Field_array_Hash($containers,"QOS-$t",$ligne ["QOS"],"style:font-size:22px")."</td> <td width=1%> </td> </tr> <tr> <td class=legend style='font-size:22px' nowrap>{or} {MARK_ITEM}:</td> <td>". Field_text("MARK-$t",$ligne["MARK"],"font-size:22px;width:90px")."</td> <td width=1%> </td> </tr>$FORWARD_NIC </table> "; $FORWARD_NIC=null; } $AllSystems=$tpl->javascript_parse_text("{AllSystems}"); $AllPorts=$tpl->javascript_parse_text("{AllPorts}"); if($source_group==0){ $inbound_object=$AllSystems; } if($dest_group==0){ $outbound_object=$AllSystems; } if($destport_group==0){ $destports_object=$AllPorts; } if(!is_numeric($ligne["zOrder"])){$ligne["zOrder"]=1;} if(!is_numeric($ligne["masquerade"])){$ligne["masquerade"]=1;} $jsGroup1="squid.BrowseAclGroups.php?callback=LinkInBoundGroup$t&FilterType=FW-IN"; $jsGroup2="squid.BrowseAclGroups.php?callback=LinkOutbBoundGroup$t&FilterType=FW-OUT"; $jsGroup3="squid.BrowseAclGroups.php?callback=LinkPortGroup$t&FilterType=FW-PORT"; $sDel1=imgtootltip("22-delete.png","{unlink}","Delgroup1$t()"); $sDel2=imgtootltip("22-delete.png","{unlink}","Delgroup2$t()"); $sDel3=imgtootltip("22-delete.png","{unlink}","Delgroup3$t()"); $html=" <div style='width:98%' class=form> ". Field_hidden("source_group-$t", $ligne["source_group"])." ". Field_hidden("dest_group-$t", $ligne["dest_group"])." ". Field_hidden("destport_group-$t", $ligne["destport_group"])." <div style='font-size:26px;margin-bottom:25px;margin-top:10px;margin-left:5px'>[$table] $title</div> <table style='width:100%'> <tr> <td class=legend style='font-size:22px' nowrap>{rulename}:</td> <td>". Field_text("rulename-$t",$rulename,"font-size:22px;width:450px")."</td> <td width=1%> </td> </tr> <tr> <td class=legend style='font-size:22px' nowrap>{order}:</td> <td>". Field_text("zOrder-$t",$ligne["zOrder"],"font-size:22px;width:90px")."</td> <td width=1%> </td> </tr> <tr> <td class=legend style='font-size:22px' nowrap>{enabled}:</td> <td>". Field_checkbox("enabled-$t", 1,$enabled)."</td> <td width=1%> </td> </tr> <tr> <td class=legend style='font-size:22px' nowrap><span id='OverideNet-label-$t'>{OverideNet}:</span></td> <td><span id='OverideNet-field-$t'>". Field_checkbox("OverideNet-$t", 1,$ligne["OverideNet"])."</span></td> <td width=1%><span id='OverideNet-explain-$t'>". help_icon("{OverideNet_explain}")."</span></td> </tr> <tr> <td class=legend style='font-size:22px' nowrap>{log_all_events}:</td> <td>". Field_checkbox("jlog-$t", 1,$jlog)."</td> <td width=1%> </td> </tr> <tr> <td class=legend style='font-size:22px' nowrap>{protocol}:</td> <td>". Field_array_Hash($protos,"proto-$t",$proto,"style:font-size:22px")."</td> <td width=1%> </td> </tr> <tr><td colspan=3> <center style='width:90%;margin:20px;border:1px solid #DDDDDD;border-radius:4px 4px 4px 4px'> <table > <tr><td colspan=4> </td></tr> <tr> <td width=42% align='center' style='font-size:22px;font-weight:bold;'>{inbound_object}</td> <td width=5% align='center'> </td> <td width=42% align='center' style='font-size:22px;font-weight:bold'>{outbound_object}</td> </tr> <tr><td colspan=4> </td></tr> <tr> <td width=42% align='center'><a href=\"javascript:Loadjs('$jsGroup1');\" style='font-size:22px;text-decoration:underline'> <span id='in-$t'>$inbound_object</span></a>$sDel1</td> <td width=5% align='center'><img src='img/arrow-blue-left-64.png'></td> <td width=42% align='center'><a href=\"javascript:Loadjs('$jsGroup2');\" style='font-size:22px;text-decoration:underline'> <span id='out-$t'>$outbound_object</span></a>$sDel2</td> </tr> <tr><td colspan=4> </td></tr> </table> </center> </td> </tr> <tr> <td class=legend style='font-size:22px' nowrap>{dest_ports}:</td> <td><a href=\"javascript:Loadjs('$jsGroup3');\" style='font-size:22px;text-decoration:underline'> <span id='port-$t'>$destports_object</span></a><div style='float:left;margin-right:5px'>$sDel3</div></td> <td width=1%> </td> </tr> $L7Field <tr><td colspan=3><div style='height:30px'> </div></td></tr> <tr> <td class=legend style='font-size:26px' nowrap>{action}:</td> <td colspan=2>". Field_array_Hash($accepttypes,"accepttype-$t",$accepttype,"style:font-size:26px;padding:5px;width:250px;")."</td> </tr> <tr> <td colspan=3> <center style='width:90%;margin:20px;border:1px solid #DDDDDD;border-radius:4px 4px 4px 4px'> $MARK_SECTION <table id='FORWARD-$t'> <tr><td colspan=3> </td></tr> $FORWARD_NIC <tr> <td class=legend style='font-size:22px' nowrap>{forward_to}:</td> <td>". Field_text("ForwardTo-$t",$ligne["ForwardTo"],"font-size:22px;width:450px")."</td> <td width=1%>". help_icon("{forward_to_iptables_explain}")."</td> </tr> <tr> <td class=legend style='font-size:22px' nowrap colspan=2>{rewrite_source_address}:</td> <td>". Field_checkbox("masquerade-$t",1,$ligne["masquerade"])."</td> </tr> <tr><td colspan=3> </td></tr> </table> </center> </td> </tr> <tr> <td colspan=3 align='right'><hr>". button($bt,"Save$t()",30)."</td> </tr> </table> </div> <script> var xSave$t= function (obj) { var res=obj.responseText; if (res.length>3){alert(res);} var ID=$ID; $('#flexRT{$_GET["t"]}').flexReload(); ExecuteByClassName('SearchFunction'); if(ID==0){YahooWinHide();} } function SaveCHK$t(e){ if(!checkEnter(e)){return;} Save$t(); } function LinkInBoundGroup$t(ID){ var RID=$ID; document.getElementById('source_group-$t').value=ID; LoadAjaxTiny('in-$t','$page?groupname=yes&gpid='+ID); if(RID>0){Save$t();} } function LinkOutbBoundGroup$t(ID){ var RID=$ID; document.getElementById('dest_group-$t').value=ID; LoadAjaxTiny('out-$t','$page?groupname=yes&gpid='+ID); if(RID>0){Save$t();} } function LinkPortGroup$t(ID){ var RID=$ID; document.getElementById('destport_group-$t').value=ID; LoadAjaxTiny('port-$t','$page?groupname=yes&gpid='+ID); if(RID>0){Save$t();} } function Delgroup1$t(){ var RID=$ID; document.getElementById('source_group-$t').value=0; document.getElementById('in-$t').innerHTML='$AllSystems'; if(RID>0){Save$t();} } function Delgroup2$t(){ var RID=$ID; document.getElementById('dest_group-$t').value=0; document.getElementById('out-$t').innerHTML='$AllSystems'; if(RID>0){Save$t();} } function Delgroup3$t(){ var RID=$ID; document.getElementById('destport_group-$t').value=0; document.getElementById('port-$t').innerHTML='$AllSystems'; if(RID>0){Save$t();} } function Save$t(){ var XHR = new XHRConnection(); XHR.appendData('rule-save', '$ID'); XHR.appendData('rulename', encodeURIComponent(document.getElementById('rulename-$t').value)); XHR.appendData('proto', document.getElementById('proto-$t').value); XHR.appendData('accepttype', document.getElementById('accepttype-$t').value); XHR.appendData('table', '$table'); XHR.appendData('interface', '$eth'); if(document.getElementById('enabled-$t').checked){ XHR.appendData('enabled',1); }else{ XHR.appendData('enabled',0); } if(document.getElementById('OverideNet-$t').checked){ XHR.appendData('OverideNet',1); }else{ XHR.appendData('OverideNet',0); } if(document.getElementById('jlog-$t').checked){ XHR.appendData('jlog',1); }else{ XHR.appendData('jlog',0); } XHR.appendData('source_group', document.getElementById('source_group-$t').value); XHR.appendData('dest_group', document.getElementById('dest_group-$t').value); XHR.appendData('destport_group', document.getElementById('destport_group-$t').value); XHR.appendData('zOrder', document.getElementById('zOrder-$t').value); XHR.appendData('ForwardTo', document.getElementById('ForwardTo-$t').value); XHR.appendData('ForwardNIC', document.getElementById('ForwardNIC-$t').value); XHR.appendData('masquerade', document.getElementById('masquerade-$t').value); if(document.getElementById('QOS-$t') ){ XHR.appendData('QOS', document.getElementById('QOS-$t').value); } if(document.getElementById('MARK-$t') ){ XHR.appendData('MARK', document.getElementById('MARK-$t').value); } if(document.getElementById('L7Mark-$t') ){ XHR.appendData('L7Mark', document.getElementById('L7Mark-$t').value); } XHR.sendAndLoad('$page', 'POST',xSave$t); } function Dyn$t(){ var RID=$ID; var LOCKFORWARD=$LOCKFORWARD; var HIDEFORMARK=$HIDEFORMARK; var source_group=$source_group; var dest_group={$dest_group}; var destport_group=$destport_group; if(LOCKFORWARD==1){ document.getElementById('ForwardNIC-$t').disabled=true; document.getElementById('ForwardTo-$t').disabled=true; document.getElementById('FORWARD-$t').style.visibility='hidden'; } if(HIDEFORMARK==1){ document.getElementById('OverideNet-label-$t').style.visibility='hidden'; document.getElementById('OverideNet-field-$t').style.visibility='hidden'; document.getElementById('OverideNet-explain-$t').style.visibility='hidden'; document.getElementById('ForwardNIC-$t').disabled=false; } if(RID==0){return;} if(source_group>0){ LoadAjaxTiny('in-$t','$page?groupname=yes&gpid='+source_group); } if(dest_group>0){ LoadAjaxTiny('out-$t','$page?groupname=yes&gpid='+dest_group); } if(destport_group>0){ LoadAjaxTiny('port-$t','$page?groupname=yes&gpid='+destport_group); } } Dyn$t(); </script>"; echo $tpl->_ENGINE_parse_body($html); }
function add_new_disk_popup() { $t = $_GET["t"]; $page = CurrentPageName(); $squid = new squidbee(); $tpl = new templates(); $sock = new sockets(); $caches_types[null] = '{select}'; $caches_types["aufs"] = "aufs"; $caches_types["diskd"] = "diskd"; unset($caches_types["rock"]); $type = $tpl->_ENGINE_parse_body(Field_array_Hash($caches_types, "cache_type-{$t}", "aufs", "CheckCachesTypes()", null, 0, "font-size:16px;padding:3px")); $WARN_OPE_RESTART_SQUID_ASK = $tpl->javascript_parse_text("{WARN_OPE_RESTART_SQUID_ASK}"); $currentsize = Calculate_maxcachessize(); $maxCacheSizeInt = 250 * 1000 - $currentsize; $maxCacheSize = 50; $DefaultmaxCacheSize = round($maxCacheSize / 4, 1); $NextCache = count($squid->cache_list) + 1; $defaultCachedir = "/home/squid/cache/squid0{$NextCache}"; $cachedirtext = "\n\t\t<tr>\n\t\t<td class=legend style='font-size:16px' nowrap>{directory}:</td>\n\t\t<td>" . Field_text("cache_directory-{$t}", $defaultCachedir, "width:270px;font-size:16px;padding:3px") . "</td>\n\t\t<td></td>\n\t\t</tr>"; $btname = "{add}"; $SliderDef = 10; $cache_dir_level1_def = 16; $LockOthers = 0; if (isset($_GET["chdef"])) { $cachedirtext = "<tr>\n\t\t<td class=legend style='font-size:16px' nowrap>{directory}:</td>\n\t\t<td><strong style='font-size:14px'>{$squid->CACHE_PATH}</strong>" . Field_hidden("cache_directory-{$t}", $squid->CACHE_PATH) . "</td>\n\t\t<td> </td>\n\t\t</tr>"; $btname = "{apply}"; $type = $tpl->_ENGINE_parse_body(Field_array_Hash($caches_types, "cache_type-{$t}", $squid->CACHE_TYPE, "CheckCachesTypes()", null, 0, "font-size:16px;padding:3px")); $SliderDef = round($squid->CACHE_SIZE / 1000); $DefaultmaxCacheSize = $squid->CACHE_SIZE / 1000; $XHRADD = "XHR.appendData('DEFAULT_CACHE_SAVE_TRUE','OK');"; $LockOthers = 1; } $html = "\t<div id='waitcache-{$t}'></div>\n\t<input type='hidden' name='squid-cache-size-{$t}' id='squid-cache-size-{$t}' value='10'>\n\t<table style='width:99%' class=form>\n\t\t{$cachedirtext}\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px' nowrap>{type}:</td>\n\t\t\t<td>{$type}</td>\n\t\t\t<td> </td>\n\t\t\t<td> </td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px' nowrap>{cache_size}:</td>\n\t\t\t<td style='font-size:16px'><div id='slider{$t}'></div></td>\n\t\t\t<td> <strong style='font-size:16px' id='{$t}-value'>{$DefaultmaxCacheSize}G/{$maxCacheSize}G</strong><input type='hidden' id='{$t}-mem' value='{$SquidBoosterMem}'></td>\n\t\t\t<td>" . help_icon('{cache_size_text}', false, 'squid.index.php') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=4><strong>{warn_calculate_nothdsize}</strong></td>\t\t\n\n\t\t<tr>\n\t\t\t<td class=legend nowrap style='font-size:16px'>{cache_dir_level1}:</td>\n\t\t\t<td>" . Field_text("cache_dir_level1-{$t}", 16, 'width:50px;font-size:16px;padding:3px') . "</td>\n\t\t\t<td> </td>\n\t\t\t<td>" . help_icon('{cache_dir_level1_text}', false, 'squid.index.php') . "</td>\n\t\t</tr>\t\t\t\n\t\t<tr>\n\t\t\t<td class=legend nowrap style='font-size:16px'>{cache_dir_level2}:</td>\n\t\t\t<td>" . Field_text("cache_dir_level2-{$t}", 256, 'width:50px;font-size:16px;padding:3px') . "</td>\n\t\t\t<td> </td>\n\t\t\t<td>" . help_icon('{cache_dir_level2_text}', false, 'squid.index.php') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap style='font-size:16px'>{max_objects_size}:</td>\n\t\t\t<td style='font-size:16px'>" . Field_text("cache_maxsize-{$t}", $s->cache_list[$cache]["cache_maxsize"], 'width:50px;font-size:16px;padding:3px', null, "calculateSize()", null, false, null) . " Mbytes <span id='squid-maxsize-vals'></span></td>\n\t\t\t<td> </td>\n\t\t\t<td>" . help_icon('{squid_rock_maxsize}', false, 'squid.index.php') . "</td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t<td align='right' colspan=4><hr>" . button($btname, "AddNewCacheSave{$t}()", 14) . "</td>\n\t\t</tr>\n\t</table>\n\t\n<script>\n\t\t\$(document).ready(function(){\n\t\t\t\$('#slider{$t}').slider({ max: {$maxCacheSize},step:2,value:{$SliderDef},slide: function(e, ui) {ChangeSlideField{$t}(ui.value)},change: function(e, ui) {ChangeSlideField{$t}(ui.value);} });\n\t\t});\n\t\t\n\t\tfunction ChangeSlideField{$t}(val){\n\t\t\tvar disabled='';\n\t\t\tif(val==0){disabled=' {$disabled}';}\n\t\t\tdocument.getElementById('{$t}-value').innerHTML=val+'G/{$maxCacheSize}G'+disabled;\n\t\t\tdocument.getElementById('squid-cache-size-{$t}').value=val;\n\t\t}\t\t\n\n\n\t\tfunction CheckCachesTypes(){\n\t\t\tcachetypes=document.getElementById('cache_type-{$t}').value;\n\t\t\tvar LockOthers={$LockOthers};\n\t\t\tif(LockOthers==1){\n\t\t\t\tdocument.getElementById('cache_dir_level2-{$t}').disabled=true;\n\t\t\t\tdocument.getElementById('cache_dir_level1-{$t}').disabled=true;\n\t\t\t\tdocument.getElementById('cache_maxsize-{$t}').disabled=true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\tvar x_AddNewCacheSave{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){\n\t\t\t\talert(results);\n\t\t\t\tdocument.getElementById('waitcache').innerHTML='';\n\t\t\t\t}\n\t\t\tYahooWin3Hide();\n\t\t\t\$('flexRT{$t}').flexReload();\n\t\t\tRefreshTab('squid_main_caches_new');\n\t\t}\t\t\n\t\n\tfunction AddNewCacheSave{$t}(){\n\t\t\n\t\t\tvar XHR = new XHRConnection();\n\t\t\t{$XHRADD}\n\t\t\tXHR.appendData('cache_directory',document.getElementById('cache_directory-{$t}').value);\n\t\t\tXHR.appendData('cache_type',document.getElementById('cache_type-{$t}').value);\n\t\t\tXHR.appendData('size',document.getElementById('squid-cache-size-{$t}').value);\n\t\t\tXHR.appendData('cache_dir_level1',document.getElementById('cache_dir_level1-{$t}').value);\n\t\t\tXHR.appendData('cache_dir_level2',document.getElementById('cache_dir_level2-{$t}').value);\n\t\t\tXHR.appendData('cache_maxsize',document.getElementById('cache_maxsize-{$t}').value);\n\t\t\tAnimateDiv('waitcache-{$t}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_AddNewCacheSave{$t});\n\t\t\t\n\t\t}\t\t\n\t\tCheckCachesTypes();\n</script>"; echo $tpl->_ENGINE_parse_body($html); }
function connection_popup() { $ID = $_GET["connection-id"]; $tpl = new templates(); $q = new mysql(); $page = CurrentPageName(); $bt_title = "{add}"; if ($ID == 0) { $title = $tpl->javascript_parse_text("{new_connection}"); } if ($ID != null) { $bt_title = "{apply}"; $q = new mysql(); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM texttoldap WHERE ID='{$ID}'", "artica_backup")); } $t = time(); $ldap_group_text = "-"; if ($ligne["ldapgroup"] > 0) { $gp = new groups($ligne["ldapgroup"]); $ldap_group_text = $gp->groupName; } $html = "\n\t<div style='font-size:20px'>{$title}</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:16px'>{connection}:</td>\n\t\t<td>" . Field_text("connection-{$t}", $ligne["connection"], "font-size:16px;width:300px") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{hostname}:</td>\n\t\t<td>" . Field_text("hostname-{$t}", $ligne["hostname"], "font-size:16px;width:250px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{shared_folder}:</td>\n\t\t<td>" . Field_text("folder-{$t}", $ligne["folder"], "font-size:16px;width:250px") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{filename}:</td>\n\t\t<td>" . Field_text("filename-{$t}", $ligne["filename"], "font-size:16px;width:250px") . "</td>\n\t</tr>\t\t\t\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{username}:</td>\n\t\t<td>" . Field_text("username-{$t}", $ligne["username"], "font-size:16px;width:250px") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{password}:</td>\n\t\t<td>" . Field_password("password-{$t}", $ligne["password"], "font-size:16px;width:250px") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{default_ldap_group}:</td>\n\t\t<td>" . Field_hidden("ldapgroup-{$t}", $ligne["ldapgroup"]) . "<span id='group-text-{$t}' style='font-size:16px;'>{$ldap_group_text}</span> " . button_browse_ldap_group("ChooseGroup{$t}") . "</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td colspan=2 align='right'>" . button($bt_title, "Save{$t}()", 18) . "</td>\n\t</tr>\n\t</table>\n<script>\n\tvar xSave{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){alert(res);}\n\t\tvar ID='{$ID}';\n\t\t\$('#flexRT{$_GET["t"]}').flexReload();\n\t\t\$('#flexRT{$_GET["tt"]}').flexReload();\n\t\tExecuteByClassName('SearchFunction');\n\t\tif(ID.length==0){YahooWin2Hide();}\n\t}\n\t\n\tfunction SaveCHK{$t}(e){\n\t\tif(!checkEnter(e)){return;}\n\t\tSave{$t}();\n\t}\n\t\n\tfunction ChooseGroup{$t}(num,groupname){\n\t\tdocument.getElementById('group-text-{$t}').innerHTML=groupname;\n\t\tdocument.getElementById('ldapgroup-{$t}').value=num;\n\t}\n\t\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('connection-id', '{$ID}');\n\tXHR.appendData('connection', encodeURIComponent(document.getElementById('connection-{$t}').value));\n\tXHR.appendData('hostname', encodeURIComponent(document.getElementById('hostname-{$t}').value));\n\tXHR.appendData('folder', encodeURIComponent(document.getElementById('folder-{$t}').value));\n\tXHR.appendData('filename', encodeURIComponent(document.getElementById('filename-{$t}').value));\n\tXHR.appendData('username', encodeURIComponent(document.getElementById('username-{$t}').value));\n\tXHR.appendData('password', encodeURIComponent(document.getElementById('password-{$t}').value));\n\tXHR.appendData('ldapgroup', encodeURIComponent(document.getElementById('ldapgroup-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\t</script>\t"; echo $tpl->_ENGINE_parse_body($html); }
function AddCachedSitelist_popup() { if (!$_SESSION["CORP"]) { $tpl = new templates(); $onlycorpavailable = $tpl->_ENGINE_parse_body("{onlycorpavailable}"); $content = "<p class=text-error>{$onlycorpavailable}</p>"; echo $content; return; } $page = CurrentPageName(); $t = $_GET["t"]; $option[null] = "---------"; $option["override-lastmod"] = "override-lastmod"; $option["override-expire"] = "override-expire"; $option["reload-into-ims"] = "reload-into-ims"; $option["override-expire ignore-no-cache ignore-no-store ignore-private"] = "{ignore_all}"; $option["ignore-reload"] = "ignore-reload"; $option["reload-into-ims ignore-no-cache"] = "reload-into-ims+ignore-no-cache"; $button = "{add}"; if (!is_numeric($_GET["id"])) { $_GET["id"] = 0; } if ($_GET["id"] > 0) { $sql = "SELECT * FROM squid_speed WHERE ID={$_GET["id"]}"; $q = new mysql(); $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); $domain = $ligne["domain"]; $pourc = $ligne["refresh_pattern_perc"]; $refresh_pattern_min = $ligne["refresh_pattern_min"]; $refresh_pattern_max = $ligne["refresh_pattern_max"]; $refresh_pattern_option = $ligne["refresh_pattern_options"]; $button = "{apply}"; } $refresh_pattern_opt = Field_array_Hash($option, "refresh_pattern_option-{$t}", $refresh_pattern_option, null, null, 0, "font-size:22px;padding:3px"); $html = "\n\t<div id='AddCachedSitelistDiv-{$t}'></div>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>\n\t\n\t" . Field_hidden("id", "{$_GET["id"]}") . "\n\t<div style='font-size:18px;padding:5px' class=explain>{squid_refresh_pattern_explain}</div>\n\t<table style='width:99%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{pattern}", "{refresh_pattern_site}") . ":</td>\n\t\t<td style='font-size:22px'>" . Field_text("refresh_pattern_site-{$t}", $domain, 'font-size:22px;padding:3px;width:640px', null, null, null, false, "AddCachedSiteListCheckEnter(event)") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{minimal_time}", "{refresh_pattern_min}") . ":</td>\n\t\t<td style='font-size:18px'>" . Field_text("refresh_pattern_min-{$t}", $refresh_pattern_min, 'width:110px;font-size:22px;padding:3px', null, null, null, false, "AddCachedSiteListCheckEnter(event)") . " Mn</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{percentage}", "{refresh_pattern_pourc}") . ":</td>\n\t\t<td style='font-size:18px'>" . Field_text("refresh_pattern_pourc-{$t}", $pourc, 'width:110px;font-size:22px;padding:3px', null, null, null, false, "AddCachedSiteListCheckEnter(event)") . " %</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{maximal_time}", "{refresh_pattern_max}") . ":</td>\n\t\t<td style='font-size:18px'>" . Field_text("refresh_pattern_max-{$t}", $refresh_pattern_max, 'width:110px;font-size:22px;padding:3px', null, null, null, false, "AddCachedSiteListCheckEnter(event)") . " Mn</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>" . texttooltip("{option}", "{refresh_pattern_option}") . ":</td>\n\t\t<td style='font-size:18px'>{$refresh_pattern_opt}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>\n\t\t\t" . button($button, "AddCachedSitelistSave{$t}()", 32) . "</td>\n\t</tr>\n\t</table>\t\t\n\t\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t<center style='margin-top:10px'>\n\t<div style='width:98%' class=form>\n\t<center><img src='img/refresh_pattern_graph.gif' style='border:3px solid #CCCCCC'></center>\n\t</div>\n\t</div>\n\t</center>\n\t\n\t<script>\n\t\tvar x_AddCachedSitelistSave{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tdocument.getElementById('AddCachedSitelistDiv-{$t}').innerHTML='';\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tif(document.getElementById('flexRT{$_GET["t"]}')){\n\t\t\t\t\$('#flexRT{$_GET["t"]}').flexReload();\t\n\t\t\t\t\n\t\t\t}\n\t\t\tExecuteByClassName('SearchFunction');\t\n\t\t\tYahooWin3Hide();\n\t\t}\t\t\t\n\t\t\n\t\tfunction AddCachedSitelistSave{$t}(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('id','{$_GET["id"]}');\n\t\t\tvar pp=encodeURIComponent(document.getElementById('refresh_pattern_site-{$t}').value);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tXHR.appendData('refresh_pattern_site',pp);\n\t\t\tXHR.appendData('refresh_pattern_min',document.getElementById('refresh_pattern_min-{$t}').value);\n\t\t\tXHR.appendData('refresh_pattern_pourc',document.getElementById('refresh_pattern_pourc-{$t}').value);\n\t\t\tXHR.appendData('refresh_pattern_max',document.getElementById('refresh_pattern_max-{$t}').value);\n\t\t\tXHR.appendData('refresh_pattern_option',document.getElementById('refresh_pattern_option-{$t}').value);\n\t\t\tAnimateDiv('AddCachedSitelistDiv-{$t}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_AddCachedSitelistSave{$t});\t\t\t\n\t\t\n\t\t}\n\t\t\n\n\t\t\n\t\tfunction AddCachedSiteListCheckEnter(e){\n\t\t\tif(checkEnter(e)){AddCachedSitelistSave{$t}();}\n\t\t}\n\t</script>\t\n\t\n\t\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function add_form() { $ldap = new clladp(); $sock = new sockets(); $page = CurrentPageName(); $users = new usersMenus(); $tpl = new templates(); $t = $_GET["t"]; if (!is_numeric($t)) { $t = 0; } $nics = unserialize(base64_decode($sock->getFrameWork("cmd.php?list-nics=yes"))); $title_button = "{add}"; if (!is_numeric($_GET["ID"])) { $_GET["ID"] = 0; } if ($_GET["ID"] > 0) { $sql = "SELECT * FROM nics_vde WHERE ID='{$_GET["ID"]}'"; $q = new mysql(); $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); $title_button = "{apply}"; } for ($i = 1; $i < 33; $i++) { $ports[$i] = $i; } $vlans[0] = "{none}"; for ($i = 1; $i < 256; $i++) { $vlans[$i] = $i; } if (isset($_GET["default-datas"])) { $default_array = unserialize(base64_decode($_GET["default-datas"])); if (is_array($default_array)) { $ligne["nic"] = $default_array["NIC"]; if (preg_match("#(.+?)\\.([0-9]+)\$#", $default_array["IP"], $re)) { if ($re[2] > 254) { $re[2] = 1; } $re[2] = $re[2] + 1; $ligne["ipaddr"] = "{$re[1]}.{$re[2]}"; $ligne["gateway"] = $default_array["GW"]; $ligne["netmask"] = $default_array["NETMASK"]; } } } if ($ligne["metric"] == 0) { $ligne["metric"] = 100 + $_GET["ID"]; } $styleOfFields = "font-size:16px;padding:3px"; while (list($num, $val) = each($nics)) { if (preg_match("#^virt#", $val)) { continue; } $nics_array[$val] = $val; } $nics_array[null] = "{select}"; if (!is_numeric($ligne["port"])) { $ligne["port"] = 1; } $nic_field = Field_array_Hash($nics_array, "nic-{$t}", $ligne["nic"], null, null, 0, "font-size:16px;padding:3px"); $port_field = Field_array_Hash($ports, "port-{$t}", $ligne["port"], null, null, 0, "font-size:16px;padding:3px"); $vlan_field = Field_array_Hash($vlans, "vlan-{$t}", $ligne["vlan"], null, null, 0, "font-size:16px;padding:3px"); $html = "\n<div id='animate-{$t}'></div>\n<div id='virtip'>" . Field_hidden("ID", "{$_GET["ID"]}") . "\n<div style='width:98%' class=form>\n<table style='width:99%'>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{nic}:</td>\n\t\t<td>{$nic_field}</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{vlan_id}:</td>\n\t\t<td>{$vlan_field}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{switch_port}:</td>\n\t\t<td>{$port_field}</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{tcp_address}:</td>\n\t\t<td>" . field_ipv4("ipaddr-{$t}", $ligne["ipaddr"], $styleOfFields, false, "CalcCdirVirt{$t}(0)") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{netmask}:</td>\n\t\t<td>" . field_ipv4("netmask-{$t}", $ligne["netmask"], $styleOfFields, false, "CalcCdirVirt{$t}(0)") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>CDIR:</td>\n\t\t\t<td style='padding:-1px;margin:-1px'>\n\t\t\t<table style='width:99%;padding:-1px;margin:-1px'>\n\t\t\t<tr>\n\t\t\t<td width=1%>\n\t\t\t" . Field_text("cdir-{$t}", $ligne["cdir"], "{$styleOfFields};width:190px", null, null, null, false, null, $DISABLED) . "</td>\n\t\t\t<td align='left'> " . imgtootltip("img_calc_icon.gif", "cdir", "CalcCdirVirt{$t}(1)") . "</td>\n\t\t\t</tr>\n\t\t\t</table></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px'>{gateway}:</td>\n\t\t\t<td>" . field_ipv4("gateway-{$t}", $ligne["gateway"], $styleOfFields, false) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:16px'>{metric}:</td>\n\t\t\t<td>" . field_text("metric-{$t}", $ligne["metric"], "{$styleOfFields};width:90px", false) . "</td>\n\t\t</tr>\n\t</table>\n\t</div>\n\n\t<div id='infosVirtual' style='font-size:13px'></div>\n\t<div style='text-align:right'><hr>" . button($title_button, "Save{$t}()", 18) . "</div>\n</div>\n<script>\nvar Netid={$_GET["ID"]};\nvar cdir=document.getElementById('cdir-{$t}').value;\nvar netmask=document.getElementById('netmask-{$t}').value;\nif(netmask.length>0){if(cdir.length==0){CalcCdirVirt{$t}(0);}}\n\n\nvar X_CalcCdirVirt{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tdocument.getElementById('cdir-{$t}').value=results;\n}\n\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tdocument.getElementById('animate-{$t}').innerHTML='';\n\tif(results.length>3){alert(results);return;}\n\t\$('#table-{$t}').flexReload();\n\tYahooWin4Hide();\n\t\n}\n\nfunction CalcCdirVirt{$t}(recheck){\n\tvar cdir=document.getElementById('cdir-{$t}').value;\n\tif(recheck==0){if(cdir.length>0){return;}}\n\tvar XHR = new XHRConnection();\n\tXHR.setLockOff();\n\tXHR.appendData('cdir-ipaddr',document.getElementById('ipaddr-{$t}').value);\n\tXHR.appendData('netmask',document.getElementById('netmask-{$t}').value);\n\tXHR.sendAndLoad('artica.settings.php', 'GET',X_CalcCdirVirt{$t});\n}\t\n\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ipaddr',document.getElementById('ipaddr-{$t}').value);\n\tXHR.appendData('netmask',document.getElementById('netmask-{$t}').value);\n\tXHR.appendData('cdir',document.getElementById('cdir-{$t}').value);\n\tXHR.appendData('metric',document.getElementById('metric-{$t}').value);\n\tXHR.appendData('nic',document.getElementById('nic-{$t}').value);\n\tXHR.appendData('gateway',document.getElementById('gateway-{$t}').value);\n\tXHR.appendData('port',document.getElementById('port-{$t}').value);\n\tXHR.appendData('vlan',document.getElementById('vlan-{$t}').value);\n\tXHR.appendData('ID','{$_GET["ID"]}');\n\tMemFlexGrid={$t};\n\tAnimateDiv('animate-{$t}');\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>\n"; echo $tpl->_ENGINE_parse_body($html); }
function events_table() { if ($_GET["LockBycontext"] != null) { $_GET["context"] = $_GET["LockBycontext"]; $_GET["without-tri"] = "yes"; $field_context = Field_hidden("context", $_GET["context"]); $field_process = Field_hidden("process", ''); } $pattern = $_GET["pattern"]; if ($pattern != null) { $pattern = "*{$pattern}*"; $pattern = str_replace("*", "%", $pattern); $pattern = str_replace("%%", "%", $pattern); $sqlpat = " AND ((`text` LIKE '{$pattern}') OR (`content` LIKE '{$pattern}'))"; } $q = new mysql(); if ($_GET["without-tri"] == null) { $sql = "SELECT process FROM events WHERE 1 {$sqlpat} GROUP BY process ORDER BY process"; $results = $q->QUERY_SQL($sql, "artica_events"); while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { if ($ligne["process"] == null) { $ligne["process"] = "{unknown}"; } $text_interne = $ligne["process"]; $text_externe = $ligne["process"]; if ($text_externe == "class.templates.inc") { $text_externe = "system"; } if ($text_externe == "process1") { $text_externe = "watchdog"; } $arr[$text_interne] = $text_externe; } $arr[null] = "{select}"; $sql = "SELECT context FROM events WHERE 1 {$sqlpat} GROUP BY context ORDER BY context"; $results = $q->QUERY_SQL($sql, "artica_events"); while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { if ($ligne["context"] == null) { $ligne["context"] = "{unknown}"; } $text_interne = $ligne["context"]; $text_externe = $ligne["context"]; $arr1[$text_interne] = $text_externe; } $arr1[null] = "{select}"; $field_process = "<input type=hidden value='' id='process' name='process'>"; $field_context = Field_array_Hash($arr1, 'context', $_GET["context"], "tripar()"); } $html = "\n\t\t\t<table class=tableView style='width:100%'>\n\t\t\t\t<thead class=thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th width=1% nowrap colspan=2>{context}:</td>\n\t\t\t\t\t<th width:99%'>{$field_context}{$field_process}</td>\t\t\t\n\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t"; if ($_GET["process"] != null) { $pp1 = " AND process='{$_GET["process"]}'"; } if ($_GET["context"] != null) { $pp2 = " AND context='{$_GET["context"]}'"; } $sql = "SELECT * FROM events WHERE 1 {$pp2}{$pp1}{$sqlpat} ORDER by zDate DESC LIMIT 0,50"; $results = $q->QUERY_SQL($sql, "artica_events"); if (!$q->ok) { echo "<H2>{$q->mysql_error}</H2>"; return; } $tt = date('Y-m-d'); while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) { if ($ligne["process"] == null) { $ligne["process"] = "{unknown}"; } $original_date = $ligne["zDate"]; $ligne["zDate"] = str_replace($tt, '{today}', $ligne["zDate"]); if (preg_match("#\\[.+?\\]:\\s+\\[.+?\\]:\\s+\\((.+?)\\)\\s+:(.+)#", $ligne["text"], $re)) { $ligne["text"] = $re[2]; $computer = $re[1]; } if (preg_match("#\\[.+?\\]:\\s+\\[.+?\\]:\\s+\\((.+?)\\)\\:\\s+(.+)#", $ligne["text"], $re)) { $ligne["text"] = $re[2]; $computer = $re[1]; } if (preg_match("#\\[.+?\\]:\\s+\\[.+?\\]:\\s+\\((.+?)\\)\\s+(.+)#", $ligne["text"], $re)) { $ligne["text"] = $re[2]; $computer = $re[1]; } if (preg_match("#\\[.+?\\]:\\s+\\[.+?\\]:\\((.+?)\\)\\s+(.+)#", $ligne["text"], $re)) { $ligne["text"] = $re[2]; $computer = $re[1]; } if (preg_match("#\\[.+?\\]:\\s+\\[.+?\\]:\\s+(.+)#", $ligne["text"], $re)) { $ligne["text"] = $re[1]; } $affiche_text = $ligne["text"]; if (strlen($affiche_text) > 90) { $affiche_text = substr($affiche_text, 0, 85) . '...'; } $tooltip = "<li><strong>{date}: {$original_date}</li><li><strong>{computer}: {$computer}</strong></li><li><strong>{process}: {$ligne["process"]}</li>"; $tooltip = $tooltip . "<li><strong>{context}: {$ligne["context"]}</strong></li><hr>{click_to_display}<hr>"; $tooltip = $tooltip . "<div style=font-size:9px;padding:3px>{$ligne["text"]}</div>"; if (preg_match("#<body>(.+?)</body>#is", $ligne["content"], $re)) { $content = strip_tags($re[1]); } else { $content = strip_tags($ligne["content"]); } if (strlen($content) > 300) { $content = substr($content, 0, 290) . "..."; } $ID = $ligne["ID"]; $js = "articaShowEvent({$ID});"; $color = "5C81A7"; if (preg_match("#(error|fatal|unable)#i", $affiche_text)) { $color = "B50113"; } $affiche_text = texttooltip($affiche_text, $tooltip, $js, null, 0, "font-size:13px;font-weight:bolder;color:#{$color}"); if ($cl == "oddRow") { $cl = null; } else { $cl = "oddRow"; } $time = strtotime($original_date); $distanceOfTimeInWords = distanceOfTimeInWords($time, time()); $html = $html . "<tr class={$cl}>\n\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t<td valign='middle' nowrap style='font-size:13px' width=1% nowrap>{$ligne["zDate"]}</td>\n\t\t<td valign='top' width=99%><div style='font-size:13px'>{$affiche_text}</div><div style='font-size:11px'><i>{$distanceOfTimeInWords}</i><br><i>{$content}</i></div></td>\n\t\t</tR>\n\t\t\n\t\t"; } $html = $html . "</table>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function GROUP_PRIVILEGES($gid) { $usr = new usersMenus(); $sock = new sockets(); $RemoveButton = false; $SambaEnabled = $sock->GET_INFO("SambaEnabled"); $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance"); if (!is_numeric($SambaEnabled)) { $SambaEnabled = 1; } if ($SambaEnabled == 0) { $usr->SAMBA_INSTALLED = false; } $EnableSambaVirtualsServers = $sock->GET_INFO("EnableSambaVirtualsServers"); if (!is_numeric($EnableSambaVirtualsServers)) { $EnableSambaVirtualsServers = 0; } if (!is_numeric($EnablePostfixMultiInstance)) { $EnablePostfixMultiInstance = 0; } if (!isset($_GET["tab"])) { echo GROUP_PRIVILEGES_TABS($gid); return; } if (isset($_GET["start"])) { if ($gid == -1) { $oudiv = md5($_GET["ou"]); } if ($gid == -2) { $oudiv = md5($_GET["userid"]); } $div1 = "<div id='{$gid}{$oudiv}_priv'>"; $div2 = "</div>"; } if ($gid > 1) { $group = new groups($gid); $hash = $group->LoadDatas($gid); if ($usr->SAMBA_INSTALLED) { $group->TransformGroupToSmbGroup(); } $ou = $hash["ou"]; if ($gid == 544) { include_once dirname(__FILE__) . "/ressources/class.translate.rights.inc"; $pp = new TranslateRights(); $pt = $pp->GetPrivsArray(); $RemoveButton = true; while (list($num, $ligne) = each($pt)) { $hash["ArticaGroupPrivileges"][$num] = "yes"; } } $HashPrivieleges = $hash["ArticaGroupPrivileges"]; $title_form = "{group}: «{$hash["cn"]}"; } if ($gid == -1) { $ou = base64_decode($_GET["ou"]); $ldap = new clladp(); $hash = $ldap->OUDatas($ou); $privs = $hash["ArticaGroupPrivileges"]; $HashPrivieleges = $ldap->_ParsePrivieleges($privs, array()); $organization_hidden = "<input type='hidden' name='ou' value='{$ou}'>"; $title_form = "{organization}: «{$ou}"; } if ($gid == -2) { $userclass = new user($_GET["userid"]); $ou = base64_decode($userclass->ou); $ldap = new clladp(); $hash = $ldap->OUDatas($ou); $privs = $userclass->ArticaGroupPrivileges; $HashPrivieleges = $ldap->_ParsePrivieleges($privs, array()); $organization_hidden = "<input type='hidden' name='userid' value='{$_GET["userid"]}'>"; $title_form = "{member}: «{$_GET["userid"]}"; $warn = "<div class=text-info>{privileges_users_warning}</div>"; } if (strpos($gid, ",") > 0) { writelogs("GID is dn = {$gid}", __FUNCTION__, __FILE__, __LINE__); include_once dirname(__FILE__) . "/ressources/class.external.ad.inc"; $gp = new external_ad_search(); $ldap = new clladp(); writelogs("->LoadGroupDataByDN({$gid})", __FUNCTION__, __FILE__, __LINE__); $hash = $gp->LoadGroupDataByDN($gid); $privs = $hash["ArticaGroupPrivileges"]; $HashPrivieleges = $ldap->_ParsePrivieleges($privs, array()); $title_form = "{group}: «{$hash["samaccountname"][0]}<div style='font-size:11px;padding:left:50px;margin-bottom:10px;float:right'>{$gid}</div>"; } $priv = new usersMenus(); $AllowAddGroup = Field_yesno_checkbox('AllowAddGroup', $HashPrivieleges["AllowAddGroup"]); $AllowAddUsers = Field_yesno_checkbox('AllowAddUsers', $HashPrivieleges["AllowAddUsers"]); $AsArticaAdministrator = Field_yesno_checkbox('AsArticaAdministrator', $HashPrivieleges["AsArticaAdministrator"]); $AllowChangeDomains = Field_yesno_checkbox('AllowChangeDomains', $HashPrivieleges["AllowChangeDomains"]); $AsSystemAdministrator = Field_yesno_checkbox('AsSystemAdministrator', $HashPrivieleges["AsSystemAdministrator"]); $AsSambaAdministrator = Field_yesno_checkbox('AsSambaAdministrator', $HashPrivieleges["AsSambaAdministrator"]); $AsDnsAdministrator = Field_yesno_checkbox('AsDnsAdministrator', $HashPrivieleges["AsDnsAdministrator"]); $AsQuarantineAdministrator = Field_yesno_checkbox('AsQuarantineAdministrator', $HashPrivieleges["AsQuarantineAdministrator"]); $AsMailManAdministrator = Field_yesno_checkbox('AsMailManAdministrator', $HashPrivieleges["AsMailManAdministrator"]); $AsOrgStorageAdministrator = Field_yesno_checkbox('AsOrgStorageAdministrator', $HashPrivieleges["AsOrgStorageAdministrator"]); $AllowManageOwnComputers = Field_yesno_checkbox('AllowManageOwnComputers', $HashPrivieleges["AllowManageOwnComputers"]); $AsOrgPostfixAdministrator = Field_yesno_checkbox('AsOrgPostfixAdministrator', $HashPrivieleges["AsOrgPostfixAdministrator"]); $AsDansGuardianGroupRule = Field_yesno_checkbox('AsDansGuardianGroupRule', $HashPrivieleges["AsDansGuardianGroupRule"]); $AsMessagingOrg = Field_yesno_checkbox('AsMessagingOrg', $HashPrivieleges["AsMessagingOrg"], "CheckHasOrgAdmin()"); $AsOrgAdmin = Field_yesno_checkbox('AsOrgAdmin', $HashPrivieleges["AsOrgAdmin"], "CheckHasOrgAdmin()"); $AsInventoryAdmin = Field_yesno_checkbox('AsInventoryAdmin', $HashPrivieleges["AsInventoryAdmin"]); $AsJoomlaWebMaster = Field_yesno_checkbox('AsJoomlaWebMaster', $HashPrivieleges["AsJoomlaWebMaster"]); $AsVirtualBoxManager = Field_yesno_checkbox('AsVirtualBoxManager', $HashPrivieleges["AsVirtualBoxManager"]); $OverWriteRestrictedDomains = Field_yesno_checkbox('OverWriteRestrictedDomains', $HashPrivieleges["OverWriteRestrictedDomains"]); $AsWebMaster = Field_yesno_checkbox('AsWebMaster', $HashPrivieleges["AsWebMaster"]); $AsSystemWebMaster = Field_yesno_checkbox('AsSystemWebMaster', $HashPrivieleges["AsSystemWebMaster"]); $AsComplexPassword = Field_yesno_checkbox('AsComplexPassword', $HashPrivieleges["AsComplexPassword"]); $AllowAddGroup = Field_yesno_checkbox('AllowAddGroup', $HashPrivieleges["AllowAddGroup"]); $RestrictNabToGroups = Field_yesno_checkbox('RestrictNabToGroups', $HashPrivieleges["RestrictNabToGroups"]); $AsDansGuardianAdministrator = Field_yesno_checkbox('AsDansGuardianAdministrator', $HashPrivieleges["AsDansGuardianAdministrator"]); $AsWebFilterRepository = Field_yesno_checkbox('AsWebFilterRepository', $HashPrivieleges["AsWebFilterRepository"]); $AsWebStatisticsAdministrator = Field_yesno_checkbox('AsWebStatisticsAdministrator', $HashPrivieleges["AsWebStatisticsAdministrator"]); $AllowUserMaillog = Field_yesno_checkbox('AsWebStatisticsAdministrator', $HashPrivieleges["AllowUserMaillog"]); $AsProxyMonitor = Field_yesno_checkbox('AsProxyMonitor', $HashPrivieleges["AsProxyMonitor"]); $AsPostfixAdministrator = Field_yesno_checkbox('AsPostfixAdministrator', $HashPrivieleges["AsPostfixAdministrator"]); $AsSquidAdministrator = Field_yesno_checkbox('AsSquidAdministrator', $HashPrivieleges["AsSquidAdministrator"]); $AsMailBoxAdministrator = Field_yesno_checkbox('AsMailBoxAdministrator', $HashPrivieleges["AsMailBoxAdministrator"]); $AllowViewStatistics = Field_yesno_checkbox('AllowViewStatistics', $HashPrivieleges["AllowViewStatistics"]); $AllowEditOuSecurity = Field_yesno_checkbox('AllowEditOuSecurity', $HashPrivieleges["AllowEditOuSecurity"]); $AsHotSpotManager = Field_yesno_checkbox('AsHotSpotManager', $HashPrivieleges["AsHotSpotManager"]); $AsOwnMailBoxBackup = Field_yesno_checkbox('AsOwnMailBoxBackup', $HashPrivieleges["AsOwnMailBoxBackup"]); $AsOrgDNSAdmin = Field_yesno_checkbox('AsOrgDNSAdmin', $HashPrivieleges["AsOrgDNSAdmin"]); $ASDCHPAdmin = Field_yesno_checkbox('ASDCHPAdmin', $HashPrivieleges["ASDCHPAdmin"]); if ($priv->SAMBA_INSTALLED) { $VirtualSambaServerColor = "#B3B3B3"; $VirtualSambaServerHidden = "<input type='hidden' id='VirtualSambaServer', value='{$HashPrivieleges["VirtualSambaServer"]}'><span style='font-size:13.5px'>{$HashPrivieleges["VirtualSambaServer"]}</span>"; $VirtualSambaServer = $VirtualSambaServerHidden; if ($EnableSambaVirtualsServers == 1) { $q = new mysql(); $sql = "SELECT hostname FROM samba_hosts WHERE ou='{$ou}'"; $results = $q->QUERY_SQL($sql, "artica_backup"); if (mysql_num_rows($results) == 0) { $VirtualSambaServerError = "{no_server_for_this_ou}:{$ou}"; } if (!$q->ok) { $VirtualSambaServerError = $q->mysql_error; } $SAMBAHOSTS[null] = "{select}"; while ($ligne = mysql_fetch_assoc($results)) { $SAMBAHOSTS[$ligne["hostname"]] = $ligne["hostname"]; } $VirtualSambaServerField = Field_array_Hash($SAMBAHOSTS, "VirtualSambaServer", $HashPrivieleges["VirtualSambaServer"], null, null, 0, "font-size:11px"); } } if ($priv->POSTFIX_INSTALLED) { if ($EnablePostfixMultiInstance == 1) { $q = new mysql(); if (!class_exists("maincf_multi")) { include_once dirname(__FILE__) . "/ressources/class.maincf.multi.inc"; } $sql = "SELECT `value`,ip_address FROM postfix_multi WHERE `ou`='{$ou}' AND `key`='myhostname'"; $results = $q->QUERY_SQL($sql, "artica_backup"); if (!$q->ok) { $VirtualPostfixError = $q->mysql_error; } $PostfixInstances[null] = "{select}"; if (mysql_num_rows($results) > 0) { while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { $main = new maincf_multi($ligne["value"], $ou); $servername = $ligne["value"]; $VirtualHostNameToChange = $main->GET("VirtualHostNameToChange"); $servernameTEXT = $servername; if ($VirtualHostNameToChange != null) { $servernameTEXT = $VirtualHostNameToChange; } $PostfixInstances[$servername] = $servernameTEXT; } $VirtualPostfixFieldColor = "#B3B3B3"; $VirtualPostfixHidden = "<input type='hidden' id='PostfixInstance', value='{$HashPrivieleges["PostfixInstance"]}'><span style='font-size:13.5px'>{$HashPrivieleges["PostfixInstance"]}</span>"; $VirtualPostfixField = Field_array_Hash($PostfixInstances, "PostfixInstance", $HashPrivieleges["PostfixInstance"], null, null, 0, "font-size:11px"); $VirtualPostfix = $VirtualPostfixHidden; } else { $VirtualPostfixError = "{no_instance}:{$ou}"; } } else { $VirtualPostfixError = "{feature_disabled}"; } } if ($priv->AllowAddUsers == false) { $AllowAddUsers = "<img src='img/status_critical.png'>" . Field_hidden('AllowAddUsers', $HashPrivieleges["AllowAddUsers"]); $AsDansGuardianGroupRule = "<img src='img/status_critical.png'>" . Field_hidden('AsDansGuardianGroupRule', $HashPrivieleges["AsDansGuardianGroupRule"]); $AsMessagingOrg = "<img src='img/status_critical.png'>" . Field_hidden('AsMessagingOrg', $HashPrivieleges["AsMessagingOrg"]); $AsOrgAdmin = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgAdmin', $HashPrivieleges["AsOrgAdmin"]); $AsJoomlaWebMaster = "<img src='img/status_critical.png'>" . Field_hidden('AsJoomlaWebMaster', $HashPrivieleges["AsJoomlaWebMaster"]); $AsVirtualBoxManager = "<img src='img/status_critical.png'>" . Field_hidden('AsVirtualBoxManager', $HashPrivieleges["AsVirtualBoxManager"]); $AsComplexPassword = "******" . Field_hidden('AsComplexPassword', $HashPrivieleges["AsComplexPassword"]); $RestrictNabToGroups = "<img src='img/status_critical.png'>" . Field_hidden('RestrictNabToGroups', $HashPrivieleges["RestrictNabToGroups"]); $AsWebFilterRepository = "<img src='img/status_critical.png'>" . Field_hidden('AsWebFilterRepository', $HashPrivieleges["AsWebFilterRepository"]); $AsWebStatisticsAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsWebStatisticsAdministrator', $HashPrivieleges["AsWebStatisticsAdministrator"]); } if ($priv->AsArticaAdministrator == false) { $AsArticaAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsArticaAdministrator', $HashPrivieleges["AsArticaAdministrator"]); $AsSambaAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsSambaAdministrator', $HashPrivieleges["AsSambaAdministrator"]); $AsDnsAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsDnsAdministrator', $HashPrivieleges["AsDnsAdministrator"]); $AsQuarantineAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsQuarantineAdministrator', $HashPrivieleges["AsQuarantineAdministrator"]); $AsOrgStorageAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgStorageAdministrator', $HashPrivieleges["AsOrgStorageAdministrator"]); $AsOrgPostfixAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgPostfixAdministrator', $HashPrivieleges["AsOrgPostfixAdministrator"]); $AsDansGuardianGroupRule = "<img src='img/status_critical.png'>" . Field_hidden('AsDansGuardianGroupRule', $HashPrivieleges["AsDansGuardianGroupRule"]); $AsMessagingOrg = "<img src='img/status_critical.png'>" . Field_hidden('AsMessagingOrg', $HashPrivieleges["AsMessagingOrg"]); $AsOrgAdmin = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgAdmin', $HashPrivieleges["AsOrgAdmin"]); $AsInventoryAdmin = "<img src='img/status_critical.png'>" . Field_hidden('AsInventoryAdmin', $HashPrivieleges["AsInventoryAdmin"]); $AsVirtualBoxManager = "<img src='img/status_critical.png'>" . Field_hidden('AsVirtualBoxManager', $HashPrivieleges["AsVirtualBoxManager"]); $OverWriteRestrictedDomains = "<img src='img/status_critical.png'>" . Field_hidden('OverWriteRestrictedDomains', $HashPrivieleges["OverWriteRestrictedDomains"]); $AsDansGuardianAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsDansGuardianAdministrator', $HashPrivieleges["AsDansGuardianAdministrator"]); $AsWebFilterRepository = "<img src='img/status_critical.png'>" . Field_hidden('AsWebFilterRepository', $HashPrivieleges["AsWebFilterRepository"]); $AsWebStatisticsAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsWebStatisticsAdministrator', $HashPrivieleges["AsWebStatisticsAdministrator"]); $AsPostfixAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsPostfixAdministrator', $HashPrivieleges["AsPostfixAdministrator"]); $AsSquidAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsSquidAdministrator', $HashPrivieleges["AsSquidAdministrator"]); $AsMailBoxAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsMailBoxAdministrator', $HashPrivieleges["AsMailBoxAdministrator"]); $AllowViewStatistics = "<img src='img/status_critical.png'>" . Field_hidden('AllowViewStatistics', $HashPrivieleges["AllowViewStatistics"]); $AllowEditOuSecurity = "<img src='img/status_critical.png'>" . Field_hidden('AllowEditOuSecurity', $HashPrivieleges["AllowEditOuSecurity"]); $AsHotSpotManager = "<img src='img/status_critical.png'>" . Field_hidden('AsHotSpotManager', $HashPrivieleges["AsHotSpotManager"]); $ASDCHPAdmin = "<img src='img/status_critical.png'>" . Field_hidden('ASDCHPAdmin', $HashPrivieleges["ASDCHPAdmin"]); } if (!$priv->AsOrgAdmin) { $AsWebMaster = "<img src='img/status_critical.png'>" . Field_hidden('AsWebMaster', $HashPrivieleges["AsWebMaster"]); } if (!$priv->AsProxyMonitor) { $AsProxyMonitor = "<img src='img/status_critical.png'>" . Field_hidden('AsProxyMonitor', $HashPrivieleges["AsProxyMonitor"]); } if ($priv->AllowAddGroup == false) { $AllowAddGroup = "<img src='img/status_critical.png'>" . Field_hidden('AllowAddGroup', $HashPrivieleges["AllowAddGroup"]); $AsDansGuardianGroupRule = "<img src='img/status_critical.png'>" . Field_hidden('AsDansGuardianGroupRule', $HashPrivieleges["AsDansGuardianGroupRule"]); $AsMessagingOrg = "<img src='img/status_critical.png'>" . Field_hidden('AsMessagingOrg', $HashPrivieleges["AsMessagingOrg"]); $AsOrgAdmin = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgAdmin', $HashPrivieleges["AsOrgAdmin"]); $AsInventoryAdmin = "<img src='img/status_critical.png'>" . Field_hidden('AsInventoryAdmin', $HashPrivieleges["AsInventoryAdmin"]); $AsJoomlaWebMaster = "<img src='img/status_critical.png'>" . Field_hidden('AsJoomlaWebMaster', $HashPrivieleges["AsJoomlaWebMaster"]); $AsVirtualBoxManager = "<img src='img/status_critical.png'>" . Field_hidden('AsVirtualBoxManager', $HashPrivieleges["AsVirtualBoxManager"]); $AsDansGuardianAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsDansGuardianAdministrator', $HashPrivieleges["AsDansGuardianAdministrator"]); $AsWebFilterRepository = "<img src='img/status_critical.png'>" . Field_hidden('AsWebFilterRepository', $HashPrivieleges["AsWebFilterRepository"]); } if ($priv->AllowChangeDomains == false) { $AllowChangeDomains = "<img src='img/status_critical.png'>" . Field_hidden('AllowChangeDomains', $HashPrivieleges["AllowChangeDomains"]); } if ($priv->AsSystemAdministrator == false) { $AsSystemAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsSystemAdministrator', $HashPrivieleges["AsSystemAdministrator"]); } if ($priv->AsDnsAdministrator == false) { $AsDnsAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsDnsAdministrator', $HashPrivieleges["AsDnsAdministrator"]); } if ($priv->AsQuarantineAdministrator == false) { $AsQuarantineAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsQuarantineAdministrator', $HashPrivieleges["AsQuarantineAdministrator"]); } if ($priv->AsOrgStorageAdministrator == false) { $AsOrgStorageAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgStorageAdministrator', $HashPrivieleges["AsOrgStorageAdministrator"]); } if ($priv->AsOrgPostfixAdministrator == false) { $AsOrgPostfixAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgPostfixAdministrator', $HashPrivieleges["AsOrgPostfixAdministrator"]); } if ($priv->AsMessagingOrg == false) { $AsMessagingOrg = "<img src='img/status_critical.png'>" . Field_hidden('AsMessagingOrg', $HashPrivieleges["AsMessagingOrg"]); } if ($priv->AsOrgAdmin == false) { $AsOrgAdmin = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgAdmin', $HashPrivieleges["AsOrgAdmin"]); } if ($priv->AsInventoryAdmin == false) { $AsInventoryAdmin = "<img src='img/status_critical.png'>" . Field_hidden('AsInventoryAdmin', $HashPrivieleges["AsInventoryAdmin"]); } if ($priv->AsJoomlaWebMaster == false) { $AsJoomlaWebMaster = "<img src='img/status_critical.png'>" . Field_hidden('AsJoomlaWebMaster', $HashPrivieleges["AsJoomlaWebMaster"]); } if ($priv->AsVirtualBoxManager == false) { $AsVirtualBoxManager = "<img src='img/status_critical.png'>" . Field_hidden('AsVirtualBoxManager', $HashPrivieleges["AsVirtualBoxManager"]); } if ($priv->AsDansGuardianAdministrator == false) { $AsVirtualBoxManager = "<img src='img/status_critical.png'>" . Field_hidden('AsDansGuardianAdministrator', $HashPrivieleges["AsDansGuardianAdministrator"]); } if ($priv->AsWebFilterRepository == false) { $AsWebFilterRepository = "<img src='img/status_critical.png'>" . Field_hidden('AsWebFilterRepository', $HashPrivieleges["AsWebFilterRepository"]); } if ($priv->AsWebStatisticsAdministrator == false) { $AsWebStatisticsAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsWebStatisticsAdministrator', $HashPrivieleges["AsWebStatisticsAdministrator"]); } if ($priv->AllowUserMaillog == false) { $AllowUserMaillog = "<img src='img/status_critical.png'>" . Field_hidden('AllowUserMaillog', $HashPrivieleges["AllowUserMaillog"]); } if ($priv->AllowEditOuSecurity == false) { $AllowEditOuSecurity = "<img src='img/status_critical.png'>" . Field_hidden('AllowEditOuSecurity', $HashPrivieleges["AllowEditOuSecurity"]); } if ($priv->AsMailManAdministrator == false) { $AsMailManAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsMailManAdministrator', $HashPrivieleges["AsMailManAdministrator"]); } if ($priv->AsPostfixAdministrator == false) { $AsPostfixAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsPostfixAdministrator', $HashPrivieleges["AsPostfixAdministrator"]); } if ($priv->AsSquidAdministrator == false) { $AsSquidAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsSquidAdministrator', $HashPrivieleges["AsSquidAdministrator"]); } if ($priv->AsMailBoxAdministrator == false) { $AsMailBoxAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsMailBoxAdministrator', $HashPrivieleges["AsMailBoxAdministrator"]); } if ($priv->AllowViewStatistics == false) { $AllowViewStatistics = "<img src='img/status_critical.png'>" . Field_hidden('AllowViewStatistics', $HashPrivieleges["AllowViewStatistics"]); } if ($priv->AllowEditOuSecurity == false) { $AllowEditOuSecurity = "<img src='img/status_critical.png'>" . Field_hidden('AllowEditOuSecurity', $HashPrivieleges["AllowEditOuSecurity"]); } if ($priv->AsWebMaster == false) { $AsWebMaster = "<img src='img/status_critical.png'>" . Field_hidden('AsWebMaster', $HashPrivieleges["AsWebMaster"]); } if ($priv->AsSystemWebMaster == false) { $AsSystemWebMaster = "<img src='img/status_critical.png'>" . Field_hidden('AsSystemWebMaster', $HashPrivieleges["AsSystemWebMaster"]); } if ($priv->AllowChangeDomains == false) { $AllowChangeDomains = "<img src='img/status_critical.png'>" . Field_hidden('AllowChangeDomains', $HashPrivieleges["AllowChangeDomains"]); } if ($priv->AsOrgPostfixAdministrator == false) { $AsOrgPostfixAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgPostfixAdministrator', $HashPrivieleges["AsOrgPostfixAdministrator"]); } if ($priv->AsOrgStorageAdministrator == false) { $AsOrgStorageAdministrator = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgStorageAdministrator', $HashPrivieleges["AsOrgStorageAdministrator"]); } if ($priv->OverWriteRestrictedDomains == false) { $OverWriteRestrictedDomains = "<img src='img/status_critical.png'>" . Field_hidden('OverWriteRestrictedDomains', $HashPrivieleges["OverWriteRestrictedDomains"]); } if ($priv->AsHotSpotManager == false) { $AsHotSpotManager = "<img src='img/status_critical.png'>" . Field_hidden('AsHotSpotManager', $HashPrivieleges["AsHotSpotManager"]); } if ($priv->AsOrgDNSAdmin == false) { $AsOrgDNSAdmin = "<img src='img/status_critical.png'>" . Field_hidden('AsOrgDNSAdmin', $HashPrivieleges["AsOrgDNSAdmin"]); } if ($priv->ASDCHPAdmin == false) { $ASDCHPAdmin = "<img src='img/status_critical.png'>" . Field_hidden('ASDCHPAdmin', $HashPrivieleges["ASDCHPAdmin"]); } if ($priv->AsOrgAdmin) { $VirtualSambaServerColor = "black"; $VirtualSambaServer = $VirtualSambaServerField; $VirtualPostfix = $VirtualPostfixField; $VirtualPostfixFieldColor = "black"; } $group_allow = " {groups_allow}</H3><br>\n<div style='width:98%' class=form>\n\t\t<table>\n\t\t\n\t\t\t<tr>\n\t\t\t\t<td align='right'><span style='font-size:13.5px'>{AllowAddUsers}:</span></td><td>{$AllowAddUsers}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td align='right'><span style='font-size:13.5px'>{AsDansGuardianGroupRule}:</span></td><td>{$AsDansGuardianGroupRule}</td>\n\t\t\t</tr>\t\t\t\n\t\t\t\t\t\n\t\t\t\n\t\t</table></div>\n"; $user_allow = " {users_allow}</H3><br>\n\t\t<div style='width:98%' class=form>\n\t\t\t\t\t<table>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowChangeAntiSpamSettings}:</span></td><td>" . Field_yesno_checkbox('AllowChangeAntiSpamSettings', $HashPrivieleges["AllowChangeAntiSpamSettings"]) . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowChangeUserPassword}:</span></td><td>" . Field_yesno_checkbox('AllowChangeUserPassword', $HashPrivieleges["AllowChangeUserPassword"]) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsComplexPassword}:</span></td><td>{$AsComplexPassword}</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowFetchMails}:</span></td><td>" . Field_yesno_checkbox('AllowFetchMails', $HashPrivieleges["AllowFetchMails"]) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowUserMaillog}:</span></td><td>" . Field_yesno_checkbox('AllowUserMaillog', $HashPrivieleges["AllowUserMaillog"]) . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsOwnMailBoxBackup}:</span></td><td>" . Field_yesno_checkbox('AsOwnMailBoxBackup', $HashPrivieleges["AsOwnMailBoxBackup"]) . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowChangeUserKas}:</span></td><td>" . Field_yesno_checkbox('AllowChangeUserKas', $HashPrivieleges["AllowChangeUserKas"]) . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowEditAliases}:</span></td><td>" . Field_yesno_checkbox('AllowEditAliases', $HashPrivieleges["AllowEditAliases"]) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowChangeMailBoxRules}:</span></td><td>" . Field_yesno_checkbox('AllowChangeMailBoxRules', $HashPrivieleges["AllowChangeMailBoxRules"]) . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowSender_canonical}:</span></td><td>" . Field_yesno_checkbox('AllowSenderCanonical', $HashPrivieleges["AllowSenderCanonical"]) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowOpenVPN}:</span></td><td>" . Field_yesno_checkbox('AllowOpenVPN', $HashPrivieleges["AllowOpenVPN"]) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowDansGuardianBanned}:</span></td><td>" . Field_yesno_checkbox('AllowDansGuardianBanned', $HashPrivieleges["AllowDansGuardianBanned"]) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowXapianDownload}:</span></td><td>" . Field_yesno_checkbox('AllowXapianDownload', $HashPrivieleges["AllowXapianDownload"]) . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowManageOwnComputers}:</span></td><td>" . Field_yesno_checkbox('AllowManageOwnComputers', $HashPrivieleges["AllowManageOwnComputers"]) . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsJoomlaWebMaster}:</span></td><td>" . Field_yesno_checkbox('AsJoomlaWebMaster', $HashPrivieleges["AsJoomlaWebMaster"]) . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{RestrictNabToGroups}:</span></td>\n\t\t\t\t\t\t<td>{$RestrictNabToGroups}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowEditAsWbl}:</span></td><td>" . Field_yesno_checkbox('AllowEditAsWbl', $HashPrivieleges["AllowEditAsWbl"]) . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t</table></div>"; $org_allow = " {organization_allow}</H3><br>\n<div style='width:98%' class=form>\n<table >\t\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsOrgAdmin}:</span></td>\n\t\t<td>{$AsOrgAdmin}</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsMessagingOrg}:</span></td>\n\t\t<td>{$AsMessagingOrg}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AllowEditOuSecurity}:</span></td>\n\t\t<td>{$AllowEditOuSecurity}</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsOrgPostfixAdministrator}:</span></td>\n\t\t<td>{$AsOrgPostfixAdministrator}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsQuarantineAdministrator}:</span></td>\n\t\t<td>{$AsQuarantineAdministrator}</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsMailManAdministrator}:</span></td>\n\t\t<td>{$AsMailManAdministrator}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px'>{OverWriteRestrictedDomains}:</span></td>\n\t\t<td>{$OverWriteRestrictedDomains}</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsOrgStorageAdministrator}:</span></td>\n\t\t<td>{$AsOrgStorageAdministrator}</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsWebMaster}:</span></td>\n\t\t<td>{$AsWebMaster}</td>\n\t</tr>\n\n\t\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px;color:{$VirtualSambaServerColor}'>{file_sharing_server}:</span></td>\n\t\t<td>{$VirtualSambaServer}<div>{$VirtualSambaServerError}</div></td>\n\t</tr>\t\n\t<tr>\n\t\t<td align='right' nowrap><span style='font-size:13.5px;color:{$VirtualPostfixFieldColor}'>{postfix_instance}:</span></td>\n\t\t<td>{$VirtualPostfix}<div><div>{$VirtualPostfixError}</div></td>\n\t</tr>\t\n\t<tr>\n\t\t<td align='right'><span style='font-size:13.5px'>{AsOrgDNSAdmin}:</span></td><td>{$AsOrgDNSAdmin}</td>\n\t</tr>\t\t\t\n\t<tr>\n\t\t<td align='right'><span style='font-size:13.5px'>{AllowChangeDomains}:</span></td><td>{$AllowChangeDomains}</td>\n\t</tr>\t\n</table></div>\t\t\t\t\t\n"; $admin_allow = " {administrators_allow}</H3><br>\n<div style='width:98%' class=form>\n<table>\n\t\t\t\t\n\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=2><strong style='font-size:16px'>Proxy</strong></td>\t\t\t\t\t\t\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsSquidAdministrator}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsSquidAdministrator}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsDansGuardianAdministrator}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsDansGuardianAdministrator}</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right'><span style='font-size:13.5px'>{AsHotSpotManager}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsHotSpotManager}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right'><span style='font-size:13.5px'>{AsProxyMonitor}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsProxyMonitor}</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsWebStatisticsAdministrator}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsWebStatisticsAdministrator}</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsWebFilterRepository}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsWebFilterRepository}</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=2><strong style='font-size:16px'>{messaging}</strong></td>\t\t\t\t\t\t\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsPostfixAdministrator}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsPostfixAdministrator}</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsMailBoxAdministrator}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsMailBoxAdministrator}</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=2><strong style='font-size:16px'>{system}</td>\t\t\t\t\t\t\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsArticaAdministrator}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsArticaAdministrator}</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsSystemAdministrator}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsSystemAdministrator}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsWebMaster}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsSystemWebMaster}</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{ASDCHPAdmin}:</span></td>\n\t\t\t\t\t\t\t<td>{$ASDCHPAdmin}</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsDnsAdministrator}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsDnsAdministrator}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsSambaAdministrator}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsSambaAdministrator}</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsInventoryAdmin}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsInventoryAdmin}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><span style='font-size:13.5px'>{AsVirtualBoxManager}:</span></td>\n\t\t\t\t\t\t\t<td>{$AsVirtualBoxManager}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' nowrap><strong style='font-size:13.5px'>{AllowViewStatistics}:</span></td>\n\t\t\t\t\t\t\t<td>{$AllowViewStatistics}</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t</table></div>"; $sufform = $_GET["tab"]; switch ($_GET["tab"]) { case "G": $g = $group_allow; break; case "U": $g = $user_allow; break; case "A": $g = $admin_allow; break; case "O": $g = $org_allow; break; default: $g = $user_allow; break; } $t = time(); $page = CurrentPageName(); $BigButton = button("{apply}", "EditGroupPrivileges()", "16px"); if ($RemoveButton) { $BigButton = null; } $html = "\n\t{$div1}\n\t{$warn}\n\t<div id='{$t}-div'></div>\n\t<div style='padding:20px' >\n\t<form name='{$sufform}_priv'>\n\t\t{$organization_hidden}\n\t\t<input type='hidden' name='PrivilegesGroup' value='{$gid}'><br>\n\t\t<H3>{$title_form}»\n\t\t{$g}\n\t\t\n\t\t</form>\n\t\t<div style='text-align:right;'>{$BigButton}</div>\n\n\t\t</div>{$div2}\n\n\t\t<script>\n\t\t\nvar x_EditGroupPrivileges{$t}= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\tdocument.getElementById('{$t}-div').innerHTML='';\n\t}\n\t\t\n\tfunction EditGroupPrivileges(){\n\t\t\n\t\tvar XHR=ParseForm('{$sufform}_priv','{$page}',true,false,true);\n\t\tif(document.getElementById('groupprivileges')){document.getElementById('groupprivileges').innerHTML='';}\n\t\tAnimateDiv('{$t}-div');\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_EditGroupPrivileges{$t});\n\t}\n\t\t\n\t\tfunction CheckHasOrgAdmin(){\n\t\t\tCheckAsMessagingOrg();\t\n\t\t\tif(!document.getElementById('AsOrgAdmin')){return;}\t\t\n\n\t\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tfunction CheckAsMessagingOrg(){\n\t\t\tif(!document.getElementById('AsMessagingOrg')){return;}\n\t\t\tif(document.getElementById('AsMessagingOrg').checked){\n\t\t\t\tdocument.getElementById('AsQuarantineAdministrator').disabled=true;\n\t\t\t\tdocument.getElementById('AsMailManAdministrator').disabled=true;\n\t\t\t\tdocument.getElementById('AllowChangeDomains').disabled=true;\n\t\t\t\tCheckAsOrgPostfixAdministrator();\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('AsQuarantineAdministrator').disabled=false;\n\t\t\t\tdocument.getElementById('AsMailManAdministrator').disabled=false;\n\t\t\t\tdocument.getElementById('AllowChangeDomains').disabled=false;\t\t\t\n\t\t\t\tCheckAsOrgPostfixAdministrator();\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\tfunction CheckAsOrgPostfixAdministrator(){\n\t\t\tif(document.getElementById('AsOrgPostfixAdministrator').checked){\n\t\t\t\tdocument.getElementById('OverWriteRestrictedDomains').disabled=true;\n\t\t\t\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('OverWriteRestrictedDomains').disabled=false;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tCheckHasOrgAdmin();\n\t\t</script>\n\t\t\n\t\t"; $tpl = new templates(); return $tpl->_ENGINE_parse_body($html); }
function AddCachedSitelist_popup() { $option[null] = "---------"; $option["override-lastmod"] = "override-lastmod"; $option["override-expire"] = "override-expire"; $option["reload-into-ims"] = "reload-into-ims"; $option["override-expire ignore-no-cache ignore-no-store ignore-private"] = "{ignore_all}"; $option["ignore-reload"] = "ignore-reload"; $option["reload-into-ims ignore-no-cache"] = "reload-into-ims+ignore-no-cache"; if ($_GET["id"] > 0) { $sql = "SELECT * FROM squid_speed WHERE ID={$_GET["id"]}"; $q = new mysql(); $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); $domain = $ligne["domain"]; $pourc = $ligne["refresh_pattern_perc"]; $refresh_pattern_min = $ligne["refresh_pattern_min"]; $refresh_pattern_max = $ligne["refresh_pattern_max"]; $refresh_pattern_option = $ligne["refresh_pattern_options"]; } $refresh_pattern_opt = Field_array_Hash($option, "refresh_pattern_option", $refresh_pattern_option, null, null, 0, "font-size:13px;padding:3px"); $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'><img src='img/windows-internet-128.png'></td>\n\t<td valign='top'>\n\t<div id='AddCachedSitelistDiv'>\n\t" . Field_hidden("id", "{$_GET["id"]}") . "\n\t<div style='font-size:13px;padding:5px'>{squid_refresh_pattern_explain}</div>\n\t<table style='width:99%'>\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{website_name}:</td>\n\t\t<td>" . Field_text("refresh_pattern_site", $domain, 'font-size:13px;padding:3px', null, null, null, false, "AddCachedSiteListCheckEnter(event)") . "</td>\n\t\t<td width=1%>" . help_icon("{refresh_pattern_site}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{minimal_time}:</td>\n\t\t<td style='font-size:13px'>" . Field_text("refresh_pattern_min", $refresh_pattern_min, 'width:45px;font-size:13px;padding:3px', null, null, null, false, "AddCachedSiteListCheckEnter(event)") . " Mn</td>\n\t\t<td width=1%>" . help_icon("{refresh_pattern_min}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{percentage}:</td>\n\t\t<td style='font-size:13px'>" . Field_text("refresh_pattern_pourc", $pourc, 'width:45px;font-size:13px;padding:3px', null, null, null, false, "AddCachedSiteListCheckEnter(event)") . " %</td>\n\t\t<td width=1%>" . help_icon("{refresh_pattern_pourc}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{maximal_time}:</td>\n\t\t<td style='font-size:13px'>" . Field_text("refresh_pattern_max", $refresh_pattern_max, 'width:45px;font-size:13px;padding:3px', null, null, null, false, "AddCachedSiteListCheckEnter(event)") . " Mn</td>\n\t\t<td width=1%>" . help_icon("{refresh_pattern_max}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:13px'>{option}:</td>\n\t\t<td style='font-size:13px'>{$refresh_pattern_opt}</td>\n\t\t<td width=1%>" . help_icon("{refresh_pattern_option}") . "</td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>\n\t\t\t" . button("{apply}", "AddCachedSitelistSave()") . "</td>\n\t</tr>\n\t</table>\t\t\n\t</div>\n\t</td>\n\t</tr>\n\t</table>\n\t<center><img src='img/refresh_pattern_graph.gif'></center>\n\t\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function PostFixBounceTemplate() { $template = $_GET['PostFixBounceTemplate']; $mny = new usersMenus(); $tpl = new templates(); $main = new main_cf(); $pages = new HtmlPages(); if ($mny->AsPostfixAdministrator == false) { echo $tpl->_ENGINE_parse_body('{no_privileges'); exit; } $html = "<H2 style='margin:2px'>{" . "{$template}}</H2>\n\t" . Field_hidden('bounce_template_type', $template) . "\n\t<form name='form_{$template}'>\n\t<input type='hidden' id='save_bounce_template' name='save_bounce_template' value='{$template}'>\n\t<textarea name='text' style='width:99%;height:190px;margin:5px'>{$main->bounce_templates[$template]}</textarea>\n\t<div style='text-align:right;padding-right:10px'><input type='button' value='{submit}»' OnClick=\"javascript:ParseForm('form_{$template}','tree.listener.postfix.php',true);\"></div>\n\t\t</form>\n\t<div class=caption>{bounce_messages_templates_infos}</div>\n\t\n\t"; echo DIV_SHADOW($html, 'windows'); }
function main_smb_config() { $style = "style='padding:3px;border-bottom:1px dotted #CCCCCC'"; $sock = new sockets(); $tpl = new templates(); $page = CurrentPageName(); $smb = new samba(); $ldap = new clladp(); $SambaEnabled = $sock->GET_INFO("SambaEnabled"); $EnableSambaActiveDirectory = $sock->GET_INFO("EnableSambaActiveDirectory"); if ($SambaEnabled == null) { $SambaEnabled = 1; } $users = new usersMenus(); $upTo36 = 0; $upTo357 = 0; $version = $smb->SAMBA_VERSION; if (preg_match("#^([0-9]+)\\.([0-9]+)\\.([0-9]+)#", $version, $re)) { $major = intval($re[1]); $minor = intval($re[2]); $build = intval($re[3]); } if ($major > 2) { if ($minor > 4) { if ($build > 6) { $upTo357 = 1; } } } if (preg_match("#^([0-9]+)\\.([0-9]+)#", $version, $re)) { $major = intval($re[1]); $minor = intval($re[2]); if ($major >= 3) { if ($minor >= 6) { $upTo36 = 1; $upTo357 = 1; } } } if ($SambaEnabled == 0) { $html = main_tabs() . "<br>\n\t\t\t\t<center style='margin:50px'>{$disable_samba}</center>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); exit; } $users = new usersMenus(); if ($_GET["hostname"] == null) { $hostname = $users->hostname; $_GET["hostname"] = $hostname; } else { $hostname = $_GET["hostname"]; } for ($i = 0; $i < 11; $i++) { $logh[$i] = $i; } if (!isset($_GET["remove-icons"])) { $disable_samba = Paragraphe("server-disable-64.png", '{enable_disable_samba}', '{enable_disable_samba_text}', "javascript:Loadjs('samba.disable.php');", '{enable_disable_samba_text}', 260, null, 1); $icon_samba_type = Paragraphe("64-server-ask.png", '{windows_network_neighborhood}', '{windows_network_neighborhood_text}', "javascript:Loadjs('samba.neighborhood.php');", '{windows_network_neighborhood}', 260, null, 1); $admin_domain = Paragraphe("members-priv-64.png", '{domain_admin}', '{domain_admin_text}', "javascript:DomainAdmin();", '{domain_admin_text}', 260, null, 1); $acl_support = Paragraphe("acl-support-64.png", '{ACLS_SUPPORT}', '{ACLS_SUPPORT_TEXT}', "javascript:Loadjs('samba.acls.settings.php');", '{ACLS_SUPPORT_TEXT}', 260, null, 1); $restart = Paragraphe("64-refresh.png", '{APP_SAMBA_RESTART}', '{APP_SAMBA_RESTART_TEXT}', "javascript:RestartSmbServices();", '{APP_SAMBA_RESTART_TEXT}', 260, null, 1); } $enable_Editposix = $tpl->_ENGINE_parse_body("{enable_Editposix}") . ':'; $enable_Editposix = html_entity_decode($enable_Editposix); if (strlen($enable_Editposix) > 37) { $enable_Editposix = texttooltip(htmlentities(substr($enable_Editposix, 0, 35)) . '...:', htmlentities($enable_Editposix)); } $t = time(); $after_post_func = "x_SaveSambaMainConfiguration{$t}"; $after_post = "x_SaveSambaMainConfiguration"; $styleTD = "font-size:13px;"; $styleFieldWith = 190; if (isset($_GET["expanded"])) { $styleTD = "font-size:16px"; $styleFieldWith = 290; $explain = "\n\t\t\t<div style='font-size:22px'>{SAMBA_MAIN_PARAMS}</div>\n\t\t\t<div style='font-size:16px' class=explain>{SAMBA_MAIN_PARAMS_TEXT}</div>"; $global_parameters_icon = Paragraphe('parameters2-64.png', "{SAMBA_MAIN_PARAMS}", '{SAMBA_MAIN_PARAMS_TEXT}', "javascript:Loadjs('samba.index.php?main-params-js=yes')"); $after_post = "x_SaveSambaMainConfiguration{$t}"; } $domain_master = "\n<tr>\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{local master}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_checkbox('local master', 'yes', $smb->main_array["global"]["local master"]) . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{local master_text}") . "</td>\n</tr>\t\t\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{domain logons}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_checkbox('domain logons', 'yes', $smb->main_array["global"]["domain logons"]) . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{domain logons_text}") . "</td>\n</tr>\n<tr>\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{domain master}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_array_Hash(array("no" => "{no}", "yes" => "{yes}", "auto" => "{auto}"), "domain master", $smb->main_array["global"]["domain master"], null, null, 0, "width:100px;{$styleTD};padding:3px") . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{domain master_text}") . "</td>\n</tr>"; if ($smb->SambaEnableEditPosixExtension == 1) { $smb->SambaEnableEditPosixExtension = "yes"; } if ($EnableSambaActiveDirectory == 1) { $workgroup_disabled = true; $domain_master = "\n<tr>\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{local master}:</td>\n\t<td valign='top' style='{$styleTD}'>--" . Field_hidden("local master", "{$smb->main_array["global"]["local master"]}") . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{local master_text}") . "</td>\n</tr>\t\t\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{domain logons}:</td>\n\t<td valign='top' style='{$styleTD}'>--" . Field_hidden("domain logons", "{$smb->main_array["global"]["domain logons"]}") . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{domain logons_text}") . "</td>\n</tr>\t\t\n<tr>\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{domain master}:</td>\n\t<td valign='top' style='{$styleTD}'>--" . Field_hidden("domain master", "{$smb->main_array["global"]["domain master"]}") . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{domain master_text}") . "</td>\n</tr>"; } $log_level = Field_array_Hash($logh, 'log level', $smb->main_array["global"]["log level"], null, null, 0, "width:90px;{$styleTD}"); $form1 = "\n\t<input type='hidden' name='SaveGeneralSettings' id='SaveGeneralSettings' value='yes'>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n<tr>\n\t<td align='right' nowrap valign='top' class=legend class=legend style='{$styleTD}'>SID:</td>\n\t<td valign='top'><strong style='{$styleTD}'>" . $ldap->LOCAL_SID() . "</strong></td>\n\t<td valign='top' style='{$styleTD}'><div style='padding-right:3px;'>" . imgtootltip("icon_edit.gif", "{CHANGE_SID_TEXT}", "Loadjs('samba.sid.php')", 'right') . "</div></td>\n\t</tr>\n<tr>\n\n\t\n<tr>\n\t<td align='right' nowrap valign='top' class=legend class=legend style='{$styleTD}'>{workgroup}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_text("workgroup", $smb->main_array["global"]["workgroup"], "width:{$styleFieldWith}px;{$styleTD};padding:3px", null, null, null, false, null, $workgroup_disabled) . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{workgroup_text}") . "</td>\n\t</tr>\n<tr>\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{netbiosname}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_text("netbiosname", $smb->main_array["global"]["netbios name"], "width:{$styleFieldWith}px;{$styleTD};padding:3px") . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{netbiosname_text}") . "</td>\n</tr>\t\n<tr>\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{server string}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_text("server string", $smb->main_array["global"]["server string"], "width:{$styleFieldWith};{$styleTD};padding:3px") . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{server string_text}") . "</td>\n</tr>\t\n\t\n\t\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{disable netbios}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_checkbox('disable netbios', 'yes', $smb->main_array["global"]["disable netbios"]) . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{disable netbios_text}") . "</td>\n</tr>\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{$enable_Editposix}</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_checkbox('enable_Editposix', 'yes', $smb->SambaEnableEditPosixExtension) . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{enable_Editposix_text}") . "</td>\n</tr>\n\n\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{log level}:</td>\n\t<td valign='top' style='{$styleTD}'>{$log_level}</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{log level_text}") . "</td>\n</tr>\n<tr>\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'> </td>\n\t<td colspan=2 style='{$styleTD}'><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('samba.options.php?hostname=master');\"\n\tstyle='{$styleTD};text-decoration:underline;font-style:italic'>{file_sharing_behavior}</a></td>\n</tr>\n\n\n\t<tr>\n\t<td colspan=3 align='right' valign='top'>\n\t<hr>\n\t" . button("{apply}", "SaveSambaMainConfiguration()", "16px") . "</td>\n\t</tr>\n</table>\n</div>\n"; $users = new usersMenus(); $sock = new sockets(); $AsWinbindd = 0; $cups_installed = 0; if ($users->WINBINDD_INSTALLED) { $winbindd = "status_ok.png"; $AsWinbindd = 1; } else { $winbindd = "status_critical.png"; } if ($users->CUPS_INSTALLED) { $cups_installed = 1; } $TypeOfSamba = $sock->GET_INFO("TypeOfSamba"); if (!is_numeric($TypeOfSamba)) { $TypeOfSamba = 1; } $form2 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{winbindd_installed}:</td>\n\t<td valign='top' style='{$styleTD}'><img src='img/{$winbindd}'></td>\n\t<td valign='top' style='{$styleTD}'> </td>\n</tr>\t\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{disable_winbindd}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_checkbox('DisableWinbindd', '1', $sock->GET_INFO('DisableWinbindd')) . "</td>\n\t<td valign='top' style='{$styleTD}'> </td>\n</tr>\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{client_ntlmv2_auth}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_checkbox('client_ntlmv2_auth', '1', $smb->client_ntlmv2_auth) . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{client_ntlmv2_auth_text}") . "</td>\n</tr>\n\n\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{EnablePrintersSharing}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_checkbox('EnablePrintersSharing', '1', $sock->GET_INFO('EnablePrintersSharing')) . "</td>\n\t<td valign='top' style='{$styleTD}'> </td>\n</tr>\n\n\n\n{$domain_master}\n\t\n\n\n\t\n<tr>\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{os level}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_text("os level", $smb->main_array["global"]["os level"], "width:60px;{$styleTD};padding:3px") . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{os level_text}") . "</td>\n</tr>\n\t\t\n\n\t\t\n\t<tr>\n\t<td colspan=3 align='right' valign='top' >\n\t<hr>\n\t" . button("{apply}", "SaveSambaMainConfiguration()", "16px") . "</td>\n\t</tr>\n\n\t</table></div>\n\t"; $sock = new sockets(); $ArticaSambaAutomAskCreation = $sock->GET_INFO("ArticaSambaAutomAskCreation"); $HomeDirectoriesMask = $sock->GET_INFO("HomeDirectoriesMask"); $SharedFoldersDefaultMask = $sock->GET_INFO("SharedFoldersDefaultMask"); if (!is_numeric($ArticaSambaAutomAskCreation)) { $ArticaSambaAutomAskCreation = 1; } if (!is_numeric($HomeDirectoriesMask)) { $HomeDirectoriesMask = "0775"; } if (!is_numeric($SharedFoldersDefaultMask)) { $SharedFoldersDefaultMask = "0755"; } $formArtica = "\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n<tr>\t\n\t<td align='right' nowrap valign='top' class=legend style='{$styleTD}'>{enable_automask_creation}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_checkbox('ArticaSambaAutomAskCreation', '1', $ArticaSambaAutomAskCreation) . "</td>\n\t<td valign='top' style='{$styleTD}'>" . help_icon("{enable_automask_creation_explain}") . "</td>\n</tr>\t\n<tr>\t\n\t<td align='right' nowrap style='font-size:22px;vertical-align:middle' class=legend>{HomeDirectoriesMask}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_text("HomeDirectoriesMask", $HomeDirectoriesMask, "width:60px;{$styleTD};padding:3px") . "</td>\n\t<td valign='top' style='{$styleTD}'> </td>\n</tr>\n<tr>\t\n\t<td align='right' nowrap style='font-size:22px;vertical-align:middle' class=legend>{SharedFoldersDefaultMask}:</td>\n\t<td valign='top' style='{$styleTD}'>" . Field_text("SharedFoldersDefaultMask", $SharedFoldersDefaultMask, "width:60px;{$styleTD};padding:3px") . "</td>\n\t<td valign='top'> </td>\n</tr>\n\t<tr>\n\t<td colspan=3 align='right' valign='top'>\n\t<hr>\n\t" . button("{apply}", "SaveArticaSambaMainConfiguration()", "16px") . "</td>\n\t</tr>\n</table></div>"; $html = "{$explain}\n\t<div id='MainSambaConfigDiv'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>{$icon_samba_type}{$admin_domain}{$disable_samba}{$acl_support}{$restart}\n\t</td>\n\t<td valign='top' width=99%>\n\t\t{$form1}\n\t\t<br>\n\t\t{$form2}\n\t\t<br>\n\t\t{$formArtica}\n\t\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\n\t\n\tfunction CheckFieldsSamba(){\n\t\tvar AsWinbindd={$AsWinbindd};\n\t\tvar cups_installed={$cups_installed};\n\t\tvar TypeOfSamba={$TypeOfSamba};\n\t\tvar upTo357={$upTo357};\n\t\tvar upTo36={$upTo36};\n\t\tdocument.getElementById('DisableWinbindd').disabled=true;\n\t\tdocument.getElementById('EnablePrintersSharing').disabled=true;\n\n\t\tdocument.getElementById('client_ntlmv2_auth').disabled=true;\n\t\t\n\t\t\n\n\t\tif(upTo36==1){\n\t\t\tdocument.getElementById('client_ntlmv2_auth').disabled=false;\n\t\t}\t\t\n\t\t\n\t\t\n\t\tif(AsWinbindd==1){document.getElementById('DisableWinbindd').disabled=false;}\n\t\tif(cups_installed==1){document.getElementById('EnablePrintersSharing').disabled=false;}\n\n\t\tif(TypeOfSamba==3){\n\t\t\tdocument.getElementById('DisableWinbindd').disabled=true;\n\t\t\tdocument.getElementById('DisableWinbindd').checked=false;\n\t\t\tdocument.getElementById('local master').disabled=true;\n\t\t\tdocument.getElementById('domain logons').disabled=true;\n\t\t\tdocument.getElementById('local master').checked=true;\n\t\t\tdocument.getElementById('domain logons').checked=true;\n\t\t\tdocument.getElementById('domain master').disabled=true;\n\t\t\tdocument.getElementById('domain master').value='yes';\n\t\t}\n\t\t\n\t\t\n\t}\n\t\n\tvar {$after_post_func}=function (obj) {\n\t\ttempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);}\n\t\tif(document.getElementById('main_samba_quicklinks_config_services')){RefreshTab('main_samba_quicklinks_config_services');}\n\t }\t\n\t\n\t\n\tfunction SaveArticaSambaMainConfiguration(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('ArticaSambaAutomAskCreation').checked){\n\t\tXHR.appendData('ArticaSambaAutomAskCreation','1');}else{\n\t\tXHR.appendData('ArticaSambaAutomAskCreation','0');}\n\t\tXHR.appendData('HomeDirectoriesMask',document.getElementById('HomeDirectoriesMask').value);\n\t\tXHR.appendData('SharedFoldersDefaultMask',document.getElementById('SharedFoldersDefaultMask').value);\n\t\tAnimateDiv('MainSambaConfigDiv');\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',{$after_post});\n\t}\n\t\n\n\t\n\t\n\t\tfunction SaveSambaMainConfiguration(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('SaveGeneralSettings','yes');\n\t\tXHR.appendData('workgroup',document.getElementById('workgroup').value);\n\t\tXHR.appendData('netbiosname',document.getElementById('netbiosname').value);\n\t\tXHR.appendData('server string',document.getElementById('server string').value);\n\t\tXHR.appendData('log level',document.getElementById('log level').value);\n\t\tXHR.appendData('domain master',document.getElementById('domain master').value);\n\t\tXHR.appendData('os level',document.getElementById('os level').value);\n\t\tif(document.getElementById('disable netbios').checked){\n\t\t\tXHR.appendData('disable netbios','yes');}else{\n\t\t\tXHR.appendData('disable netbios','no');}\n\t\t\t\n\t\tif(document.getElementById('disable netbios').checked){\n\t\t\tXHR.appendData('disable netbios','yes');}else{\n\t\t\tXHR.appendData('disable netbios','no');}\n\n\t\tif(document.getElementById('enable_Editposix').checked){\n\t\t\tXHR.appendData('enable_Editposix','yes');}else{\n\t\t\tXHR.appendData('enable_Editposix','no');}\t\t\t\n\t\t\n\t\tif(document.getElementById('domain logons').checked){\n\t\t\tXHR.appendData('domain logons','yes');}else{\n\t\t\tXHR.appendData('domain logons','no');}\t\n\n\t\t\t\t\t\n\t\tif(document.getElementById('client_ntlmv2_auth').checked){XHR.appendData('client_ntlmv2_auth','1');}else{XHR.appendData('client_ntlmv2_auth','0');}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\tif(document.getElementById('DisableWinbindd').checked){XHR.appendData('DisableWinbindd','1');}else{XHR.appendData('DisableWinbindd','0');}\t\t\t\n\t\tif(document.getElementById('EnablePrintersSharing').checked){XHR.appendData('EnablePrintersSharing','1');}else{XHR.appendData('EnablePrintersSharing','0');}\n\n\t\t\n\t\t\n\t\tif(document.getElementById('local master').checked){\n\t\t\tXHR.appendData('local master','yes');}else{\n\t\t\tXHR.appendData('local master','no');}\t\t\t\n\t\t\tAnimateDiv('MainSambaConfigDiv');\t\t\t\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveSambaMainConfiguration);\t\t\n\t\t}\n\n\t" . jsaddons() . "\n\t\t\n\t\n\t\n\tCheckFieldsSamba();\n\t</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function virtual_add_form(){ $ldap=new clladp(); $sock=new sockets(); $page=CurrentPageName(); $users=new usersMenus(); $tpl=new templates(); $t=$_GET["t"]; if(!is_numeric($t)){$t=0;} $nics=unserialize(base64_decode($sock->getFrameWork("cmd.php?list-nics=yes"))); $EnablePostfixMultiInstance=$sock->GET_INFO("EnablePostfixMultiInstance"); $NoGatewayForVirtualNetWork=$sock->GET_INFO("NoGatewayForVirtualNetWork"); $DisableNetworksManagement=$sock->GET_INFO("DisableNetworksManagement"); if(!is_numeric($NoGatewayForVirtualNetWork)){$NoGatewayForVirtualNetWork=0;} if(!is_numeric($DisableNetworksManagement)){$DisableNetworksManagement=0;} $FailOver=0; $NoGatewayForVirtualNetWorkExplain=$tpl->javascript_parse_text("{NoGatewayForVirtualNetWorkExplain}"); if($users->LinuxDistriCode=="DEBIAN"){ if(preg_match("#Debian\s+([0-9]+)\.#",$users->LinuxDistriFullName,$re)){ $DEBIAN_MAJOR=$re[1]; if($DEBIAN_MAJOR==6){$FailOver=1;} } } $title_button="{add}"; if(!is_numeric($_GET["ID"])){$_GET["ID"]=0;} if($_GET["ID"]>0){ $sql="SELECT * FROM nics_virtuals WHERE ID='{$_GET["ID"]}'"; $q=new mysql(); $ligne=@mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup")); $title_button="{apply}"; } if(isset($_GET["default-datas"])){ $default_array=unserialize(base64_decode($_GET["default-datas"])); if(is_array($default_array)){ $ligne["nic"]=$default_array["NIC"]; if(preg_match("#(.+?)\.([0-9]+)$#",$default_array["IP"],$re)){ if($re[2]>254){$re[2]=1;} $re[2]=$re[2]+1; $ligne["ipaddr"]="{$re[1]}.{$re[2]}"; $ligne["gateway"]=$default_array["GW"]; $ligne["netmask"]=$default_array["NETMASK"]; } } } if($ligne["metric"]==0){$ligne["metric"]=100+$_GET["ID"];} $styleOfFields="font-size:16px;padding:3px"; $ous=$ldap->hash_get_ou(true); $ous["openvpn_service"]="{APP_OPENVPN}"; if($users->crossroads_installed){ if($EnablePostfixMultiInstance==1){ $ous["crossroads"]="{load_balancer}"; } } $AsDebianSystem=1; while (list ($num, $val) = each ($nics) ){$nics_array[$val]=$val;} if(!$users->AsDebianSystem){$AsDebianSystem=0;} $nics_array[null]="{select}"; $ous[null]="{select}"; $nic_field=Field_array_Hash($nics_array,"nic",$ligne["nic"],null,null,0,"font-size:16px;padding:3px"); $ou_fields=Field_array_Hash($ous,"org",$ligne["org"],null,null,0,"font-size:16px;padding:3px"); $html=" <div id='virtip'> ". Field_hidden("ID","{$_GET["ID"]}")." <table style='width:99%' class=form> <tr> <td class=legend style='font-size:16px'>{nic}:</td> <td>$nic_field</td> </tr> <tr> <td class=legend style='font-size:16px'>{organization}:</td> <td>$ou_fields</td> </tr> <tr> <td class=legend style='font-size:16px'>{tcp_address}:</td> <td>" . field_ipv4("ipaddr",$ligne["ipaddr"],$styleOfFields,false,"CalcCdirVirt(0)")."</td> </tr> <tr> <td class=legend style='font-size:16px'>{netmask}:</td> <td>" . field_ipv4("netmask",$ligne["netmask"],$styleOfFields,false,"CalcCdirVirt(0)")."</td> </tr> <tr> <td class=legend style='font-size:16px'>CDIR:</td> <td style='padding:-1px;margin:-1px'> <table style='width:99%;padding:-1px;margin:-1px'> <tr> <td width=1%> " . Field_text("cdir",$ligne["cdir"],"$styleOfFields;width:190px",null,null,null,false,null,$DISABLED)."</td> <td align='left'> ".imgtootltip("img_calc_icon.gif","cdir","CalcCdirVirt(1)") ."</td> </tr> </table></td> </tr> <tr> <td class=legend style='font-size:16px'>{gateway}:</td> <td>" . field_ipv4("gateway_virtual",$ligne["gateway"],$styleOfFields,false)."</td> </tr> <tr> <td class=legend style='font-size:16px'>{metric}:</td> <td>" . field_text("metric_virtual",$ligne["metric"],"$styleOfFields;width:90px",false)."</td> </tr> <tr> <td class=legend style='font-size:16px'>failover:</td> <td>" . Field_checkbox("failover",1,$ligne["failover"],"FaileOverCheck()")."</td> </tr> <tr> <td class=legend style='font-size:16px'>{ForceGateway}:</td> <td>" . Field_checkbox("ForceGateway",1,$ligne["ForceGateway"])."</td> </tr> </table> </div> <div id='infosVirtual' style='font-size:13px'></div> <div style='text-align:right'><hr>". button($title_button,"VirtualIPAddSave()",18)."</div> <script> var Netid={$_GET["ID"]}; var FailOver=$FailOver; var cdir=document.getElementById('cdir').value; var netmask=document.getElementById('netmask').value; if(netmask.length>0){ if(cdir.length==0){ CalcCdirVirt(0); } } if(Netid>0){ document.getElementById('ipaddr').disabled=true; } function CheckGateway(){ var NoGatewayForVirtualNetWork=$NoGatewayForVirtualNetWork; var AsDebianSystem=$AsDebianSystem; if(AsDebianSystem==0){ document.getElementById('ForceGateway').disabled=true; document.getElementById('ForceGateway').checked=false; } document.getElementById('gateway_virtual').disabled=false; if(NoGatewayForVirtualNetWork==1){ document.getElementById('gateway_virtual').disabled=true; document.getElementById('gateway_virtual').value=''; document.getElementById('ForceGateway').disabled=true; document.getElementById('ForceGateway').checked=false; document.getElementById('infosVirtual').innerHTML='$NoGatewayForVirtualNetWorkExplain'; } document.getElementById('failover').disabled=true; if(FailOver==1){document.getElementById('failover').disabled=false;} } function VirtualIPAddSave(){ var DisableNetworksManagement=$DisableNetworksManagement; var NoGatewayForVirtualNetWork=$NoGatewayForVirtualNetWork; if(DisableNetworksManagement==1){alert('$ERROR_NO_PRIVS');return;} var XHR = new XHRConnection(); XHR.appendData('virt-ipaddr',document.getElementById('ipaddr').value); XHR.appendData('netmask',document.getElementById('netmask').value); XHR.appendData('cdir',document.getElementById('cdir').value); XHR.appendData('metric',document.getElementById('metric_virtual').value); if(NoGatewayForVirtualNetWork==0){XHR.appendData('gateway',document.getElementById('gateway_virtual').value);} if(NoGatewayForVirtualNetWork==1){XHR.appendData('gateway','');} XHR.appendData('nic',document.getElementById('nic').value); XHR.appendData('org',document.getElementById('org').value); XHR.appendData('ID',document.getElementById('ID').value); if(document.getElementById('ForceGateway').checked){XHR.appendData('ForceGateway',1);}else{XHR.appendData('ForceGateway',0);} if(document.getElementById('failover')){ if(document.getElementById('failover').checked){XHR.appendData('failover',1);}else{XHR.appendData('failover',0);} } MemFlexGrid=$t; AnimateDiv('virtip'); XHR.sendAndLoad('$page', 'GET',X_VirtualIPAddSave); } function FaileOverCheck(){ document.getElementById('netmask').disabled=false; document.getElementById('gateway_virtual').disabled=false; if(document.getElementById('failover').checked){ document.getElementById('netmask').disabled=true; document.getElementById('gateway_virtual').disabled=true; } //post-up /sbin/ifconfig eth0:1 IP.DE.FAIL.OVER1 netmask 255.255.255.255 broadcast IP.DE.FAIL.OVER1 } CheckGateway(); FaileOverCheck(); </script> "; echo $tpl->_ENGINE_parse_body($html); }
function main() { $tpl = new templates(); $page = CurrentPageName(); $servername = $_GET["servername"]; $rv = new squid_reverse(); $q = new mysql_squid_builder(); $sock = new sockets(); $title = "{new_webserver}"; $bt = "{add}"; $t = time(); FORM_START(); $q = new mysql_squid_builder(); $squid_reverse = new squid_reverse(); $tpl = new templates(); $sslcertificates = $squid_reverse->ssl_certificates_list(); $sources_list = $squid_reverse->sources_list(); $array = $sources_list[0]; $array2 = $sources_list[1]; $CountDeSources = $sources_list[2]; $nginx_caches = $squid_reverse->caches_list(); $nginx_pools = $squid_reverse->pool_list(); $nginx_replaces = $squid_reverse->replace_list(); $AsFReeWeb = false; $EnableFreeWeb = $sock->GET_INFO("EnableFreeWeb"); if ($servername != null) { $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM reverse_www WHERE servername='{$servername}'")); $title = $tpl->_ENGINE_parse_body("{port}:{$ligne["port"]} «{$servername}»"); $bt = "{apply}"; $Hidden = Field_hidden("servername-edit-{$t}", $servername) . $servername; } else { $ligne["enabled"] = 1; $Hidden = Field_text("servername-edit-{$t}", null, "font-size:18px;width:300px"); FORM_CLOSE("YahooWin"); } if (!is_numeric($ligne["port"])) { $ligne["port"] = 80; } if (!is_numeric($ligne["ArticaErrors"])) { $ligne["ArticaErrors"] = 1; } if ($servername == null) { $ligne["cache_peer_id"] = -1; } if (!is_numeric($EnableFreeWeb)) { $EnableFreeWeb = 0; } if ($ligne["cache_peer_id"] == 0) { if ($EnableFreeWeb == 1) { $q2 = new mysql(); $ligne2 = mysql_fetch_array($q2->QUERY_SQL("SELECT `useSSL`,`sslcertificate` FROM `freeweb` WHERE `servername`='{$servername}'", "artica_backup")); $ligne["certificate"] = $ligne2["sslcertificate"]; $AsFReeWeb = true; $title = $tpl->_ENGINE_parse_body("FreeWeb «{$servername}»"); } else { $ligne["cache_peer_id"] = -1; } } $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = "<tr><td colspan=2 style='font-size:22px'>{reverse_proxy}:</td></tr>"; $html[] = "<tr><td class=legend style='font-size:18px'>{webserver}:</td>"; $html[] = "<td style='font-size:18px'>{$Hidden}</td></tr>"; $html[] = Field_checkbox_table("owa-{$t}", "{protect_owa}", $ligne["owa"], 18); $html[] = Field_checkbox_table("debug-{$t}", "{debug}", $ligne["debug"], 18); $html[] = Field_list_table("cacheid-{$t}", "{cache}", $ligne["cacheid"], 18, $nginx_caches); $html[] = Field_list_table("replaceid-{$t}", "{replace_rule}", $ligne["replaceid"], 18, $nginx_replaces); if ($ligne["cache_peer_id"] == 0) { $html[] = Field_hidden("cache_peer_id-{$t}", 0); $html[] = Field_hidden("enabled-{$t}", 1); $html[] = Field_hidden("certificate-{$t}", $ligne["certificate"]); } else { if (!AdminPrivs()) { $html[] = Field_hidden("cache_peer_id-{$t}", $ligne["cache_peer_id"]); $html[] = Field_hidden("start_directory-{$t}", $ligne["start_directory"]); } else { $html[] = Field_list_table("cache_peer_id-{$t}", "{destination}", $ligne["cache_peer_id"], 18, $array); $html[] = Field_text_table("start_directory-{$t}", "{start_path}", $ligne["start_directory"], 18, null, 300); } $html[] = Field_list_table("poolid-{$t}", "{pool}", $ligne["poolid"], 18, $nginx_pools); $html[] = Field_text_table("RedirectQueries-{$t}", "{RedirectQueries}", $ligne["RedirectQueries"], 18, null, 300); $html[] = Field_checkbox_table("ArticaErrors-{$t}", "{enable_template_errors}", $ligne["ArticaErrors"], 18); if ($CountDeSources == 0) { $html[] = "<tr><td colspan=2><p class=text-error>{you_need_to_define_sources_first}</p></td></tr>"; FORM_LOCK(); } } $html[] = Field_button_table($bt); echo $tpl->_ENGINE_parse_body(FORM_END(CurrentPageName(), $html)); }
function quota_params_popup() { $sock = new sockets(); $t = $_GET["t"]; $array = unserialize(base64_decode($sock->GET_INFO("SquidQuotasParams"))); $page = CurrentPageName(); $tpl = new templates(); if (!is_numeric($array["CACHE_TIME"])) { $array["CACHE_TIME"] = 360; } if (!is_numeric($array["DISABLE_MODULE"])) { $array["DISABLE_MODULE"] = 0; } if ($array["TEMPLATE"] == null) { $array["TEMPLATE"] = "ERR_ACCESS_DENIED"; } $html = "\n\t<span id='explain-div-{$t}'></span>\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:16px'>{disable}:</td>\n\t\t<td style='font-size:16px'>" . Field_checkbox("DISABLE_MODULE-{$t}", 1, $array["DISABLE_MODULE"], "DISABLE_MODULE_CHECK{$t}()") . "</td>\n\t\t<td> </td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{template}:</td>\n\t\t<td style='font-size:16px'><span id='TEMPLATEtext-{$t}'>{$array["TEMPLATE"]}</span> " . Field_hidden("TEMPLATE-{$t}", $array["TEMPLATE"]) . "</td>\n\t\t<td>" . button("{browse}...", "Loadjs('squid.templates.php?choose-generic=TEMPLATE-{$t}&divid=TEMPLATEtext-{$t}')", "13px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{cache_time}:</td>\n\t\t<td style='font-size:16px' colspan=2>" . Field_text("CACHE_TIME-{$t}", $array["CACHE_TIME"], "font-size:16px;width:90") . " {seconds}</td>\n\t</tr>\t\n\t\n\t\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "SaveFormRule{$t}()", "18px") . "</tr>\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\n\t\tfunction ExplainIndet{$t}(){\n\t\t\tvar exp=document.getElementById('identification-{$t}').value;\n\t\t\tLoadAjax('explain-div-{$t}','{$page}?explain-ident='+exp);\n\t\t\n\t\t}\n\t\t\n\tvar x_SaveFormRule{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tdocument.getElementById('explain-div-{$t}').innerHTML='';\n\t\tif(results.length>2){alert(results);return;}\n\t\t\$('#{$t}').flexReload();\n\t\tYahooWin2Hide();\n\t}\t\n\n\tfunction DISABLE_MODULE_CHECK{$t}(){\n\t\tif(document.getElementById('DISABLE_MODULE-{$t}').checked){\n\t\t\tdocument.getElementById('TEMPLATE-{$t}').disabled=true;\n\t\t\tdocument.getElementById('CACHE_TIME-{$t}').disabled=true;\n\t\t}else{\n\t\t\tdocument.getElementById('TEMPLATE-{$t}').disabled=false;\n\t\t\tdocument.getElementById('CACHE_TIME-{$t}').disabled=false;\t\t\n\t\t}\n\t}\n\t\t\n\tfunction SaveFormRule{$t}(){\t\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('DISABLE_MODULE-{$t}').checked){XHR.appendData('DISABLE_MODULE',1);}else{XHR.appendData('DISABLE_MODULE',0);}\n\t\tXHR.appendData('TEMPLATE',document.getElementById('TEMPLATE-{$t}').value);\n\t\tXHR.appendData('CACHE_TIME',document.getElementById('CACHE_TIME-{$t}').value);\n\t\tAnimateDiv('explain-div-{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveFormRule{$t});\t\t\n\t\t}\t\n\t\t\n\t\t DISABLE_MODULE_CHECK{$t}();\n\t</script>\n\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function recipient_popup() { $button = "{add}"; $page = CurrentPageName(); $ldap = new clladp(); $tt = $_GET["t"]; $t = time(); if ($_GET["ou"] == null) { $_GET["ou"] = "master"; } $emailtr = "\t<tr>\n\t<td align='right' nowrap class=legend style='font-size:16px'>{email}:</strong></td>\n\t<td style='font-size:16px'>" . Field_text("email-{$t}", $email, "font-size:16px;width:240px") . "</td>\n\t<td>" . help_icon("{transport_email_explain}") . "</td>\t\n\t</tr>\t"; if ($_GET["recipient"] != null) { $q = new mysql(); $sql = "SELECT * FROM postfix_transport_recipients WHERE `recipient`='{$_GET["recipient"]}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); $domaintools = new DomainsTools(); $table = $domaintools->transport_maps_explode($ligne["transport"]); $relay_address = $table[1]; $port = $table[2]; $MX_lookups = $table[3]; $button = "{apply}"; $emailtr = "\n\t<tr>\n\t\t<td align='right' nowrap class=legend style='font-size:16px'>{email}:</strong></td>\n\t\t<td style='font-size:16px'>{$_GET["recipient"]}" . Field_hidden("email-{$t}", $_GET["recipient"]) . "</td>\t\n\t\t<td> </td>\n\t</tr>\t\n\t"; } if (!is_numeric($port)) { $port = 25; } $html = "\n\t<table style='width:99%' class=form>\n\t{$emailtr}\t\n\t<tr>\n\t\t<td align='right' nowrap class=legend style='font-size:16px'>{relay_address}:</strong></td>\n\t\t<td style='font-size:16px'>" . Field_text("relay_address-{$t}", $relay_address, "font-size:16px;width:240px") . "</td>\t\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' nowrap class=legend style='font-size:16px'>{port}:</strong></td>\n\t\t<td style='font-size:16px'>" . Field_text("relay_port-{$t}", $port, "font-size:16px;width:90px") . "</td>\n\t\t<td> </td>\t\n\t</tr>\t\n\t<tr>\n\t\t<td style='font-size:16px' class=legend>{MX_lookups}</td>\n\t\t<td align='left' nowrap style='font-size:16px'>" . Field_checkbox("MX_lookups-{$t}", 1, $MX_lookups) . "</td>\t\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' colspan=3>" . button($button, "PostfixAddRecipientTable{$t}()", "18px") . "</td>\n\t</tr>\t\t\n\t</table>\n\t<script>\n\t\n\t\tvar X_PostfixAddRecipientTable{$t}= function (obj) {\n\t\t\t\tvar results=obj.responseText;\n\t\t\t\tif (results.length>0){alert(results);}\n\t\t\t\tYahooWin4Hide();\n\t\t\t\t\$('#flexRT{$tt}').flexReload();\n\t\t\t}\t\t\n\t\tfunction PostfixAddRecipientTable{$t}(){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\t\t\t\tXHR.appendData('ou','{$_GET["ou"]}');\n\t\t\t\tXHR.appendData('recipient-save',document.getElementById('email-{$t}').value);\n\t\t\t\tXHR.appendData('relay_address',document.getElementById('relay_address-{$t}').value);\n\t\t\t\tXHR.appendData('port',document.getElementById('relay_port-{$t}').value);\n\t\t\t\tif(document.getElementById('MX_lookups-{$t}').checked){XHR.appendData('MX_lookups',1);}else{XHR.appendData('MX_lookups',0);}\n\t\t\t\tXHR.sendAndLoad('{$page}', 'POST',X_PostfixAddRecipientTable{$t});\n\t\t\t\t\n\t\t\t}\t\n</script>\t\n\t\n\t\n"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function params() { $t = time(); $sock = new sockets(); $tpl = new templates(); $page = CurrentPageName(); $sock = new sockets(); $SquidPerformance = intval($sock->GET_INFO("SquidPerformance")); if ($SquidPerformance > 1) { echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled_see_performance}")); return; } $DisableArticaProxyStatistics = $sock->GET_INFO("DisableArticaProxyStatistics"); $EnableSquidRemoteMySQL = $sock->GET_INFO("EnableSquidRemoteMySQL"); $CleanArticaSquidDatabases = $sock->GET_INFO("CleanArticaSquidDatabases"); $EnableProxyLogHostnames = $sock->GET_INFO("EnableProxyLogHostnames"); $MacResolvInterface = $sock->GET_INFO("MacResolvInterface"); if (!is_numeric($EnableSquidRemoteMySQL)) { $EnableSquidRemoteMySQL = 0; } if (!is_numeric($DisableArticaProxyStatistics)) { $DisableArticaProxyStatistics = 0; } if (!is_numeric($CleanArticaSquidDatabases)) { $CleanArticaSquidDatabases = 0; } if (!is_numeric($EnableProxyLogHostnames)) { $EnableProxyLogHostnames = 0; } $net = new networking(); $interfaces = $net->Local_interfaces(); $array[null] = "{none}"; while (list($eth, $line) = each($interfaces)) { if ($eth == "lo") { continue; } $ip = new system_nic($eth); $array[$eth] = $ip->IPADDR . " (" . $ip->NICNAME . ")"; } $p = Paragraphe_switch_img("{DisableArticaProxyStatistics}", "{DisableArticaProxyStatistics_explain}", "DisableArticaProxyStatistics", $DisableArticaProxyStatistics, null, 600); $p1 = Paragraphe_switch_img("{CleanArticaSquidDatabases}", "{CleanArticaSquidDatabases_explain}", "CleanArticaSquidDatabases", $CleanArticaSquidDatabases, null, 600); $p2 = Paragraphe_switch_img("{EnableProxyLogHostnames}", "{EnableProxyLogHostnames_explain}", "EnableProxyLogHostnames", $EnableProxyLogHostnames, null, 600); if ($EnableSquidRemoteMySQL == 1) { $TuningParameters = unserialize(base64_decode($sock->GET_INFO("MySQLSyslogParams"))); $error = "<div style='font-size:16px' class=explain>{remote_mysqlsquidserver_text}<br><strong>mysql://{$TuningParameters["mysqlserver"]}:{$TuningParameters["RemotePort"]}</strong></div>"; $p = Paragraphe_switch_disable("{DisableArticaProxyStatistics}", "{DisableArticaProxyStatistics_explain}", null, 600) . "" . Field_hidden("DisableArticaProxyStatistics", 0); } $html = "\n\t<div id={$t}></div>\n\t<div style='width:98%' class=form>\n\t{$error}\n\t<table>\n\t<tr>\n\t\t<td colspan=3>{$p}</td>\n\t</tr>\n\t<tr><td colspan=3><hr></td></tr>\n\t<tr>\n\t\t<td colspan=3>{$p1}</td>\n\t</tr>\n\n\t\n\t<tr>\n\t\t<td colspan=3 align='right'>" . button("{apply}", "SaveStopArticaStats()", 16) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t\n\t<div style='width:98%' class=form>\n\t<table>\n\t<tr>\n\t\t<td colspan=3>{$p2}</td>\n\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:16px'>{mac_resolv_interface}:</td>\n\t\t<td>" . Field_array_Hash($array, "MacResolvInterface", $MacResolvInterface, null, null, 0, "font-size:16px") . "</td>\n\t\t<td width=1%>" . help_icon("{mac_resolv_interface_help}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td align='right' colspan=3>" . button("{apply}", "SaveOptions{$t}()", 16) . "</td>\n\t</tr>\t\n\t</table>\n\t</div>\n\t<script>\n\tvar x_SaveStopArticaStats= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\tRefreshTab('artica_stats_tabs');\n\t\tCacheOff();\n\t\tConfigureYourserver();\n\t}\n\n\t\t\n\t\t\n\tfunction SaveStopArticaStats(){\n\t\t\tvar XHR = new XHRConnection();\t\n\t\t\tXHR.appendData('DisableArticaProxyStatistics',document.getElementById('DisableArticaProxyStatistics').value);\n\t\t\tXHR.appendData('CleanArticaSquidDatabases',document.getElementById('CleanArticaSquidDatabases').value);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveStopArticaStats);\n\t\t\t}\n\t\t\t\n\tvar xSaveOptions{$t}= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\n\t}\t\t\t\n\t\t\t\n\tfunction SaveOptions{$t}(){\n\t\t\tvar XHR = new XHRConnection();\t\n\t\t\tXHR.appendData('EnableProxyLogHostnames',document.getElementById('EnableProxyLogHostnames').value);\n\t\t\tXHR.appendData('MacResolvInterface',document.getElementById('MacResolvInterface').value);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',xSaveOptions{$t});\n\t\t\t}\t\t\t\n\t\t\t\n\t</script>\n\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function main_form() { $cf = new dnsmasq(); $page = CurrentPageName(); $tpl = new templates(); $sys = new systeminfos(); $sys->array_interfaces[null] = '{select}'; $sys->array_tcp_addr[null] = '{select}'; $interfaces = Field_array_Hash($sys->array_interfaces, 'interfaces', null, "style:font-size:16px;padding:3px;"); $tcpaddr = Field_array_Hash($sys->array_tcp_addr, 'listen_addresses', null, "style:font-size:16px;padding:3px;"); $sock = new sockets(); $EnableDNSMASQ = intval($sock->GET_INFO("EnableDNSMASQ")); $EnableDNSMASQOCSDB = intval($sock->GET_INFO("EnableDNSMASQOCSDB")); $f[] = "domain-needed"; $f[] = "expand-hosts"; $f[] = "bogus-priv"; $f[] = "filterwin2k"; $f[] = "strict-order"; $f[] = "no-resolv"; $f[] = "no-negcache"; $f[] = "no-poll"; $f[] = "log-queries"; while (list($index, $key) = each($f)) { if ($cf->main_array[$key] == "yes") { $cf->main_array[$key] = 1; } else { $cf->main_array[$key] = 0; } $js[] = "if(document.getElementById('{$key}').checked){XHR.appendData('{$key}','yes');\t}else{XHR.appendData('{$key}','no');}"; } $html = "\n<div style='width:98%' class=form>\t\t\n<table style='width:100%'><tbody>\n\n<tr>\n\t<td align='right' style='font-size:22px;vertical-align:middle;' class=legend>" . texttooltip("{EnableDNSMASQOCSDB}", "{EnableDNSMASQOCSDB_explain}") . ":</td>\n\t<td align='left' style='font-size:22px;vertical-align:middle;'>" . Field_checkbox_design("EnableDNSMASQOCSDB", 1, $EnableDNSMASQOCSDB, "EnableDNSMASQOCSDB()") . "</td>\n</tr>\n<tr>\n\t<td align='right' style='font-size:22px;vertical-align:middle;' style='font-size:22px;vertical-align:middle' class=legend>" . texttooltip("{domain-needed}", "{domain-needed_text}") . ":</td>\n\t<td align='left' style='font-size:22px;vertical-align:middle;'>" . Field_checkbox_design('domain-needed', 1, $cf->main_array["domain-needed"]) . "</td>\n\n</tr>\n<tr>\n<td align='right' style='font-size:22px;vertical-align:middle;' style='font-size:22px;vertical-align:middle' class=legend>" . texttooltip("{expand-hosts}", "{expand-hosts_text}") . ":</td>\n<td align='left' style='font-size:22px;vertical-align:middle;' >" . Field_checkbox_design('expand-hosts', 1, $cf->main_array["expand-hosts"]) . "</td>\n</tr>\n\n\n<tr>\n<td align='right' style='font-size:22px;vertical-align:middle;' style='font-size:22px;vertical-align:middle' class=legend>" . texttooltip("{bogus-priv}", "{bogus-priv_text}") . ":</td>\n<td align='left' style='font-size:22px;vertical-align:middle;' >" . Field_checkbox_design('bogus-priv', 1, $cf->main_array["bogus-priv"]) . "</td>\n</tr>\n<tr>\n<td align='right' style='font-size:22px;vertical-align:middle;' style='font-size:22px;vertical-align:middle' class=legend>" . texttooltip("{filterwin2k}", "{filterwin2k_text}") . ":</td>\n<td align='left' style='font-size:22px;vertical-align:middle;' >" . Field_checkbox_design('filterwin2k', 1, $cf->main_array["filterwin2k"]) . "</td>\n\n</tr>\n<tr>\n<td align='right' style='font-size:22px;vertical-align:middle;' style='font-size:22px;vertical-align:middle' class=legend>" . texttooltip("{strict-order}", "{strict-order_text}") . ":</td>\n<td align='left' style='font-size:22px;vertical-align:middle;' >" . Field_checkbox_design('strict-order', 1, $cf->main_array["strict-order"]) . "</td>\n</tr>\n\n<tr>\n<td align='right' style='font-size:22px;vertical-align:middle;' style='font-size:22px;vertical-align:middle' class=legend>" . texttooltip("{no-resolv}", "{no-resolv_text}") . ":</td>\n<td align='left' style='font-size:22px;vertical-align:middle;' >" . Field_checkbox_design('no-resolv', 1, $cf->main_array["no-resolv"]) . "</td>\n\n</tr>\n\n<tr>\n<td align='right' style='font-size:22px;vertical-align:middle' class=legend>" . texttooltip("{no-negcache}", "{no-negcache_text}") . ":</td>\n<td align='left' style='font-size:22px;vertical-align:middle' >" . Field_checkbox_design('no-negcache', 1, $cf->main_array["no-negcache"]) . "</td>\n</tr>\n\n\n\n<tr>\n<td align='right' style='font-size:22px;vertical-align:middle' class=legend>" . texttooltip("{no-poll}", "{no-poll_text}") . ":</td>\n<td align='left' style='font-size:22px;vertical-align:middle;' >" . Field_checkbox_design('no-poll', 1, $cf->main_array["no-poll"]) . "</td>\n\n</tr>\n\n<tr>\n<td align='right' style='font-size:22px;vertical-align:middle' class=legend>" . texttooltip("{log-queries}", "{log-queries_text}") . ":</td>\n<td align='left' style='font-size:22px;vertical-align:middle' >" . Field_checkbox_design('log-queries', 1, $cf->main_array["log-queries"]) . "</td>\n\n</tr>\n\n\n</tbody>\n</table>\n</div>\n" . Field_hidden("resolv-file", $cf->main_array["resolv-file"]) . "\n<div style='width:98%' class=form>\n<table style='width:100%'>\n\t<tbody>\n\t\t<tr>\n\t\t\t<td align='right' style='font-size:22px;vertical-align:middle;' nowrap class=legend>" . texttooltip("{cache-size}", "{cache-size_text}") . ":</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle;'>" . Field_text('cache-size', $cf->main_array["cache-size"], "font-size:22px;padding:3px;width:120px") . "</td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right' style='font-size:22px;vertical-align:middle;'nowrap class=legend>" . texttooltip("{dns-forward-max}", "{dns-forward-max_text}") . ":</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle;'>" . Field_text('dns-forward-max', $cf->main_array["dns-forward-max"], "font-size:22px;padding:3px;width:120px") . "</td>\n\t\t\t\n\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\n\t\n\t\t<tr>\n\t\t\t<td align='right' style='font-size:22px;vertical-align:middle;' nowrap class=legend>" . texttooltip("{local_domain}", "{dnsmasq_domain_explain}") . ":</td>\n\t\t\t<td align='left' style='font-size:22px;vertical-align:middle;'>" . Field_text('dnsmasq-domain', $cf->main_array["domain"], "font-size:22px;padding:3px;width:220px") . "</td>\n\t\t\t\n\t\t</tr>\n\t\n\t\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{apply}", "SaveDNSMASQMainConf();", 32) . "</td>\n\t\t</tr>\n\t</tbody>\n</table></div>"; echo $tpl->_ENGINE_parse_body($html); }
function main_actions() { $tpl = new templates(); $kas = new kas_mysql($_GET["ou"]); $page = CurrentPageName(); $action_message = array(0 => "{acceptmessage}", 1 => "{kassendcopy}", 2 => "{quarantine}", -1 => "{kasreject}", -3 => "{kasdelete}"); $ACTION_SPAM_MODE = Field_array_Hash($action_message, 'ACTION_SPAM_MODE', $kas->GET_KEY("ACTION_SPAM_MODE"), ""); $ACTION_PROBABLE_MODE = Field_array_Hash($action_message, 'ACTION_PROBABLE_MODE', $kas->GET_KEY("ACTION_PROBABLE_MODE")); $ACTION_BLACKLISTED_MODE = Field_array_Hash($action_message, 'ACTION_BLACKLISTED_MODE', $kas->GET_KEY("ACTION_BLACKLISTED_MODE")); $ACTION_FORMAL_MODE = Field_array_Hash($action_message, 'ACTION_FORMAL_MODE', $kas->GET_KEY("ACTION_FORMAL_MODE")); $html = "\n\t\t<div id='ACTION_SPAM_MODE_ID'>\n\t\t" . Field_hidden("ACTION_SPAM_EMAIL", $kas->GET_KEY("ACTION_SPAM_EMAIL")) . "\t\t\n\t\t<table style='width:90%'>\n\t\t\t<tr >\n\t\t\t\t<td align='right' nowrap style='width:1%'><span style='font-size:12px;font-weight:bold;color:#005447'>{spam option 1}</span></td>\n\t\t\t\t<td>{$ACTION_SPAM_MODE}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td align='right' nowrap style='width:1%'><strong>{prepend to the subject}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_text('ACTION_SPAM_SUBJECT_PREFIX', $kas->GET_KEY("ACTION_SPAM_SUBJECT_PREFIX")) . "</td>\n\t\t\t</tr>\t\t\n\t\t\t<tr >\n\t\t\t\t<td align='right' nowrap style='width:1%'><strong>{xspamtest}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_text('ACTION_SPAM_USERINFO', $kas->GET_KEY("ACTION_SPAM_USERINFO")) . "</td>\n\t\t\t</tr>\t\n\t\t\t<tr>\n\t\t\t<td colspan=2 align='right' style='padding-left:15px'>\n\t\t\t<hr>\n\t\t\t\t" . button("{apply}", "ACTION_SPAM_MODE_SAVE()") . "</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t"; $html = $html . "<br>\n" . Field_hidden("ACTION_PROBABLE_EMAIL", $kas->GET_KEY("ACTION_PROBABLE_EMAIL")) . "\t\t\n\t\t<table style='width:90%'>\n\t\t<tr >\n\t\t\t\t<td align='right' nowrap style='width:1%'><span style='font-size:12px;font-weight:bold;color:#005447'>{spam option 2}</span></td>\n\t\t\t\t<td>{$ACTION_PROBABLE_MODE}</td>\n\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td align='right' nowrap style='width:1%'><strong>{prepend to the subject}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_text('ACTION_PROBABLE_SUBJECT_PREFIX', $kas->GET_KEY("ACTION_PROBABLE_SUBJECT_PREFIX")) . "</td>\n\t\t\t</tr>\t\t\n\t\t\t<tr >\n\t\t\t\t<td align='right' nowrap style='width:1%'><strong>{xspamtest}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_text('ACTION_PROBABLE_USERINFO', $kas->GET_KEY("ACTION_PROBABLE_USERINFO")) . "</td>\n\t\t\t</tr>\t\n\t\t\t<tr>\n\t\t\t\t\t\t<td colspan=2 align='right' style='padding-left:15px'>\n\t\t\t<hr>\n\t\t\t\t" . button("{apply}", "ACTION_SPAM_MODE_SAVE()") . "</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t"; $html = $html . "<br>\n" . Field_hidden("ACTION_BLACKLISTED_EMAIL", $kas->GET_KEY("ACTION_BLACKLISTED_EMAIL")) . "\t\n<table style='width:90%'>\n\t\t<tr >\n\t\t\t\t<td align='right' nowrap style='width:1%'><span style='font-size:12px;font-weight:bold;color:#005447'>{spam option 3}</span></td>\n\t\t\t\t<td>{$ACTION_BLACKLISTED_MODE}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td align='right' nowrap style='width:1%'><strong>{prepend to the subject}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_text('ACTION_BLACKLISTED_SUBJECT_PREFIX', $kas->GET_KEY("ACTION_BLACKLISTED_SUBJECT_PREFIX")) . "</td>\n\t\t\t</tr>\t\t\n\t\t\t<tr >\n\t\t\t\t<td align='right' nowrap style='width:1%'><strong>{xspamtest}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_text('ACTION_BLACKLISTED_USERINFO', $kas->GET_KEY("ACTION_BLACKLISTED_USERINFO")) . "</td>\n\t\t\t</tr>\t\n\t\t\t<tr>\t\n\t\t\t\t\t\t<td colspan=2 align='right' style='padding-left:15px'>\n\t\t\t<hr>\n\t\t\t\t" . button("{apply}", "ACTION_SPAM_MODE_SAVE()") . "</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t"; $html = $html . "<br>\n" . Field_hidden("ACTION_FORMAL_EMAIL", $kas->GET_KEY("ACTION_FORMAL_EMAIL")) . "\t\n\t\t<table style='width:90%'>\n\t\t<tr > \n\t\t\t\t<td align='right' nowrap style='width:1%'><span style='font-size:12px;font-weight:bold;color:#005447'>{spam option 4}</span></td>\n\t\t\t\t<td>{$ACTION_FORMAL_MODE}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td align='right' nowrap style='width:1%'><strong>{prepend to the subject}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_text('ACTION_FORMAL_SUBJECT_PREFIX', $kas->GET_KEY("ACTION_FORMAL_SUBJECT_PREFIX")) . "</td>\n\t\t\t</tr>\t\t\n\t\t\t<tr >\n\t\t\t\t<td align='right' nowrap style='width:1%'><strong>{xspamtest}:</strong></td>\n\t\t\t\t<td align='left'>" . Field_text('ACTION_FORMAL_USERINFO', $kas->GET_KEY("ACTION_FORMAL_USERINFO")) . "</td>\n\t\t\t</tr>\t\n\t\t\t<tr>\t\n\t\t\t\t\t\t<td colspan=2 align='right' style='padding-left:15px'>\n\t\t\t<hr>\n\t\t\t\t" . button("{apply}", "ACTION_SPAM_MODE_SAVE()") . "</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</div>\t"; echo $tpl->_ENGINE_parse_body($html); }
function main_table() { $main = new main_perso(); if (isset($_GET["delete"])) { $main->Delete($_GET["delete"]); } $options = array("r" => "{replace}", "a" => "{add}"); if (!is_array($main->main_array)) { return null; } while (list($num, $val) = each($main->main_array)) { $fmname = md5($num); $html = $html . "\n\t\t\n\t\t<div style='margin-top:3px;border:1px dotted #CCCCCC;padding-top:4px;width:99%;;overflow:auto'>\n\t\t\t\t<form name='FFM_{$fmname}'>\n\t\t\t<table style='width:99%'>\n\t\t\t<tr " . CellRollOver() . ">\n\t\t\t\t<td width=1% nowrap><strong style='font-size:13px'>{maincf_key}:</strong></td>\n\t\t\t\t<td>" . Field_text('key', $num, 'width:100%;font-size:13px;padding:3px') . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td width=1% nowrap colspan=2><strong style='font-size:13px'>{maincf_data}:</strong></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\n\t\t\t\t<td colspan=2>" . Field_text('data', $val["VALUE"], 'width:100%;font-size:13px;padding:3px') . "</td>\n\t\t\t\t<td>" . Field_hidden("opt", "r") . "</td>\n\t\t\t\t<td width=1%>" . imgtootltip('delete-32.png', '{delete}', "MainPersoDelete('{$num}')") . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\n\t\t\t<td colspan=7 align='right'>\n\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tr " . CellRollOver() . ">\n\t\t\t\t\t<td width=99%><code style='font-size:13px'>{$num}={$val["VALUE"]}</code> </td>\n\t\t\t\t\t<td width=1% align='right'>" . button("{apply}", "ParseForm('FFM_{$fmname}','{$page}',true);ChargeTable()") . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</form>\n\t</div>"; } $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }