function policy_domain() { $page = CurrentPageName(); $tpl = new templates(); $t = time(); $q = new amavisdb(); $boot = new boostrap_form(); $email = $_GET["policy-domain"]; $sql = "SELECT id,policy_name FROM policy WHERE ou='{$_SESSION["ou"]}' ORDER BY policy_name"; $results = $q->QUERY_SQL($sql); if (!$q->ok) { echo "<p class=text-error>{$q->mysql_error}<br>{$sql}<hr></p>"; } $policies[0] = "{default}"; while ($ligne = mysql_fetch_assoc($results)) { $policies[$ligne["id"]] = $ligne["policy_name"]; } $email_id = $q->emailid_from_email("@{$email}"); $policy_id = $q->policyid_from_mail("@{$email}"); $boot->set_hidden("policy_domain", $email); $boot->set_hidden("email_id", $email_id); $boot->set_list("policy_id", "{policy}", $policies, $policy_id); $boot->set_button("{apply}"); $boot->set_CallBack("YahooWin2Hide"); $boot->set_RefreshSearchs(); echo $boot->Compile(); }
function new_port() { $t = $_GET["t"]; include_once dirname(__FILE__) . "/ressources/class.system.network.inc"; $page = CurrentPageName(); $tpl = new templates(); $boot = new boostrap_form(); $ip = new networking(); $ips = $ip->ALL_IPS_GET_ARRAY(); $ipz["0.0.0.0"] = "{all}"; while (list($ip, $line) = each($ips)) { $ipz[$ip] = $ip; } $boot->set_field("portname", "{rulename}", "MyNew port", array("ENCODE" => true)); $boot->set_field("aclport", "{listen_port}", "9090"); $boot->set_list("interface", "{listen_address}", $ipz, "0.0.0.0"); $boot->set_button("{add}"); $boot->set_hidden("bubble-add", "yes"); $boot->set_formtitle("{new_port}"); $boot->set_CallBack("LoadAjax('center-{$t}','{$page}?tabs=yes&t={$t}');"); $form = $boot->Compile(); echo $tpl->_ENGINE_parse_body($form); }
function content() { $page = CurrentPageName(); $tpl = new templates(); $users = new usersMenus(); $VirtualUser = $_SESSION["VirtAclUser"]; if (isset($_SESSION["RADIUS_ID"])) { if ($_SESSION["RADIUS_ID"] > 0) { $VirtualUser = true; } } if (!$VirtualUser) { $ct = new user($_SESSION["uid"]); } else { $ct = new user(); } $t = time(); $ActiveDirectory = 0; if ($ct->AsActiveDirectoryMember) { $ActiveDirectory = 1; } $boot = new boostrap_form(); if ($VirtualUser) { $ct->DisplayName = $_SESSION["uid"]; } if ($_SESSION["uid"] == -100) { include "ressources/settings.inc"; $ct->DisplayName = $_GLOBAL["ldap_admin"]; $ct->sn = $ct->DisplayName; $ct->givenName = $ct->DisplayName; $VirtualUser = true; } $boot->set_field("DisplayName", "{displayName}", $ct->DisplayName); $boot->set_field("sn", "{sn}", $ct->sn); $boot->set_field("givenName", "{givenName}", $ct->givenName); if ($users->AllowChangeUserPassword) { $boot->set_fieldpassword("password", "{password}", $ct->password); } $boot->set_field("telephoneNumber", "{telephoneNumber}", $ct->telephoneNumber); $boot->set_field("mobile", "{mobile}", $ct->mobile); $boot->set_button("{apply}"); $boot->set_CallBack("AjaxTopMenu('headNav','miniadm.index.php?headNav=yes');"); if ($VirtualUser) { $boot->set_form_locked(); } else { if ($ActiveDirectory == 1) { $boot->set_form_locked(); } } $picture = "ressources/{$ct->ThumbnailPath}"; if (is_file("{$picture}")) { $picture = "<a href=\"javascript:blur();\" \n\t\tOnClick=\"javascript:Loadjs('miniadm.profile.php?upload-pic-js=yes');\">\n\t\t<img src='ressources/{$ct->ThumbnailPath}' style='margin:10px'></a>"; } else { $picture = null; } $form = $boot->Compile(); $language = $tpl->javascript_parse_text("{language}"); $html = "\n\t<div class=BodyContent>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td valign='top'>{$picture}</td>\n\t\t<td valign='top'>\n\t\t<H1>{myaccount}</H1>\n\t\t<p>{myaccount_text}</p>\n\t\t<div style='text-align:right'>\n\t\t<a href=\"javascript:blur();\" OnClick=\"YahooWin3(500,'{$page}?lang=yes','{$language}');\">\n\t\t{$language}</a> | \n\t\t<a href=\"javascript:blur();\" OnClick=\"YahooWin3(500,'{$page}?privileges=yes','{my_privileges}');\">\n\t\t{my_privileges}</a></div>\n\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t</div>\n\t<div class=BodyContent>\n\t\t{$form}\n\t\t\n\t</div>\n\n\t\n\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }