Esempio n. 1
0
function save()
{
    $main = new maincf_multi($_POST["hostname"]);
    $main->SET_VALUE("EnablePostfixHaProxy", $_POST["EnablePostfixHaProxy"]);
    $sock = new sockets();
    $sock->getFrameWork("postfix.php?happroxy=yes&hostname={$_POST["hostname"]}");
}
Esempio n. 2
0
function save()
{
    $main = new maincf_multi($_POST["hostname"], $_POST["ou"]);
    $main->SET_VALUE("smtpd_banner", $_POST["SMTP_BANNER"]);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-others-values=yes&hostname={$_POST["hostname"]}");
}
Esempio n. 3
0
function save()
{
    $master = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $master->SET_VALUE("PostfixMasterEnableSSL", $_GET["enable_smtps"]);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-multi-mastercf={$_GET["hostname"]}");
}
function popup()
{
    $sock = new sockets();
    $PostfixMultiCreateBubble = $sock->GET_INFO("PostfixMultiCreateBubble");
    if (!is_numeric($PostfixMultiCreateBubble)) {
        $PostfixMultiCreateBubble = 0;
    }
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $EnableSubmission = $main->GET("EnableSubmission");
    $TrustMyNetwork = $main->GET("TrustMyNetwork");
    if (!is_numeric($TrustMyNetwork)) {
        $TrustMyNetwork = 1;
    }
    $EnableSasl = $main->GET("EnableSasl");
    $sasl = Paragraphe_switch_img('{sasl_title}', '{sasl_intro}', 'EnableSasl', $EnableSasl, '{enable_disable}', 300);
    if ($PostfixMultiCreateBubble == 1) {
        $TrustMyNetwork = "<input type=hidden id='TrustMyNetwork' name=\"TrustMyNetwork\" value='{$TrustMyNetwork}'>" . Paragraphe_switch_disable('{TrustMyNetwork}', '{TrustMyNetwork_text}<hr><i style=color:#9E0000>{PostfixMultiCreateBubbleIsEnabled}</i>', '{TrustMyNetwork_text}', 300);
    } else {
        $TrustMyNetwork = Paragraphe_switch_img('{TrustMyNetwork}', '{TrustMyNetwork_text}', 'TrustMyNetwork', $TrustMyNetwork, '{enable_disable}', 300);
    }
    $PostfixEnableSubmission_field = Paragraphe_switch_img('{PostfixEnableSubmission}', '{PostfixEnableSubmission_text}', 'EnableSubmission', $EnableSubmission, '{enable_disable}', 300);
    $old = "" . Paragraphe("64-settings-black.png", "{SASL_STATUS}", "{SASL_STATUS_TEXT}", "javascript:SaslStatus();") . "\n\t\t\t{$settings}\n\t\t\t{$smtpd_sasl_exceptions_networks}";
    $html = "\n\t<div id='sasl-id'>\n\t<table style='width:99%' class=form>\n\t<tbody>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t{$sasl}\n\t\t\t<div style='text-align:right'><hr>" . button("{apply}", "postfix_multi_enable_auth()", 16) . "</div>\n\t\t</td>\n\t<td valign='top'>\n\t\t{$TrustMyNetwork}\n\t\t<div style='text-align:right'><hr>" . button("{apply}", "postfix_multi_enable_auth()", 16) . "</div>\n\t</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2>\n\t\t{$PostfixEnableSubmission_field}\n\t\t<div style='text-align:right'><hr>" . button("{apply}", "postfix_multi_enable_auth()", 16) . "</div>\n\t</td>\n\t</tr>\n\t</tbody>\n\t</table>\n\t</div>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'postfix.sasl.php');
}
function save_transport()
{
    $main = new maincf_multi($_POST["hostname"]);
    $main->SET_VALUE("mailbox_transport", trim(strtolower($_POST["mailbox_transport"])));
    $sock = new sockets();
    $sock->getFrameWork("postfix.php?mailbox-transport=yes&hostname={$_POST["hostname"]}");
}
Esempio n. 6
0
function smtpd_client_restrictions_save()
{
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $EnablePostfixAntispamPack = $_GET["EnablePostfixAntispamPack"];
    $main->SET_BIGDATA("hash_smtp_restrictions", base64_encode(serialize($_GET)));
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-multi-settings={$_GET["hostname"]}");
}
Esempio n. 7
0
function save(){
	$page=CurrentPageName();
	$tpl=new templates();
	$main=new maincf_multi($_GET["hostname"],$_GET["ou"]);
	if($_GET["freeze_delivery_queue"]==1){$main->SET_VALUE("freeze_delivery_queue",0);}else{$main->SET_VALUE("freeze_delivery_queue",1);}
	$sock=new sockets();
	$sock->getFrameWork("cmd.php?postfix-freeze=yes&hostname={$_GET["hostname"]}");
}
function SAVE()
{
    $ou = base64_decode($_GET["ou"]);
    $main = new maincf_multi($_GET["hostname"], $ou);
    $main->SET_VALUE("PostfixHideClientMua", $_GET["PostfixHideClientMua"]);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-multi-settings={$_GET["hostname"]}");
}
Esempio n. 9
0
function SaveForm()
{
    $main = new maincf_multi($_POST["hostname"]);
    $main->SET_VALUE("enable_original_recipient", $_POST["enable_original_recipient"]);
    $main->SET_VALUE("undisclosed_recipients_header", $_POST["undisclosed_recipients_header"]);
    $main->SET_VALUE("smtpd_discard_ehlo_keywords", $_POST["smtpd_discard_ehlo_keywords"]);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-others-values=yes&hostname={$_POST["hostname"]}");
}
function save()
{
    $main = new maincf_multi($_POST["hostname"]);
    if ($_POST["myorigin2"] != null) {
        $_POST["myorigin"] = $_POST["myorigin2"];
    }
    $main->SET_VALUE("myorigin", $_POST["myorigin"]);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-multi-reconfigure={$_POST["hostname"]}");
}
Esempio n. 11
0
function save()
{
    $main = new maincf_multi($_POST["hostname"], $_POST["ou"]);
    $main->SET_VALUE("detect_8bit_encoding_header", $_POST["detect_8bit_encoding_header"]);
    $main->SET_VALUE("disable_mime_output_conversion", $_POST["disable_mime_output_conversion"]);
    $main->SET_VALUE("disable_mime_input_processing", $_POST["disable_mime_input_processing"]);
    $main->SET_VALUE("mime_nesting_limit", $_POST["mime_nesting_limit"]);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-others-values=yes&hostname={$_POST["hostname"]}");
}
Esempio n. 12
0
function popup()
{
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $EnableSubmission = $main->GET("EnableSubmission");
    $EnableSasl = $main->GET("EnableSasl");
    $sasl = Paragraphe_switch_img('{sasl_title}', '{sasl_intro}', 'EnableSasl', $EnableSasl, '{enable_disable}', 390);
    $PostfixEnableSubmission_field = Paragraphe_switch_img('{PostfixEnableSubmission}', '{PostfixEnableSubmission_text}', 'EnableSubmission', $EnableSubmission, '{enable_disable}', 390);
    $old = "" . Paragraphe("64-settings-black.png", "{SASL_STATUS}", "{SASL_STATUS_TEXT}", "javascript:SaslStatus();") . "\n\t\t\t{$settings}\n\t\t\t{$smtpd_sasl_exceptions_networks}";
    $html = "\n\t<div id='sasl-id'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t{$sasl}\n\t\t\t<hr>{$PostfixEnableSubmission_field}\n\t\t\t<div style='text-align:right'>\n\t\t\t<hr>" . button("{edit}", "postfix_multi_enable_auth()") . "\n\t\t\t</div>\n\t\t</td>\n\t<td valign='top'>\n\t\t\n\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, 'postfix.sasl.php');
}
function popup(){
	
$ssl=new ssl_certificate();
	$array=$ssl->array_ssl;
	$styleF="font-size:13px;padding:3px";
	
	
	$main=new maincf_multi($_GET["hostname"],base64_decode($_GET["ou"]));
	$conf=unserialize(base64_decode($main->GET_BIGDATA("certificate_smtp_parameters")));
	
	if($conf["organizationName"]==null){$conf["organizationName"]=base64_decode($_GET["ou"]);}
	
	$users=new usersMenus();
	$tpl=new templates();
	$country_name=Field_array_Hash($ssl->array_country_codes,'countryName',$conf["countryName"],null,null,0,$styleF);	
	$html="<div id='PostfixMultiCertificateDiv'>
	<table style='width:100%'>
	<tr>
		<td class=legend style='font-size:13px'>{countryName}:</td>	
		<td>$country_name</td>
	</tr>
	<tr>
		<td class=legend style='font-size:13px'>{localityName}:</td>
		<td>". Field_text("localityName",$conf["localityName"],$styleF)."</td>
	</tr>
	<tr>
		<td class=legend style='font-size:13px'>{organizationalUnitName}:</td>
		<td>". Field_text("organizationalUnitName",$conf["organizationalUnitName"],$styleF)."</td>
	</tr>
	<tr>
		<td class=legend style='font-size:13px'>{organizationName}:</td>
		<td>". Field_text("organizationName",$conf["organizationName"],$styleF)."</td>
	</tr>	
	
	
		<tr>
		<td class=legend style='font-size:13px'>{emailAddress}:</strong></td>
		<td align='left'>" . Field_text("emailAddress",$conf["emailAddress"],$styleF)  . "</td>
		</tr>
	<tr>
		<td colspan=2 align=right>
			<hr>
				". button("{apply}","PostfixMultiCertificateSave()")."
			</td>
	</tr>	
	</table>
	</div>
	";
	
	echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 14
0
function build_single_instance($ip)
{
    $sql = "SELECT `value`,`ou` FROM postfix_multi WHERE `key`='myhostname' AND `ip_address`='{$ip}'";
    $q = new mysql();
    $unix = new unix();
    $ldap = new clladp();
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    $ou = $ligne["ou"];
    $hostname = $ligne["value"];
    $main = new maincf_multi($hostname, $ou);
    echo "Starting......: dkimproxy {$hostname}\n";
    $freeport = $main->GET("dkimproxy_listenport");
    $array = unserialize(base64_decode($main->GET_BIGDATA("dkimproxy_datas")));
    $unix = new unix();
    $key = "/etc/dkimproxy/{$hostname}/private.key";
    @mkdir("/etc/dkimproxy/{$hostname}", 640, true);
    if (!is_file($key)) {
        echo "Starting......: dkimproxy {$hostname} generating public and private key\n";
        $openssl = $unix->find_program("openssl");
        @mkdir("/etc/dkimproxy/{$hostname}", 640, true);
        shell_exec("{$openssl} genrsa -out /etc/dkimproxy/{$hostname}/private.key 1024");
        shell_exec("{$openssl} rsa -in /etc/dkimproxy/{$hostname}/private.key -pubout -out /etc/dkimproxy/{$hostname}/public.key");
    }
    if ($hostname == "master") {
        $domains = $ldap->AllDomains();
    } else {
        $domains = $ldap->hash_get_domains_ou($ou);
    }
    while (list($dom, $nil) = each($domains)) {
        $dd[] = $dom;
    }
    $conf[] = "# specify what address/port DKIMproxy should listen on";
    $conf[] = "listen    {$ip}:{$freeport}";
    $conf[] = "# specify what address/port DKIMproxy forwards mail to";
    $conf[] = "relay     {$ip}:33560";
    $conf[] = "# specify what domains DKIMproxy can sign for (comma-separated, no spaces)";
    $conf[] = "domain    " . @implode(",", $dd);
    $conf[] = "# specify what signatures to add";
    $conf[] = "signature dkim(c=relaxed)";
    $conf[] = "signature domainkeys(c=nofws)";
    $conf[] = "# specify location of the private key";
    $conf[] = "keyfile   /etc/dkimproxy/{$hostname}/private.key";
    $conf[] = "# specify the selector (i.e. the name of the key record put in DNS)";
    $conf[] = "selector  {$array["selector_name"]}";
    $conf[] = "min_servers 5";
    $conf[] = "min_spare_servers 2";
    $conf[] = "";
    echo "Starting......: dkimproxy {$hostname} generating {$hostname}.conf " . count($dd) . " domain(s)\n";
    @file_put_contents("/etc/dkimproxy/{$hostname}.conf", @implode("\n", $conf));
}
function popup(){

	$page=CurrentPageName();
	$ou=$_GET["ou"];
	$hostname=$_GET["hostname"];
	$main=new maincf_multi($hostname,$ou);
	$array=unserialize(base64_decode($main->GET_BIGDATA("PostfixMultiFetchMail")));	
	$schedule=array(2=>2,5=>5,10=>10,15=>15,20=>20,30=>30,40=>40,50=>50,55=>55);
	if($array[$hostname]["schedule"]==null){$array[$hostname]["schedule"]=10;}
	
	
	$enabled=$array[$hostname]["enabled"];
	$fetchmail_enabled=Paragraphe_switch_img('{enable_fetchmail}','{enable_fetchmail_text}','enable_fetchmail',$enabled,null,270);
	
	$forms="<table style='width:100%'>
	<tr>
	<td colspan=2>$fetchmail_enabled</td>
	</tr>
	<tr>
		<td class=legend style='font-size:14px'>{fetch_messages_every}:</td>
		<td style='font-size:14px'>
		". Field_array_Hash($schedule,
		"schedule",$array[$hostname]["schedule"],null,null,0,"font-size:14px;padding:3px")."&nbsp;(minutes)</td>
	</tr>
	</table>
	
	";
	
	
	$html="
	<table style='width:100%'>
	<tr>
		<td valign='top' width=1%><img src='img/bg_fetchmail2.png'></td>
		<td valign='top'>$forms</td>
	</tr>
	<tr>
	<td colspan=2 align='right'><hr>". button("{apply}","postfix_multi_fetchmail_save()")."</td>
	</tr>
	
	</table>
	
	";
	$tpl=new templates();
	echo $tpl->_ENGINE_parse_body($html);
	
	
}
Esempio n. 16
0
function popup()
{
    $ou = base64_decode($_GET["ou"]);
    $main = new maincf_multi($_GET["hostname"], $ou);
    $page = CurrentPageName();
    $tpl = new templates();
    $PostFixEnableQueueInMemory = $main->GET("PostFixEnableQueueInMemory");
    $PostFixQueueInMemory = $main->GET("PostFixQueueInMemory");
    $enable = Paragraphe_switch_img("{PostFixEnableQueueInMemory}", "{PostFixEnableQueueInMemory_text}", "PostFixEnableQueueInMemory", $PostFixEnableQueueInMemory, null, 350);
    if ($PostFixQueueInMemory == null) {
        $PostFixQueueInMemory = 0;
    }
    $sock = new sockets();
    $datas = unserialize(base64_decode($sock->getFrameWork("cmd.php?postfix-mem-disk-status={$_GET["hostname"]}")));
    $MOUTED = $datas["MOUTED"];
    $TOTAL_MEMORY_MB = $datas["TOTAL_MEMORY_MB"];
    $TOTAL_MEMORY_MB_FREE = $datas["TOTAL_MEMORY_MB_FREE"];
    $html = "\n<table style='width:100%'>\n<td valign='top' width=1%>\n<center>\n\t<img src='img/bg_memory-150.png' id='bg_memory-150'>\n\t<div id='postfix-mem-status'></div>\n</center>\n</td>\n<td valign='top' width=99%>\n{$enable}\n<hr>\n\n<table style='width:100%'>\n<tr>\n<td class=legend style='font-size:16px'>{memory}:</td>\n<td style='font-size:16px'>" . Field_text("PostFixQueueInMemory", $PostFixQueueInMemory, "font-size:16px;padding:5px;width:120px") . "&nbsp;MB/{$TOTAL_MEMORY_MB_FREE}MB</td>\n</tr>\n</table>\n\n<div style='margin:12px;text-align:right'>\t\n\t" . button("{apply}", "PostFixEnableQueueInMemorySave()") . "<hr>\n</div>\n<script>\n\nvar x_PostFixEnableQueueInMemorySave= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\tdocument.getElementById('bg_memory-150').src='img/bg_memory-150.png';\n\tmem_status();\n\t}\n\t\n\t\n\tfunction PostFixEnableQueueInMemorySave(){\n\t\tvar TOTAL_MEMORY_MB_FREE={$TOTAL_MEMORY_MB_FREE};\n\t\tvar mem=document.getElementById('PostFixQueueInMemory').value;\n\t\tif(mem>TOTAL_MEMORY_MB_FREE){\n\t\t\talert(mem+'M >'+TOTAL_MEMORY_MB_FREE+' M');\n\t\t\treturn;\n\t\t}\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('PostFixEnableQueueInMemory',document.getElementById('PostFixEnableQueueInMemory').value);\n\t\tXHR.appendData('PostFixQueueInMemory',document.getElementById('PostFixQueueInMemory').value);\n\t\tXHR.appendData('ou','{$_GET["ou"]}');\n\t\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\t\tdocument.getElementById('bg_memory-150').src='img/wait_verybig.gif';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_PostFixEnableQueueInMemorySave);\n\t\n\t}\n\t\n\tfunction mem_status(){\n\t\tLoadAjax('postfix-mem-status','{$page}?mem-status&hostname={$_GET["hostname"]}&ou={$_GET["ou"]}');\n\t}\n\tmem_status();\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 17
0
function popup()
{
    $ou = $_GET["ou"];
    $hostname = $_GET["hostname"];
    $maincf = new maincf_multi($hostname, $ou);
    $message_size_limit = $maincf->GET("message_size_limit");
    $default_destination_recipient_limit = $maincf->GET("default_destination_recipient_limit");
    $smtpd_recipient_limit = $maincf->GET("smtpd_recipient_limit");
    $mime_nesting_limit = $maincf->GET("mime_nesting_limit");
    $header_address_token_limit = $maincf->GET("header_address_token_limit");
    $virtual_mailbox_limit = $maincf->GET("virtual_mailbox_limit");
    $message_size_limit = $maincf->GET("message_size_limit") / 1024 / 1000;
    $virtual_mailbox_limit = $maincf->GET("virtual_mailbox_limit") / 1024 / 1000;
    $max_rcpt_to = $maincf->GET("max_rcpt_to");
    if ($message_size_limit == null) {
        $message_size_limit = 10240000 / 1024 / 1000;
    }
    if ($virtual_mailbox_limit == null) {
        $virtual_mailbox_limit = 10240000 / 1024 / 1000;
    }
    if ($default_destination_recipient_limit == null) {
        $default_destination_recipient_limit = 50;
    }
    if ($smtpd_recipient_limit == null) {
        $smtpd_recipient_limit = 1000;
    }
    if ($mime_nesting_limit == null) {
        $mime_nesting_limit = 100;
    }
    if ($header_address_token_limit == null) {
        $header_address_token_limit = 10240;
    }
    if (!is_numeric($max_rcpt_to)) {
        $max_rcpt_to = 0;
    }
    $html = "\n\t\t\n\t\t<div id='messages_restriction_id'>\n\t\t<div style='font-size:16px'><strong>{restrictions}</strong></div>\n\t\t<table class=form style='width:100%'>\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{message_size_limit}</strong>:</td>\n\t\t\t    <td style='font-size:13px'>" . Field_text('message_size_limit', $message_size_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;MB</td>\n\t\t\t    <td>" . help_icon('{message_size_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{virtual_mailbox_limit}</strong>:</td>\n\t\t\t    <td style='font-size:13px'>" . Field_text('virtual_mailbox_limit', $virtual_mailbox_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;MB </td>\n\t\t\t    <td>" . help_icon('{virtual_mailbox_limit_text}') . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{max_rcpt_to}</strong>:</td>\n\t\t\t    <td style='font-size:13px'>" . Field_text('max_rcpt_to', $max_rcpt_to, 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;MB</td>\n\t\t\t    <td>" . help_icon('{max_rcpt_to_text}') . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{mime_nesting_limit}</strong>:</td>\n\t\t\t    <td>" . Field_text('mime_nesting_limit', $mime_nesting_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t     <td>" . help_icon('{mime_nesting_limit_text}') . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{header_address_token_limit_field}</strong>:</td>\n\t\t\t    <td>" . Field_text('header_address_token_limit', $header_address_token_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t     <td>" . help_icon('{header_address_token_limit_explain}') . "</td>\n\t\t</tr>\n\t\t</table>\n\t\t\t\t\t\t\n\t\t\n\t\t<div style='font-size:16px'><strong>{performances}</strong></div>\n\t\t<table class=form style='width:100%'>\n\t\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{default_destination_recipient_limit}</strong>:</td>\n\t\t\t    <td>" . Field_text('default_destination_recipient_limit', $default_destination_recipient_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t\t     <td>" . help_icon('{default_destination_recipient_limit_text}') . "</td>\n\t</tr>\n\t\n\t<tr>\n\t\t\t    <td nowrap class=legend style='font-size:13px'>{smtpd_recipient_limit}</strong>:</td>\n\t\t\t    <td>" . Field_text('smtpd_recipient_limit', $smtpd_recipient_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t\t     <td>" . help_icon('{smtpd_recipient_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr><td colspan=2 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t<hr>" . button("{apply}", "MainMultiSaveMessagesRestrictions()") . "\n\t\t</td></tr>\n\t</table>\n\t</div>";
    $tpl = new templates();
    echo $tpl->_parse_body($html);
}
function servers_list()
{
    $tpl = new templates();
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $hash = unserialize(base64_decode($main->GET_BIGDATA("check_client_access")));
    if (!is_array($hash) or count($hash) == 0) {
        json_error_show("no rule");
    }
    $page = 1;
    $search = string_to_flexregex();
    $c = 0;
    while (list($ipaddr, $action) = each($hash)) {
        if (trim($ipaddr) == null) {
            continue;
        }
        if (isset($aL[$ipaddr])) {
            continue;
        }
        $md5 = md5("{$ipaddr}{$action}");
        if ($search != null) {
            if (!preg_match("#{$search}#", $ipaddr)) {
                continue;
            }
        }
        $aL[$md5] = true;
        $img = "48-server.png";
        if ($action == "REJECT") {
            $img = '48-server-ban.png';
        }
        $c++;
        $delete = imgsimple('delete-48.png', '{delete}', "DeleteServer{$_GET["t"]}('{$ipaddr}');");
        $data['rows'][] = array('id' => $md5, 'cell' => array("<span style='font-size:16px;font-weight:bold'><img src='img/{$img}'></a></span>", "<span style='font-size:32px'>{$ipaddr} ({$action})</a></span>", $delete));
    }
    $data['page'] = $page;
    $data['total'] = $c;
    echo json_encode($data);
}
Esempio n. 19
0
function SaveDNSSettings()
{
    $main = new maincf_multi("master", "master");
    $sock = new sockets();
    $sock->SET_INFO("myhostname", $_GET["myhostname"]);
    $main->SET_VALUE("ignore_mx_lookup_error", $_GET["ignore_mx_lookup_error"]);
    $main->SET_VALUE("disable_dns_lookups", $_GET["disable_dns_lookups"]);
    $sock->getFrameWork("cmd.php?postfix-others-values=yes");
}
function main_search()
{
    $MyPage = CurrentPageName();
    $main = new maincf_multi();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $q = new mysql();
    $t = $_GET["t"];
    $table = "sender_dependent_relay_host";
    $searchstring = string_to_flexquery();
    $page = 1;
    $table = "(SELECT * FROM sender_dependent_relay_host WHERE `hostname`='{$_GET["hostname"]}' ORDER by zOrders) as t";
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY `{$_POST["sortname"]}` {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    if ($searchstring != null) {
        $sql = "SELECT COUNT( * ) AS tcount FROM {$table} WHERE 1 {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        if (!$q->ok) {
            json_error_show("Mysql Error [" . __LINE__ . "]: <br>{$q->mysql_error}.<br>{$sql}", 1);
        }
        $total = $ligne["tcount"];
    } else {
        $sql = "SELECT COUNT( * ) AS tcount FROM {$table} WHERE 1 {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        if (!$q->ok) {
            json_error_show("Mysql Error [" . __LINE__ . "]: <br>{$q->mysql_error}.<br>{$sql}", 1);
        }
        $total = $ligne["tcount"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    if (!is_numeric($rp)) {
        $rp = 50;
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} {$ORDER} {$limitSql} ";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        if ($q->mysql_error != null) {
            json_error_show(date("H:i:s") . "<br>SORT:{$_POST["sortname"]}:<br>Mysql Error [L." . __LINE__ . "]: {$q->mysql_error}<br>{$sql}", 1);
        }
    }
    if (mysql_num_rows($results) == 0) {
        json_error_show("no data", 1);
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    $fontsize = "22";
    $free_text = $tpl->javascript_parse_text("{free}");
    $computers = $tpl->javascript_parse_text("{computers}");
    $overloaded_text = $tpl->javascript_parse_text("{overloaded}");
    $orders_text = $tpl->javascript_parse_text("{orders}");
    $directories_monitor = $tpl->javascript_parse_text("{directories_monitor}");
    $dns_destination = $tpl->javascript_parse_text("{direct_mode}");
    $all_others_domains = $tpl->javascript_parse_text("{all_others_domains}");
    while ($ligne = mysql_fetch_assoc($results)) {
        $LOGSWHY = array();
        $overloaded = null;
        $loadcolor = "black";
        $StatHourColor = "black";
        $ColorTime = "black";
        $hostname = $ligne["hostname"];
        $domain = $ligne["domain"];
        $zmd5 = $ligne["zmd5"];
        $relay = $ligne["relay"];
        $relay_port = $ligne["relay_port"];
        $lookups = $ligne["lookups"];
        $relay_text = $main->RelayToPattern($relay, $relay_port, $lookups);
        $icon_grey = "ok32-grey.png";
        $icon_warning_32 = "warning32.png";
        $icon_red_32 = "32-red.png";
        $icon = "ok-32.png";
        $icon_f = $icon_grey;
        if ($ligne["enabled"] == 0) {
            $ColorTime = "#8a8a8a";
        }
        $styleHref = " style='font-size:{$fontsize}px;text-decoration:underline;color:{$ColorTime}'";
        $style = " style='font-size:{$fontsize}px;color:{$ColorTime}'";
        $urijs = "Loadjs('{$MyPage}?item-js=yes&zmd5={$zmd5}&hostname={$hostname}');";
        $link = "<a href=\"javascript:blur();\" OnClick=\"javascript:{$urijs}\" {$styleHref}>";
        $orders = imgtootltip("48-settings.png", null, "Loadjs('artica-meta.menus.php?gpid={$ligne["ID"]}');");
        $delete = imgtootltip("delete-32.png", null, "Loadjs('{$MyPage}?item-delete-js={$zmd5}')");
        $up = imgsimple("arrow-up-32.png", null, "MoveSubRuleLinks{$t}('{$zmd5}','up')");
        $down = imgsimple("arrow-down-32.png", null, "MoveSubRuleLinks{$t}('{$zmd5}','down')");
        if ($ligne["directmode"] == 1) {
            $relay_text = "{$dns_destination}";
        }
        if ($ligne["enabledauth"] == 1) {
            $icon_f = $icon;
        }
        if ($domain == "*") {
            $domain = $all_others_domains;
        }
        $cell = array();
        $cell[] = "<span {$style}>{$link}{$domain}</a></span>";
        $cell[] = "<span {$style}>{$link}{$relay_text}</a></span>";
        $cell[] = "<span {$style}><img src='img/{$icon_f}'></a></span>";
        $cell[] = "<span {$style}>{$up}</a></span>";
        $cell[] = "<span {$style}>{$down}</a></span>";
        $cell[] = "<span {$style}>{$delete}</a></span>";
        $data['rows'][] = array('id' => $ligne['uuid'], 'cell' => $cell);
    }
    echo json_encode($data);
}
Esempio n. 21
0
function EnablePostScreen_edit(){
	writelogs("Saving PostScreen service {$_GET["hostname"]}/{$_GET["ou"]}={$_GET["EnablePostScreen"]}",__FUNCTION__,__FILE__,__LINE__);
	
	$page=CurrentPageName();
	$tpl=new templates();
	$main=new maincf_multi($_GET["hostname"],$_GET["ou"]);
	$main->SET_VALUE("EnablePostScreen",$_GET["EnablePostScreen"]);	
	$sock=new sockets();
	$sock->getFrameWork("cmd.php?postscreen=yes&hostname={$_GET["hostname"]}");
	
}
Esempio n. 22
0
function server_list()
{
    $sock = new sockets();
    $maxSearch = 4;
    $uuid = base64_decode($sock->getFrameWork("cmd.php?system-unique-id=yes"));
    $search_org = $_GET["search-instance"];
    if (preg_match("#(.+?):([0-9]+)#", $search_org, $re)) {
        $search_org = trim($re[1]);
        $maxSearch = $re[2];
    }
    if (strlen($_GET["search-instance"]) > 2) {
        $_GET["search-instance"] = "*{$_GET["search-instance"]}*";
        $_GET["search-instance"] = str_replace("*", "%", $_GET["search-instance"]);
        $_GET["search-instance"] = str_replace("%%", "%", $_GET["search-instance"]);
        $searchq = "AND value LIKE '{$_GET["search-instance"]}'";
    }
    $sql = "SELECT `value`,ip_address FROM postfix_multi WHERE `uuid`='{$uuid}' AND `ou`='{$_GET["ou"]}' AND `key`='myhostname' {$searchq}";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $count = mysql_num_rows($results);
    $formsaerch = "\n\t\t<table style='width:99%' class=form>\n\t\t<tbody>\n\t\t<tr>\n\t\t\t<td class=legend>{search}:</td>\n\t\t\t<td>" . Field_text('instances-search-ou', $search_org, 'font-size:13px;width:110px', null, null, null, false, "InstanceSearchOuCheck(event)") . "</td>\n\t\t</tr>\n\t\t</tbody>\n\t\t</table>\n\t\t\n\t\t";
    if ($searchq == null) {
        if ($count < 5) {
            $formsaerch = null;
        }
    }
    $html = $html . "{$formsaerch}";
    $c = 0;
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $c++;
        if ($c > $maxSearch) {
            break;
        }
        $main = new maincf_multi($ligne["value"], $_GET["ou"]);
        $VirtualHostNameToChange = $main->GET("VirtualHostNameToChange");
        $PostFixEnableAiguilleuse = $main->GET("PostFixEnableAiguilleuse");
        $freeze_delivery_queue = $main->GET('freeze_delivery_queue');
        if ($VirtualHostNameToChange != null) {
            $VirtualHostNameToChange = "<br>{$VirtualHostNameToChange}";
        }
        $img = "48-network-server.png";
        if ($PostFixEnableAiguilleuse == 1) {
            $img = "48-network-server-star.png";
            $server_text = "{router}";
        }
        if ($freeze_delivery_queue == 1) {
            $img = "48-network-server-paused.png";
            $server_text = "{WARN_QUEUE_FREEZE}";
        }
        $servername = $ligne["value"];
        if (strlen($servername) > 17) {
            $servername = substr($servername, 0, 14) . "...";
        }
        $js = "PostfixMultiServerParamsSection('{$ligne["value"]}')";
        $html = $html . "\n\t\t<table style='width:99%;margin-top:10px;padding:10px' class=form>\n\t\t<tbody>\n\t\t<tr >\n\t\t\t<td valign=top width=1% style='padding:5px'>" . imgtootltip($img, "{apply}", $js) . "</td>\n\t\t\t<td valign='top' style='padding:5px'>\n\t\t\t<div>\n\t\t\t\t<strong style='font-size:13px;text-decoration:underline' OnClick=\"javascript:{$js}\" OnMouseOver=\";this.style.cursor='pointer';\" OnMouseOut=\";this.style.cursor='default';\" >{$servername}</strong>\n\t\t\t</div>\n\t\t\t<div style='text-align:right'>\n\t\t\t\t<i style='font-size:11px'>{$server_text} - {$ligne["ip_address"]}{$VirtualHostNameToChange}</i></div>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t</table>\n\t\t<script>RefreshRTMMTable()</script>\n\t\t";
    }
    $ips = GetFreeIps();
    if (is_array($ips)) {
        $html = $html . "\n\t\t<table style='width:99%;margin-top:10px;padding:10px' class=form>\n\t\t<tr " . CellRollOver("AddPostfixMulti()") . ">\n\t\t\t<td valign=top width=1% style='padding:5px'><img src='img/48-network-server-add.png'></td>\n\t\t\t<td valign='top' style='padding:5px'>\n\t\t\t<div>\n\t\t\t\t<strong style='font-size:13px'>{add_mail_server}</strong>\n\t\t\t</div>\n\t\t\t<div><i style='font-size:11px'>{postfix_multi_add_mailserver}</i></div>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t<script>RefreshRTMMTable()</script>\n\t\t";
    } else {
        $html = $html . "\n\t\t<table style='width:99%;margin-top:10px;padding:10px' class=form>\n\t\t<tr>\n\t\t\t<td valign=top width=1% style='padding:5px'><img src='img/48-network-server-add-grey.png'></td>\n\t\t\t<td valign='top' style='padding:5px'>\n\t\t\t<div>\n\t\t\t\t<strong style='font-size:13px'>{add_mail_server}</strong>\n\t\t\t</div>\n\t\t\t<div><i style='font-size:11px'>{postfix_multi_add_mailserver_no_ips}</i></div>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>";
    }
    $html = $html . "\n\t\n\t<script>\n\t\tfunction InstanceSearchOuCheck(e){\n\t\t\tif(checkEnter(e)){InstanceSearchOu();}\n\t\t}\n\t\t\n\t\tfunction InstanceSearchOu(){\n\t\t\tRefreshPostfixMultiList();\n\t\t\n\t\t\n\n\t\t}\n\t</script>\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 23
0
function MultiplesInstances_status()
{
    $unix = new unix();
    $users = new usersMenus();
    $sock = new sockets();
    if (!$users->MILTERGREYLIST_INSTALLED) {
        if ($GLOBALS["DEBUG"]) {
            echo __FUNCTION__ . " NoT installed\n";
        }
        return null;
    }
    $main = new maincf_multi($GLOBALS["hostname"], $GLOBALS["ou"]);
    $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
    $enabled = $array_filters["APP_MILTERGREYLIST"];
    $pid_path = "/var/spool/postfix/var/run/milter-greylist/{$GLOBALS["hostname"]}/greylist.pid";
    if ($GLOBALS["DEBUG"]) {
        echo __FUNCTION__ . "{$GLOBALS["hostname"]} ({$GLOBALS["ou"]}) -> enabled={$enabled}\n";
    }
    $master_pid = trim(@file_get_contents($pid_path));
    if ($GLOBALS["DEBUG"]) {
        echo __FUNCTION__ . "master_pid={$master_pid}\n";
    }
    $l[] = "[MILTER_GREYLIST]";
    $l[] = "service_name=APP_MILTERGREYLIST";
    $l[] = "master_version=" . GetVersionOf("milter-greylist");
    $l[] = "service_cmd=mgreylist";
    $l[] = "service_disabled={$enabled}";
    $l[] = "pid_path={$pid_path}";
    $l[] = "remove_cmd=--milter-grelist-remove";
    if (!$unix->process_exists($master_pid)) {
        $l[] = "running=0";
        $l[] = "";
        echo implode("\n", $l);
        exit;
    }
    $l[] = "running=1";
    $l[] = GetMemoriesOf($master_pid);
    $l[] = "";
    if ($GLOBALS["DEBUG"]) {
        echo __FUNCTION__ . "FINISH\n";
    }
    echo implode("\n", $l);
}
Esempio n. 24
0
function security_postfix(){
	$hostname=$_GET["hostname"];
	$user=new usersMenus();
	$user->LoadModulesEnabled();
	$md=md5($hostname);
	$tpl=new templates();
	$sock=new sockets();
	$page=CurrentPageName();	
	$q=new mysql();
	$main=new maincf_multi($hostname);
	$ou=$main->ou;
	$ou_encoded=base64_encode($ou);
	$spamass=new spamassassin();
	$EnablePostfixMultiInstance=$sock->GET_INFO("EnablePostfixMultiInstance");
	$SpamassassinMaxRCPTScore=$sock->GET_INFO("SpamassassinMaxRCPTScore");
	
	if($hostname=="master"){
		$message_size_limit=$sock->GET_INFO("message_size_limit");
		$max_rcpt_to=$main->GET("max_rcpt_to");
			
	}
	$stylea="style='font-size:13px;text-decoration:underline;font-weight:bold'";
	$GLOBALS["STYLEA"]=$stylea;
	
	
	if(!is_numeric($SpamassassinMaxRCPTScore)){$SpamassassinMaxRCPTScore=10;}
	if(!is_numeric($message_size_limit)){$message_size_limit=10240000;}
	if($message_size_limit==0){$message_size_limit="{unlimited}";}else{
		$message_size_limit=FormatBytes($message_size_limit/1024);
	}
	
	$js_messagelimit="Loadjs('postfix.messages.restriction.php?script=yes');";
	
	
	if(!is_numeric($max_rcpt_to)){$max_rcpt_to=0;}
	if($max_rcpt_to==0){$max_rcpt_to="{unlimited}";}
	
	//regex
	$data=unserialize(base64_decode($main->GET_BIGDATA("header_check")));
	$header_content_filters_rules=0;
	if(is_array($data)){while (list ($num, $ligne) = each ($data)){if($ligne==null){continue;}$header_content_filters_rules++;}}
	if($header_content_filters_rules==0){$header_content_filters_rules="{no_rules}";}else{$header_content_filters_rules="$header_content_filters_rules&nbsp;{rules}";}
	
	
	$check_client_access=0;
	$data=unserialize(base64_decode($main->GET_BIGDATA("check_client_access")));
	if(is_array($data)){while (list ($num, $ligne) = each ($data)){if($ligne==null){continue;}$check_client_access++;}}
	if($check_client_access==0){$check_client_access="{no_rules}";}else{$check_client_access="$check_client_access&nbsp;{rules}";}
		
	
	$EnableBodyChecks=$main->GET("EnableBodyChecks");
	if(!is_numeric($EnableBodyChecks)){$EnableBodyChecks=0;}
	$EnableBodyChecks_text="{disabled}";
	if($EnableBodyChecks==1){$EnableBodyChecks_text="{enabled}";}
	$sql="SELECT COUNT(*) as tcount FROM postfix_regex_words WHERE `hostname`='{$_GET["hostname"]}' AND enabled=1";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$EnableBodyChecks_rules="{no_rules}";}else{$EnableBodyChecks_rules="{$ligne["tcount"]}&nbsp;{rules}";}
	
	$js_iptables="Loadjs('postfix.iptables.php');";
	$js_regex="Loadjs('domains.postfix.multi.regex.php?ou=$ou&hostname=$hostname');";
	
	$EnablePostfixAutoBlock=$sock->GET_INFO("EnablePostfixAutoBlock");
	if(!is_numeric($EnablePostfixAutoBlock)){$EnablePostfixAutoBlock=0;}
	$EnablePostfixAutoBlock_text="{disabled}";
	if($EnablePostfixAutoBlock==1){$EnablePostfixAutoBlock_text="{enabled}";}	
	$sql="SELECT COUNT(*) AS tcount FROM iptables WHERE local_port=25 AND flux='INPUT' AND disable=0";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$PostfixAutoBlock_rules="{no_rules}";}else{$PostfixAutoBlock_rules="{$ligne["tcount"]}&nbsp;{rules}";}	
	
	
	$smtpd_client_restrictions_js="Loadjs('postfix.smtpd_client_restrictions.php');";
	$EnablePostfixAntispamPack_value=$sock->GET_INFO('EnablePostfixAntispamPack');	
	$EnableGenericrDNSClients=$sock->GET_INFO("EnableGenericrDNSClients");
	$reject_forged_mails=$sock->GET_INFO('reject_forged_mails');	
	$PostfixHideClientMua=$sock->GET_INFO("PostfixHideClientMua");
	$PostfixHideClientMua_js="Loadjs('postfix.hide.headers.php')";
	
	$EnablePostfixInternalDomainsCheck=$sock->GET_INFO('EnablePostfixInternalDomainsCheck');
	$RestrictToInternalDomains=$sock->GET_INFO('RestrictToInternalDomains');
	
	$reject_unknown_client_hostname=$sock->GET_INFO('reject_unknown_client_hostname');
	$reject_unknown_reverse_client_hostname=$sock->GET_INFO('reject_unknown_reverse_client_hostname');
	$reject_unknown_sender_domain=$sock->GET_INFO('reject_unknown_sender_domain');
	$reject_invalid_hostname=$sock->GET_INFO('reject_invalid_hostname');
	$reject_non_fqdn_sender=$sock->GET_INFO('reject_non_fqdn_sender');
	
	if($reject_unknown_client_hostname==1){$reject_unknown_client_hostname="{enabled}";}else{$reject_unknown_client_hostname="{disabled}";}
	if($reject_unknown_reverse_client_hostname==1){$reject_unknown_reverse_client_hostname="{enabled}";}else{$reject_unknown_reverse_client_hostname="{disabled}";}
	if($reject_unknown_sender_domain==1){$reject_unknown_sender_domain="{enabled}";}else{$reject_unknown_sender_domain="{disabled}";}
	if($reject_invalid_hostname==1){$reject_invalid_hostname="{enabled}";}else{$reject_invalid_hostname="{disabled}";}
	if($reject_non_fqdn_sender==1){$reject_non_fqdn_sender="{enabled}";}else{$reject_non_fqdn_sender="{disabled}";}
	if($RestrictToInternalDomains==1){$RestrictToInternalDomains="{enabled}";}else{$RestrictToInternalDomains="{disabled}";}
	if($PostfixHideClientMua==1){$PostfixHideClientMua="{enabled}";}else{$PostfixHideClientMua="{disabled}";}
	
	
	
	
	//Postscreen ------------------------------------------------------------------------------------
	$postscreen_js="Loadjs('postscreen.php?hostname=$hostname&ou=$ou');";
	$EnablePostScreen=$main->GET("EnablePostScreen");
	if(!$user->POSTSCREEN_INSTALLED){$EnablePostScreen=0;}
	$postscreen_dnsbl_action=$main->GET("postscreen_dnsbl_action");
	if($EnablePostScreen==1){$EnablePostScreen="{enabled}";$postscreen_dnsbl_action="$postscreen_dnsbl_action";}else{$EnablePostScreen="{disabled}";$postscreen_dnsbl_action="{disabled}";}
	$data=unserialize(base64_decode($main->GET_BIGDATA("postscreen_dnsbl_sites")));
	$postscreen_dnsbl_count=0;
	while (list ($num, $ligne) = each ($data)){if($ligne==null){continue;}$postscreen_dnsbl_count++;}
	if($postscreen_dnsbl_count==0){$postscreen_dnsbl_count="{no_rules}";}else{$postscreen_dnsbl_count="$postscreen_dnsbl_count&nbsp;{rules}";}
	
	
	//milter-greylist {gl_YES-QUICK} ------------------------------------------------------------------------------------
	$mgreylist_js="Loadjs('milter.greylist.index.php?js=yes');";
	$mgreylist=new milter_greylist(true,$hostname,$ou);
	$MilterGreyListEnabled=$mgreylist->MilterGreyListEnabled;
	if(!$user->MILTERGREYLIST_INSTALLED){$MilterGreyListEnabled=0;}
	$mgreylist_delay="{$mgreylist->main_array["greylist"]}&nbsp;{$mgreylist->main_array["greylist_TIME"]}";
	if($MilterGreyListEnabled==1){$MilterGreyListEnabled="{enabled}&nbsp;$mgreylist_delay";}else{$MilterGreyListEnabled="{disabled}";}

	//Blacklist: ------------------------------------------------------------------------------------
	$Blacklist_js="Loadjs('whitelists.admin.php?js=yes')";
	$sql="SELECT COUNT(*) as tcount FROM postfix_global_blacklist WHERE enabled=1";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$Blacklist_rules="{no_rules}";}else{$Blacklist_rules="{$ligne["tcount"]}&nbsp;{rules}";}
	
	//Attachments ------------------------------------------------------------------------------------
	$enable_attachment_blocking_postfix=$main->GET("enable_attachment_blocking_postfix");
	$attachs_js="Loadjs('domains.edit.attachblocking.ou.php?ou=$ou_encoded&hostname=$hostname');";
	if($EnablePostfixMultiInstance){$hostnameq=" AND hostname='$hostname'";}
	$ou_q=$ou;
	if($hostname=="master"){$ou_q="_Global";}
	$sql="SELECT count(*) as tcount FROM smtp_attachments_blocking WHERE ou='$ou_q'$hostnameq";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));	
	if($ligne["tcount"]==0){$attachs_rules="{no_rules}";}else{$attachs_rules="{$ligne["tcount"]}&nbsp;{rules}";}
	if($enable_attachment_blocking_postfix==1){$enable_attachment_blocking_postfix="{enabled}";}else{$enable_attachment_blocking_postfix="{disabled}";}	
	
	//Kas3 ------------------------------------------------------------------------------------
	$ou_kas=$ou;
	if($hostname=="master"){$ou_q=base64_encode("default");$ou_kas="default";}
	$kas_js="Loadjs('domains.edit.kas.php?ou=$ou_q');";
	$kas=new kas_mysql($ou_kas);
	$KasxFilterEnabled=$sock->GET_INFO("KasxFilterEnabled");
	$OPT_FILTRATION_ON=$kas->GET_KEY("OPT_FILTRATION_ON");
	$OPT_PROBABLE_SPAM_ON=$kas->GET_KEY("OPT_PROBABLE_SPAM_ON");
	$ACTION_SPAM_MODE=$kas->GET_KEY("ACTION_SPAM_MODE");
	$ACTION_PROBABLE_MODE=$kas->GET_KEY("ACTION_PROBABLE_MODE");	
	if(!$user->kas_installed){$KasxFilterEnabled=0;}
	if($KasxFilterEnabled==0){$OPT_FILTRATION_ON=0;$OPT_PROBABLE_SPAM_ON=0;}
	$OPT_SPAM_RATE_LIMIT=$kas->GET_KEY("OPT_SPAM_RATE_LIMIT");
	$OPT_SPAM_RATE_LIMIT_TABLE=array(4=>"{maximum}",3=>"{high}",2=>"{normal}",1=>"{minimum}");
	if(!is_numeric($OPT_SPAM_RATE_LIMIT)){$OPT_SPAM_RATE_LIMIT=3;}
	if($OPT_FILTRATION_ON==1){$kas_text="{level}:{$OPT_SPAM_RATE_LIMIT_TABLE[$OPT_SPAM_RATE_LIMIT]}";}else{$kas_text="{disabled}";$ACTION_SPAM_MODE=-4;$ACTION_PROBABLE_MODE=-4;}
	if($OPT_PROBABLE_SPAM_ON==1){$kas_probable="{enabled}";}else{$kas_probable="{disabled}";}	
	$kas_action_message=array(0=>"{acceptmessage}",1=>"{kassendcopy}",2=>"{quarantine}",-1=>"{kasreject}",-3=>"{kasdelete}",-4=>"{disabled}");
	$ACTION_SPAM_MODE=$kas_action_message[$ACTION_SPAM_MODE];
	$ACTION_PROBABLE_MODE=$kas_action_message[$ACTION_PROBABLE_MODE];
	
	

	
	//Amavis - spamassassin
	$EnableAmavisDaemon=$user->EnableAmavisDaemon;
	if(!$user->AMAVIS_INSTALLED){$EnableAmavisDaemon=0;}
	$amavis_js="Loadjs('amavis.index.php?ajax=yes');";
	if($EnablePostfixMultiInstance){$hostnameq=" AND hostname='$hostname'";}
	$ou_q=$ou;
	if($hostname=="master"){$ou_q="_Global";}
	$sql="SELECT count(*) as tcount FROM smtp_attachments_blocking WHERE ou='$ou_q'$hostnameq";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));	
	if($ligne["tcount"]==0){$amavis_attachs_rules="{no_rules}";}else{$amavis_attachs_rules="{$ligne["tcount"]}&nbsp;{rules}";}	
	if($EnableAmavisDaemon==0){$EnableAmavisDaemon_text="{disabled}";}else{$EnableAmavisDaemon_text="{enabled}";}
	
	//Spamassassin - keywords
	$sql="SELECT count(*) as tcount FROM spamassassin_keywords WHERE enabled=1 and score>0";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$spamassassin_keywords="$EnableAmavisDaemon_text&nbsp;{no_rules}";}else{$spamassassin_keywords="$EnableAmavisDaemon_text&nbsp;{$ligne["tcount"]}&nbsp;{rules}";}	
	$spamassassin_keywords_js="Loadjs('spamassassin.keywords.php');";
	
	//spamassassin_backscatter
	$spamassassin_backscatter_js="Loadjs('spamassassin.backscatter.php');";
	$spamassassin_backscatter=$sock->GET_INFO("SpamAssassinVirusBounceEnabled");
	if($EnableAmavisDaemon==0){$spamassassin_backscatter=0;}
	if($spamassassin_backscatter==0){$spamassassin_backscatter="{disabled}";}else{$spamassassin_backscatter="{enabled}";}
	
	$DecodeShortURLs_js="Loadjs('spamassassin.DecodeShortURLs.php');";
	$sql="SELECT COUNT(*) as tcount FROM  spamassassin_table WHERE spam_type='DecodeShortURLs' AND enabled=1";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["tcount"]==0){$DecodeShortURLs="$EnableAmavisDaemon_text&nbsp;{no_rules}";}else{$DecodeShortURLs="$EnableAmavisDaemon_text&nbsp;{$ligne["tcount"]}&nbsp;{rules}";}	
		
	
	//plugins, wrongx, pyzor,razor...
	$spamassassin_js="Loadjs('spamassassin.index.php')";
	$EnableSpamassassinWrongMX=$sock->GET_INFO("EnableSpamassassinWrongMX");
	if(!is_numeric($EnableSpamassassinWrongMX)){$EnableSpamassassinWrongMX=1;}
	if($EnableAmavisDaemon==0){$EnableSpamassassinWrongMX=0;}
	if($EnableSpamassassinWrongMX==0){$EnableSpamassassinWrongMX="{disabled}";}else{$EnableSpamassassinWrongMX="{enabled}";}
	
	$use_razor2=$spamass->main_array["use_razor2"];
	if($EnableAmavisDaemon==0){$use_razor2=0;}
	if($use_razor2==0){$use_razor2="{disabled}";}else{$use_razor2="{enabled}";}
	
	$use_pyzor=$spamass->main_array["use_pyzor"];
	if($EnableAmavisDaemon==0){$use_pyzor=0;}
	if($use_pyzor==0){$use_pyzor="{disabled}";}else{$use_pyzor="{enabled}";}	
	
	$amavis=new amavis();
	$amavis_action1="{pass}";
	$amavis_action2="{pass}";
	$amavis_spam="$EnableAmavisDaemon_text&nbsp;{score} >={$amavis->main_array["BEHAVIORS"]["sa_tag3_level_deflt"]}";
	if($amavis->EnableQuarantineSpammy2==1){$amavis_action1="{quarantine}";}

	$amavis_probable="$EnableAmavisDaemon_text&nbsp;{score} >={$amavis->main_array["BEHAVIORS"]["sa_tag2_level_deflt"]}";
	if($amavis->EnableQuarantineSpammy==1){$amavis_action2="{quarantine}";}
	
	$clamav_unofficial_js="Loadjs('clamav.unofficial.php')";
	
	
	$html="
	<div style='text-align:right'>". imgtootltip("refresh-24.png","{refresh}","RefreshTab('main_config_postfix_synthesis_$md')")."</div>
	<H3 style='font-size:16px'>{APP_POSTFIX} &raquo; {filters_connect}</h3>
	<table style='width:665px' class=form>
		<tr>
			<td class=legend width='350px'>{postfix_autoblock}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_iptables\" $stylea>$EnablePostfixAutoBlock_text&nbsp;$PostfixAutoBlock_rules</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{firewall}</td>
		</tr>	
		<tr>
			<td class=legend width='350px'>{black list}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$Blacklist_js\" $stylea>$Blacklist_rules</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>				
		<tr>
			<td class=legend width='350px'>PostScreen:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$postscreen_js\" $stylea>$EnablePostScreen</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>		
		<tr>
			<td class=legend width='350px'>PostScreen RBL:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$postscreen_js\" $stylea>$postscreen_dnsbl_action&nbsp;$postscreen_dnsbl_count</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>			
		<tr>
			<td class=legend width='350px'>{blockips}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_regex\" $stylea>$check_client_access</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>
		
		<tr>
			<td class=legend width='350px'>{reject_unknown_client_hostname}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_unknown_client_hostname</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>
		<tr>
			<td class=legend width='350px'>{reject_unknown_reverse_client_hostname}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_unknown_reverse_client_hostname</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>		
		<tr>
			<td class=legend width='350px'>{reject_unknown_sender_domain}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_unknown_sender_domain</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>			
		<tr>
			<td class=legend width='350px'>{reject_invalid_hostname}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_invalid_hostname</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>		
		<tr>
			<td class=legend width='350px'>{reject_non_fqdn_sender}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_non_fqdn_sender</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>	
		<tr>
			<td class=legend width='350px'>{RestrictToInternalDomains}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$RestrictToInternalDomains</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
		</tr>
	</table>
	
	<H3 style='font-size:16px'>{filters_connect}</h3>
	<table style='width:665px' class=form>
		<tr>
			<td class=legend width='350px'>{gl_YES-QUICK}:</td>
			<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$mgreylist_js\" $stylea>$MilterGreyListEnabled</a></td>
			<td width=1% nowrap><strong style='font-size:13px'>{delayed}</td>
		</tr>	
	</table>
	
	<H3 style='font-size:16px'>{APP_POSTFIX} &raquo; {messages_restriction}</h3>
	<table style='width:665px' class=form>
	". _MaxRcptTO($hostname)."
	<tr>
		<td class=legend width='350px'>{message_size_limit}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_messagelimit\" $stylea>$message_size_limit</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{HIDE_CLIENT_MUA}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$PostfixHideClientMua_js\" $stylea>$PostfixHideClientMua</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{pass}</td>
	</tr>
	
	
	</table>
	<H3 style='font-size:16px'>{APP_POSTFIX} &raquo; {content_filters}</h3>
	<table style='width:665px' class=form>
	<tr>
		<td class=legend width='350px'>{header_content_filters_rules}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_regex\" $stylea>$header_content_filters_rules</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{RegexSimpleWords}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_regex\" $stylea>$EnableBodyChecks_text&nbsp;$EnableBodyChecks_rules</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{attachment_blocking}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$attachs_js\" $stylea>$enable_attachment_blocking_postfix&nbsp;$attachs_rules</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{reject}</td>
	</tr>	
	</table>
	<H3 style='font-size:16px'>{content_filters} &raquo; {APP_KAS3}</h3>
	<table style='width:665px' class=form>
	<tr>
		<td class=legend width='350px'>{APP_KAS3}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$kas_text</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>&nbsp;</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{OPT_PROBABLE_SPAM_ON}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$kas_probable</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>&nbsp;</td>
	</tr>
	<tr>
		<td class=legend width='350px'>{spam option 2}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$ACTION_PROBABLE_MODE</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>&nbsp;</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{spam option 1}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$ACTION_SPAM_MODE</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>&nbsp;</td>
	</tr>		
	
</table>
	<H3 style='font-size:16px'>{content_filters} &raquo; {addons_bundle}</h3>
<table style='width:665px' class=form>
	<tr>
		<td class=legend width='350px'>{attachment_blocking}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$EnableAmavisDaemon_text&nbsp;$amavis_attachs_rules</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{quarantine}</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{block_keywords}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_keywords_js\" $stylea>$spamassassin_keywords</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{Virus_Bounce_Ruleset}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_backscatter_js\" $stylea>$spamassassin_backscatter</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{DecodeShortURLs}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$DecodeShortURLs_js\" $stylea>$DecodeShortURLs</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>		
	<tr>
		<td class=legend width='350px'>WrongMX:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_js\" $stylea>$EnableSpamassassinWrongMX</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>		
	<tr>
		<td class=legend width='350px'>Razor:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_js\" $stylea>$use_razor2</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>Pyzor:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_js\" $stylea>$use_pyzor</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{score}+</td>
	</tr>	
	<tr>
		<td class=legend width='350px'>{spam option 2}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$amavis_js\" $stylea>$amavis_probable</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>$amavis_action2</td>
	</tr>			
	<tr>
		<td class=legend width='350px'>{spam option 1}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$amavis_js\" $stylea>$amavis_spam</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>$amavis_action1</td>
	</tr>
	<tr>
		<td class=legend width='350px'>{APP_CLAMAV}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$amavis_js\" $stylea>$EnableAmavisDaemon_text</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{quarantine}</td>
	</tr>		
	<tr>
		<td class=legend width='350px'>{clamav_unofficial}:</td>
		<td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$clamav_unofficial_js\" $stylea>$EnableAmavisDaemon_text</a></td>
		<td width=1% nowrap><strong style='font-size:13px'>{quarantine}</td>
	</tr>			

	

	
</table>	
	
	
	";
	
	echo $tpl->_ENGINE_parse_body($html);
	
}
Esempio n. 25
0
function instances_duplicate_perform(){
	$tpl=new templates();
	$tcp=new IP();
	$q=new mysql();
	$sock=new sockets();
	$instance_hostname=$_GET["hostname"];
	$instance_src_hostname=$_GET["src"];
	$main=new maincf_multi($instance_src_hostname);
	$novirtual=false;
	
	$instance_ip=$_GET["ip"];
	$instance_ip_src=$main->ip_addr;
	if($instance_ip_src==null){echo $tpl->javascript_parse_text("\"$instance_src_hostname\" No such instance");return;}
	
	$organization=$_GET["ou"];
	if($organization==null){
	echo $tpl->javascript_parse_text("{error_choose_organization}");return;}
	
	
	if(trim($instance_hostname)==null){echo $tpl->javascript_parse_text("{instance_server_name}: NULL");return;}
	if(!$tcp->isValid($instance_ip)){echo $tpl->javascript_parse_text("{ipaddr}: \"$instance_ip\" Invalid");return;}
	if(!$tcp->isValid($instance_ip_src)){echo $tpl->javascript_parse_text("{ipaddr}: \"$instance_ip_src\" Invalid");return;}
	$main=new maincf_multi(null,null,$instance_ip);
	if($main->myhostname<>null){echo $tpl->javascript_parse_text("{ipaddr}: \"$instance_ip\" {already_used} -> $main->myhostname");return;}
	$main=new maincf_multi($instance_hostname,null,null);
	if($main->ip_addr<>null){echo $tpl->javascript_parse_text("{hostname}: \"$instance_hostname\" {already_used} -> $main->ip_addr");return;}
	
	$sql="SELECT ipaddr FROM nics_virtuals WHERE ipaddr='$instance_ip'";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["ipaddr"]<>null){echo $tpl->javascript_parse_text("{ipaddr}: \"$instance_ip\" {already_used} -> {virtual_interfaces}");return;}
	
	$sql="SELECT ipaddr FROM nics_vlan WHERE ipaddr='$instance_ip'";
	$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
	if($ligne["ipaddr"]<>null){
		writelogs("Associated to a vlan -> unset Contruct virtuals addresses",__FUNCTION__,__FILE__,__LINE__);
		$novirtual=true;
	}
	
	
	$PING=trim($sock->getFrameWork("cmd.php?ping=".urlencode($instance_ip)));
	if($PING=="TRUE"){
		echo $tpl->javascript_parse_text("$instance_ip:\n{ip_already_exists_in_the_network}");
		return;
	}	
	
	
	if(!$novirtual){
		writelogs("No virtual: FALSE",__FUNCTION__,__FILE__,__LINE__);
		$instance_ip_tbl=explode(".",$instance_ip);
		unset($instance_ip_tbl[count($instance_ip_tbl)-1]);
		$net=@implode(".",$instance_ip_tbl);
		writelogs("virtual: net -> $net",__FUNCTION__,__FILE__,__LINE__);
	
		$sql="SELECT * FROM nics_virtuals WHERE ipaddr LIKE '$net.%' ORDER BY ID DESC LIMIT 0,1";
		$ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup"));
		if($ligne["ipaddr"]==null){echo $tpl->javascript_parse_text("{ipaddr}: \"$net*\" {no_such_interfaces} -> {virtual_interfaces}\n{you_need_to_create_virtual_ip_first}");return;}
		writelogs("$net.* {$ligne["nic"]} -> $instance_ip/{$ligne["netmask"]}",__FUNCTION__,__FILE__,__LINE__);
		
		$sql="INSERT INTO nics_virtuals (nic,org,ipaddr,netmask,cdir,gateway) 
		VALUES('{$ligne["nic"]}','$organization','$instance_ip','{$ligne["netmask"]}','{$ligne["cdir"]}','{$ligne["gateway"]}');";	
		$q=new mysql();
		$q->QUERY_SQL($sql,"artica_backup");
		
		if(!$q->ok){
			writelogs("virtual:ERROR $q->mysql_error",__FUNCTION__,__FILE__,__LINE__);
			echo $q->mysql_error;
			return;
		}
		
		
	}
		writelogs("All are OK -> starting importation",__FUNCTION__,__FILE__,__LINE__);

	$sql="SELECT `key`,`value`,`ValueTEXT`,`uuid` FROM `postfix_multi` WHERE `ip_address`='$instance_ip_src'";
	$results=$q->QUERY_SQL($sql,"artica_backup");	
	while($ligne=@mysql_fetch_array($results,MYSQL_ASSOC)){	
		$key=$ligne["key"];
		$value=$ligne["value"];
		$ValueTEXT=$ligne["ValueTEXT"];
		$uuid=$ligne["uuid"];
		if($key=="inet_interfaces"){continue;}
		if($key=="myhostname"){continue;}
		$value=addslashes($value);
		$ValueTEXT=addslashes($ValueTEXT);
		$sql="INSERT INTO `postfix_multi`
		(`key`,`value`,`ValueTEXT`,`uuid`,`ou`,`ip_address`)
		VALUES('$key','$value','$ValueTEXT','$uuid','$organization','$instance_ip')";
		writelogs($sql,__FUNCTION__,__FILE__,__LINE__);
		$q->QUERY_SQL($sql,"artica_backup");
		if(!$q->ok){
			echo $q->mysql_error;
			FailedIP($instance_ip);
			return;
		}
	}
	
$sql="INSERT INTO `postfix_multi`
		(`key`,`value`,`uuid`,`ou`,`ip_address`)
		VALUES('inet_interfaces','$instance_ip','$uuid','$organization','$instance_ip')";
	writelogs($sql,__FUNCTION__,__FILE__,__LINE__);
	$q->QUERY_SQL($sql,"artica_backup");
	
	if(!$q->ok){echo $q->mysql_error;FailedIP($instance_ip);return;}
	
$sql="INSERT INTO `postfix_multi`
		(`key`,`value`,`uuid`,`ou`,`ip_address`)
		VALUES('myhostname','$instance_hostname','$uuid','$organization','$instance_ip')";		
	writelogs($sql,__FUNCTION__,__FILE__,__LINE__);
	$q->QUERY_SQL($sql,"artica_backup");
	if(!$q->ok){echo $q->mysql_error;FailedIP($instance_ip);return;}

	$main=new maincf_multi(null,null,$instance_ip);	
	$main->SET_VALUE("VirtualHostNameToChange",$instance_hostname);		
	
	
}
function PostFixVerifyDatabaseSave()
{
    $hostname = $_POST["hostname"];
    unset($_POST["hostname"]);
    $main = new maincf_multi($hostname);
    while (list($num, $ligne) = each($_POST)) {
        $main->SET_VALUE($num, $ligne);
    }
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-others-values=yes&hostname={$_POST["hostname"]}");
}
function ajax_pop()
{
    $sock = new sockets();
    $users = new usersMenus();
    $users->LoadModulesEnabled();
    $EnableAmavisDaemon = $users->EnableAmavisDaemon;
    if (!$users->AMAVIS_INSTALLED) {
        $EnableAmavisDaemon = 0;
    }
    if (!is_numeric($EnableAmavisDaemon)) {
        $EnableAmavisDaemon = 0;
    }
    $EnableArticaPolicyFilter = $sock->GET_INFO("EnableArticaPolicyFilter");
    $EnableArticaPolicyFilter = 0;
    if (!is_numeric($EnableArticaPolicyFilter)) {
        $EnableArticaPolicyFilter = 0;
    }
    $ArticaPolicyFilterMaxRCPTInternalDomainsOnly = $sock->GET_INFO("ArticaPolicyFilterMaxRCPTInternalDomainsOnly");
    $SpamassassinMaxRCPTScore = $sock->GET_INFO("SpamassassinMaxRCPTScore");
    $page = CurrentPageName();
    $main = new main_cf();
    $main->FillDefaults();
    $message_size_limit = $sock->GET_INFO("message_size_limit");
    $main->main_array["default_destination_recipient_limit"] = $sock->GET_INFO("default_destination_recipient_limit");
    $main->main_array["smtpd_recipient_limit"] = $sock->GET_INFO("smtpd_recipient_limit");
    $main->main_array["mime_nesting_limit"] = $sock->GET_INFO("mime_nesting_limit");
    $PostfixNotifyMessagesRestrictions = $sock->GET_INFO("PostfixNotifyMessagesRestrictions");
    $main = new maincf_multi("master", "master");
    $header_address_token_limit = $sock->GET_INFO("header_address_token_limit");
    $header_size_limit = $sock->GET_INFO("header_size_limit");
    $max_rcpt_to = $main->GET("max_rcpt_to");
    if (!is_numeric($message_size_limit)) {
        $message_size_limit = 10240000;
    }
    $main->main_array["virtual_mailbox_limit"] = $sock->GET_INFO("virtual_mailbox_limit");
    $message_size_limit = $message_size_limit / 1024 / 1000;
    $main->main_array["virtual_mailbox_limit"] = $main->main_array["virtual_mailbox_limit"] / 1024 / 1000;
    if (!is_numeric($header_address_token_limit)) {
        $header_address_token_limit = 10240;
    }
    if (!is_numeric($header_size_limit)) {
        $header_size_limit = 102400;
    }
    if (!is_numeric($max_rcpt_to)) {
        $max_rcpt_to = 0;
    }
    if (!is_numeric($PostfixNotifyMessagesRestrictions)) {
        $PostfixNotifyMessagesRestrictions = 0;
    }
    $header_size_limit = $header_size_limit / 1024;
    if (!is_numeric($SpamassassinMaxRCPTScore)) {
        $SpamassassinMaxRCPTScore = 10;
    }
    $html = "\n\t\t\n\t\t<div id='messages_restriction_id'>\n\t\t\n\t\t\n\n\t\n\n\n\t\t<div style='font-size:16px'><strong>{max_rcpt_to}</strong></div>\n\t\t<table class=form style='width:99%'>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{max_rcpt_to}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('max_rcpt_to', $max_rcpt_to, 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;{recipients} </td>\n\t\t\t<td>" . help_icon('{max_rcpt_to_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{max_rcpt_to_onlyForLocalDomains}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_checkbox("ArticaPolicyFilterMaxRCPTInternalDomainsOnly", 1, $ArticaPolicyFilterMaxRCPTInternalDomainsOnly, "ArticaPolicyFilterMaxRCPTInternalDomainsOnlySave()") . "</td>\n\t\t\t<td>" . help_icon('{max_rcpt_to_onlyForLocalDomains_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{score}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('SpamassassinMaxRCPTScore', $SpamassassinMaxRCPTScore, 'width:40px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t\t<td>" . help_icon('{SpamassassinMaxRCPTScore_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=3 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t\t" . button("{apply}", "SaveMessagesRestrictions()") . "</td>\n\t\t</tr>\n\t\t</table>\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t<div style='font-size:16px'><strong>{restrictions}</strong></div>\n\t\t<table class=form style='width:99%'>\n\n\t\t\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{message_size_limit}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('message_size_limit', $message_size_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;MB</td>\n\t\t\t<td>" . help_icon('{message_size_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{virtual_mailbox_limit}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('virtual_mailbox_limit', $main->main_array["virtual_mailbox_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;MB </td>\n\t\t\t<td>" . help_icon('{virtual_mailbox_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{mime_nesting_limit}</strong>:</td>\n\t\t\t<td>" . Field_text('mime_nesting_limit', $main->main_array["mime_nesting_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t<td>" . help_icon('{mime_nesting_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{header_address_token_limit_field}</strong>:</td>\n\t\t\t<td>" . Field_text('header_address_token_limit', $header_address_token_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t<td>" . help_icon('{header_address_token_limit_explain}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{header_size_limit}:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('header_size_limit', $header_size_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . "&nbsp;KB </td>\n\t\t\t<td>" . help_icon('{header_size_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{notify}:</td>\n\t\t\t<td style='font-size:13px'>" . Field_checkbox("PostfixNotifyMessagesRestrictions", 1, $PostfixNotifyMessagesRestrictions, "PostfixNotifyMessagesRestrictionsSave()") . "</td>\n\t\t\t<td>" . help_icon('{PostfixNotifyMessagesRestrictions_text}') . "</td>\n\t\t</tr>\n\t<tr>\n\t<td colspan=3 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t" . button("{apply}", "SaveMessagesRestrictions()") . "</td>\n\t</tr>\t\t\n\t\t</table>\n\t\t\n\t\t\n\t<div style='font-size:16px'><strong>{performances}</strong></div>\n\t<table class=form style='width:99%'>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:13px'>{default_destination_recipient_limit}</strong>:</td>\n\t\t<td>" . Field_text('default_destination_recipient_limit', $main->main_array["default_destination_recipient_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t<td>" . help_icon('{default_destination_recipient_limit_text}') . "</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:13px'>{smtpd_recipient_limit}</strong>:</td>\n\t\t<td>" . Field_text('smtpd_recipient_limit', $main->main_array["smtpd_recipient_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t<td>" . help_icon('{smtpd_recipient_limit_text}') . "</td>\n\t</tr>\n\n\n\n\t<tr>\n\t<td colspan=3 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t" . button("{apply}", "SaveMessagesRestrictions()") . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\nvar x_SaveMessagesRestrictions=function (obj) {\n\ttempvalue=obj.responseText;\n\tYahooWinSHide();\n    }\t\n\t\nfunction SaveMessagesRestrictions(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('header_size_limit',document.getElementById('header_size_limit').value);\n\tXHR.appendData('message_size_limit',document.getElementById('message_size_limit').value);\n\tXHR.appendData('default_destination_recipient_limit',document.getElementById('default_destination_recipient_limit').value);\n\tXHR.appendData('smtpd_recipient_limit',document.getElementById('smtpd_recipient_limit').value);\n\tXHR.appendData('mime_nesting_limit',document.getElementById('mime_nesting_limit').value);\n\tXHR.appendData('header_address_token_limit',document.getElementById('header_address_token_limit').value);\n\tXHR.appendData('virtual_mailbox_limit',document.getElementById('virtual_mailbox_limit').value);\n\tXHR.appendData('max_rcpt_to',document.getElementById('max_rcpt_to').value);\n\tXHR.appendData('SpamassassinMaxRCPTScore',document.getElementById('SpamassassinMaxRCPTScore').value);\n\t\n\t\n\t\n\tdocument.getElementById('messages_restriction_id').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';\n\tXHR.sendAndLoad('{$page}', 'GET',x_SaveMessagesRestrictions);\n}\t\n\nfunction PostfixNotifyMessagesRestrictionsSave(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('PostfixNotifyMessagesRestrictions').checked){\n\t\tXHR.appendData('PostfixNotifyMessagesRestrictions',1);\n\t}else{\n\t\tXHR.appendData('PostfixNotifyMessagesRestrictions',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'GET');\n}\n\nfunction ArticaPolicyFilterMaxRCPTInternalDomainsOnlySave(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('ArticaPolicyFilterMaxRCPTInternalDomainsOnly').checked){\n\t\tXHR.appendData('ArticaPolicyFilterMaxRCPTInternalDomainsOnly',1);\n\t}else{\n\t\tXHR.appendData('ArticaPolicyFilterMaxRCPTInternalDomainsOnly',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'GET');\n}\n\n\nfunction CheckRequiredRestrictionsFields(){\n\tvar EnableArticaPolicyFilter={$EnableAmavisDaemon};\n\tif(EnableArticaPolicyFilter==0){\n\t\tdocument.getElementById('ArticaPolicyFilterMaxRCPTInternalDomainsOnly').disabled=true;\n\t\tdocument.getElementById('SpamassassinMaxRCPTScore').disabled=true;\n\t}\n}\n\n\nCheckRequiredRestrictionsFields();\n</script>\n\t\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_parse_body($html);
}
Esempio n. 28
0
function EnablePOSTFWD2()
{
    $main = new maincf_multi($_GET["instance"]);
    $array_filters = unserialize(base64_decode($main->GET_BIGDATA("PluginsEnabled")));
    $array_filters["APP_POSTFWD2"] = $_GET["EnablePOSTFWD2"];
    $main->SET_BIGDATA("PluginsEnabled", base64_encode(serialize($array_filters)));
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfwd2-restart={$_GET["instance"]}");
}
function relayhostSave()
{
    $ou = $_GET["ou"];
    $hostname = $_GET["hostname"];
    $tpl = new templates();
    if ($_GET["relay_port"] == null) {
        $_GET["relay_port"] = 25;
    }
    if ($_GET["relay_address"] == null) {
        echo $tpl->_ENGINE_parse_body("{error_no_server_specified}");
        exit;
    }
    $tool = new DomainsTools();
    writelogs("Port={$_GET["relay_port"]} address={$_GET["relay_address"]}", __FUNCTION__, __FILE__);
    $data = $tool->transport_maps_implode($_GET["relay_address"], $_GET["relay_port"], 'smtp', $_GET["MX_lookups"]);
    writelogs("Port={$_GET["relay_port"]} address={$_GET["relay_address"]}={$data}", __FUNCTION__, __FILE__);
    $data = str_replace('smtp:', '', $data);
    //smtp_sasl_password_maps
    $main = new maincf_multi($hostname, $ou);
    if ($_GET["username"] != null) {
        $auth = "{$_GET["username"]}:{$_GET["password"]}";
        $main->SET_VALUE("relayhost_authentication", $auth);
    }
    $main->SET_VALUE("relayhost", $data);
    $sock = new sockets();
    $sock->getFrameWork("cmd.php?postfix-multi-relayhost={$_GET["hostname"]}");
}
Esempio n. 30
0
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}: &laquo;{$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}: &laquo;{$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}: &laquo;{$_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}: &laquo;{$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 = "&nbsp;{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 = "&nbsp;{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 = "&nbsp;{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 = "&nbsp;{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}&raquo;\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);
}