本文整理汇总了PHP中clladp::hash_get_domains_ou方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::hash_get_domains_ou方法的具体用法?PHP clladp::hash_get_domains_ou怎么用?PHP clladp::hash_get_domains_ou使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clladp
的用法示例。
在下文中一共展示了clladp::hash_get_domains_ou方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: INDEX
function INDEX()
{
$ldap = new clladp();
$ou = $_GET["ou"];
$Hash_datas = $ldap->OUDatas($ou);
$h_type = array("spam" => "spam", "ham" => "ham");
$domains1 = $ldap->hash_get_domains_ou($ou);
$domainsF1 = Field_array_Hash($domains1, 'bogo_spam_domain', null, null, null, 0, 'width:150px');
$type = Field_array_Hash($h_type, 'bogo_type', null, null, null, 0, 'width:100px');
$hash_action = array("delete" => "{bogo_delete}", "quarantine" => "{bogo_quarantine}", "prepend" => "{bogo_prepend}");
$form_email = "\n\t<input type='hidden' id='ou' value='{$ou}'>\n\t<H5>{bogo_robots}</H5>\n\t<table style='width:100%'>\n\t<tr>\n\t<td align='right' nowrap><strong>{add_bogo_spam}:</strong></td>\n\t<td>" . Field_text('bogo_spam') . "</td>\n\t<td>{$domainsF1}</td>\n\t<td>{$type}</td>\n\t<td><input type='button' value='{add} »' OnClick=\"javascript:bogoAddSpamUser();\"></td>\n\t</tr>\n\t</table>\n\t\n\t";
for ($i = 1; $i < 10; $i++) {
$h_level[$i . '0'] = $i . '0 %';
}
$actions_datas = explode(';', $Hash_datas["BogoFilterAction"]);
$action = "\n\t<H5>{spam_action}</H5>\n\t{spam_action_text} " . Field_array_Hash($h_level, 'exceed', $actions_datas[0], null, null, 0, 'width:60px') . " {then} " . Field_array_Hash($hash_action, 'action', $actions_datas[1], null, null, 0, 'width:160px') . "<br><br>\n\t{if_bogo_prepend} " . Field_text('bogo_prepend', $actions_datas[2], 'width:150px') . "\n\t<div style='width:100%;text-align:right'><input type='button' value='{edit} »»' OnClick=\"javascript:BogoFilterAction();\"></div>\n\t\n\t";
$area_robots = "<div id='robots'></div><script>LoadAjax('robots','{$page}?GetRobots={$ou}')</script>";
$area_robots = RoundedLightGrey($area_robots);
$action = RoundedLightGrey($action);
$form_email = RoundedLightGrey($form_email);
$page = CurrentPageName();
$html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/bg_bogofilter.jpg'></td>\n\t<td valign='top' width=99%>" . RoundedLightGreen("{bogo_intro}") . "</td>\n\t</tr>\n\t</table>\n\t{$form_email}\n\t<br>\n\t{$action}\n\t<br>\n\t{$area_robots}\n\t";
$cfg["JS"][] = "js/bogofilter.js";
$tpl = new template_users('{APP_BOGOFILTER}', $html, 0, 0, 0, 0, $cfg);
echo $tpl->web_page;
}
示例2: page_1
function page_1()
{
if ($_COOKIE["company"] == null) {
$ldap = new clladp();
$orgs = $ldap->hash_get_ou(false);
$company = $orgs[0];
} else {
$company = $_COOKIE["company"];
}
$field_domain = Field_text('smtp_domain', $_COOKIE["smtp_domain"]);
if ($_COOKIE["smtp_domain"] == null) {
$sock = new sockets();
if ($sock->GET_INFO("MasterSMTPDomainName") == null) {
$ldap = new clladp();
$domains = $ldap->hash_get_domains_ou($company);
if (is_array($domains)) {
$field_domain = Field_array_Hash($domains, 'smtp_domain');
}
} else {
$field_domain = Field_text('smtp_domain', $sock->GET_INFO("MasterSMTPDomainName"));
}
}
$html = "\n\t<p class=caption>{company_domain}</p>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend nowrap>{company}:</td>\n\t\t<td>" . Field_text('company', $company) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap>{smtp_domain}:</td>\n\t\t<td>{$field_domain}</td>\n\t</tr>\t\n\t</table>\n\t\n\t\n\t\n\t";
echo BuildPage('{company_domain_t}', $html);
}
示例3: INDEX_CREATE
function INDEX_CREATE()
{
$ldap = new clladp();
if ($_GET["ou"] == null) {
die;
}
$_GET["ou"] = base64_decode($_GET["ou"]);
$hash = $ldap->hash_groups($_GET["ou"], 1);
$domains = $ldap->hash_get_domains_ou($_GET["ou"]);
if (count($domains) == 0) {
$users = new usersMenus();
if ($users->POSTFIX_INSTALLED) {
$field_domains = Field_text('user_domain', "{$_GET["ou"]}.com", "width:85px");
} else {
if (!preg_match("#(.+?)\\.(.+)#", $_GET["ou"])) {
$dom = "{$_GET["ou"]}.com";
} else {
$dom = "{$_GET["ou"]}";
}
$field_domains = "<code><strong>{$dom}</strong></code>" . Field_hidden('user_domain', "{$dom}", "width:120px");
}
} else {
$field_domains = Field_array_Hash($domains, 'user_domain', "style:font-size:18px;padding:3px");
}
$tpl = new templates();
$hash[null] = "{select}";
$groups = Field_array_Hash($hash, 'group_id', $_GET["gpid"], "style:font-size:18px;padding:3px");
$error_no_password = $tpl->javascript_parse_text("{error_no_password}");
$error_no_userid = $tpl->javascript_parse_text("{error_no_userid}");
$t = time();
$title = "{$_GET["ou"]}:{create_user}";
$step1 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(1)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre1_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{name_the_new_account_title}:</div>\n\t" . Field_text('new_userid', null, "font-size:18px;padding:3px;font-weight:bold;color:#C80000", null, "UserAutoChange_eMail()", null, false, "UserADDCheck(event)") . "\n\n\t</td>\n\t</tr>\n\t</table></div>";
$step2 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(2)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre2_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{email}</div><br>\n\t<input type='hidden' name='email' value='' id='email'>\n\t<span id='prefix_email' style='width:90px;border:1px solid #CCCCCC;padding:2px;font-size:18px;font-weight:bold;margin:2px'>\n\t</span>@{$field_domains} \n\t<div style='text-align:right;font-size:14px;'><i><a href='javascript:ChangeAddUsereMail();'>{change}</a></i>\n\t\n\t</td>\n\t</tr>\n\t</table></div>";
$step3 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(4)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre3_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{password}</div>\n\t" . Field_password("password-{$t}", null, "font-size:18px;padding:3px;width:190px;letter-spacing:3px", null, null, null, false, "UserADDCheck(event)") . "\n\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t";
$step4 = "\n\t<div style='width:98%' class=form>\n\t<table style='width:99%' class='TableRemove' OnMouseOver=\"javascript:HideExplainAll(3)\">\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre4_32.png'></td>\n\t<td valign='top'>\n\t<div style='font-size:18px;font-weight:bold;margin-bottom:5px'>{group}</div>\n\t<div style='font-size:18px;margin-bottom:5px'>{select_user_group_title}:</div><br>{$groups}\n\t</td>\n\t</tr>\n\t</table></div>\n\t";
if ($_GET["gpid"] > 0) {
$step4 = "<input type='hidden' id='group_id' value='{$_GET["gpid"]}'>";
}
$html = "\n\t<input type='hidden' id='ou-mem-add-form-user' value='{$_GET["ou"]}'>\n\t<input type='hidden' id='ou' value='{$_GET["ou"]}'>\n\t<div id='adduser_ajax_newfrm' style='margin-top:5px'>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%' class=TableRemove>\n\t<tr>\n\t<td valign='top' style='width:450px;vertical-align:top'>\n\t\t<table style='width:450px'>\n\t\t<tr>\n\t\t\t<td valign='top' width=290px>{$step1}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top'>{$step2}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top'><br>{$step3}</td>\n\t\t</tr>\n\t\t\t<td valign='top'><br>{$step4}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td align='right'>\n\t\t\t\t<hr>" . button("{add}", "UserADDSubmit()", 26) . "\n\t\t\t</td>\n\t\t</tr>\t\t\t\n\t\t</table>\n\t</td>\n\t<td valign='top' style='width:50%'>\n\t\t\t<center style='margin-bottom:8px'><img src='img/add-woman-256.png'></center>\n\t\t\t<div style='padding-left:10px'>\t\t\n\t\t\t\t<div class=text-info id='text-1' style='font-size:16px'>{name_the_new_account_explain}</div>\n\t\t\t\t<div class=text-info id='text-2' style='font-size:16px'>{user_email_text}</div>\n\t\t\t\t<div class=text-info id='text-3' style='font-size:16px'>{select_user_group_text}</div>\n\t\t\t\t<div class=text-info id='text-4' style='font-size:16px'>{give_password_text}</div>\n\t\t\t</div>\n\t\t\t\n\t</td>\n\t</tr>\t\n\t</table>\n\t</div>\n\t</div>\n\t<input type='hidden' id='flexRTMEM' value='{$_GET["flexRT"]}'>\n\t<script>\n\t\tfunction VerifyFormAddUserCheck(){\n\t\t\tvar pass;\n\t\t\tvar uid;\n\t\t\tpass=document.getElementById('password-{$t}').value;\n\t\t\tuid=document.getElementById('new_userid').value;\n\t\t\tif(uid.length<1){alert('{$error_no_userid}');return false;}\n\t\t\tif(pass.length<1){alert('{$error_no_password}');return false;}\n\t\t\treturn true;\n\t\t\t}\n\t\t\n\t\tfunction UserADDSubmit(){\n\t\t\tif(!VerifyFormAddUserCheck()){return;}\n\t\t\tUserADD{$t}();\n\t\t}\n\t\n\t\n\t\tfunction UserADDCheck(e){\n\t\t\tif(checkEnter(e)){UserADDSubmit();}\n\t\t}\n\t\t\n\t\tfunction HideExplainAll(id){\n\t\t\tdocument.getElementById('text-1').style.display='none';\n\t\t\tdocument.getElementById('text-2').style.display='none';\n\t\t\tdocument.getElementById('text-3').style.display='none';\n\t\t\tdocument.getElementById('text-4').style.display='none'; \n\t\t\tif(document.getElementById('text-'+id)){\n\t\t\t\tdocument.getElementById('text-'+id).style.display='block';\n\t\t\t\t} \n\t\t\t\n\t\t}\n\t\t\nfunction UserADD{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tvar ou=document.getElementById('ou').value;\n\t\tif(ou.length==0){if(document.getElementById('ou-mem-add-form-user')){ou=document.getElementById('ou-mem-add-form-user').value;}}\n\t\tif(ou.length==0){Alert('Unable to stat Organization name (ou field is empty)');return;}\n\t\t\n\t\tXHR.appendData('ou',ou);\n\t\tXHR.appendData('new_userid',document.getElementById('new_userid').value);\n\t\tXHR.appendData('password',document.getElementById('password-{$t}').value);\n\t\tXHR.appendData('group_id',document.getElementById('group_id').value);\n\t\tXHR.appendData('email',document.getElementById('email').value);\n\t\tXHR.appendData('user_domain',document.getElementById('user_domain').value);\n\t\t\n\t\tif(document.getElementById('adduser_ajax_newfrm')){AnimateDiv('adduser_ajax_newfrm');}\n\t\tif(document.getElementById('bglego')){document.getElementById('bglego').src='img/wait_verybig.gif';}\n\t\tif(document.getElementById('member_add_to_wait')){AnimateDiv('member_add_to_wait');}\n\t\tXHR.sendAndLoad('domains.edit.user.php', 'POST',X_UserADD);\t\n\t}\t\t\n\t\n\t\n\t\t\n\t\tHideExplainAll();\n</script>\t\n\t\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例4: PatchDomains
function PatchDomains($ou)
{
$ldap = new clladp();
if ($ldap->ldapFailed) {
return null;
}
if (strtolower($ou) == "default") {
return null;
}
$tbl = explode("\n", @file_get_contents("/etc/opt/kaspersky/kav4lms/groups.d/{$ou}.conf"));
while (list($num, $val) = each($tbl)) {
if (preg_match("#Recipients=#", $val)) {
unset($tbl[$num]);
}
if (preg_match("#Senders=#", $val)) {
unset($tbl[$num]);
}
}
$domains = $ldap->hash_get_domains_ou($ou);
if (!is_array($domains)) {
@unlink("/etc/opt/kaspersky/kav4lms/groups.d/{$ou}.conf");
}
if (is_array($domains)) {
while (list($num, $val) = each($domains)) {
$num = str_replace('.', '\\.', $num);
$arr[] = "Recipients=re:.*{$num}";
}
}
if (!is_array($arr)) {
@unlink("/etc/opt/kaspersky/kav4lms/groups.d/{$ou}.conf");
return;
}
$arr[] = "Senders=";
reset($tbl);
while (list($num, $val) = each($tbl)) {
if (preg_match("#\\.definition\\]#", $val)) {
$tbl[$num] = $tbl[$num] . "\n" . implode("\n", $arr);
}
}
@file_put_contents("/etc/opt/kaspersky/kav4lms/groups.d/{$ou}.conf", implode("\n", $tbl));
}
示例5: INDEX_CREATE
function INDEX_CREATE()
{
$ldap = new clladp();
if ($_GET["ou"] == null) {
die;
}
$_GET["ou"] = base64_decode($_GET["ou"]);
$hash = $ldap->hash_groups($_GET["ou"], 1);
$domains = $ldap->hash_get_domains_ou($_GET["ou"]);
if (count($domains) == 0) {
$users = new usersMenus();
if ($users->POSTFIX_INSTALLED) {
$field_domains = Field_text('user_domain', "{$_GET["ou"]}.com", "width:85px");
} else {
if (!preg_match("#(.+?)\\.(.+)#", $_GET["ou"])) {
$dom = "{$_GET["ou"]}.com";
} else {
$dom = "{$_GET["ou"]}";
}
$field_domains = "<code><strong>{$dom}</strong></code>" . Field_hidden('user_domain', "{$dom}", "width:120px");
}
} else {
$field_domains = Field_array_Hash($domains, 'user_domain');
}
$hash[null] = "{select}";
$groups = Field_array_Hash($hash, 'group_id', $_GET["gpid"]);
$title = "{$_GET["ou"]}:{create_user}";
$step1 = "<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre1.png'></td>\n\t<td valign='top'>\n\t<H3>{name_the_new_account_title}</H3><br>\n\t<strong>{name_the_new_account_field}:</strong>\n\t<br>" . Field_text('new_userid', null, null, null, "UserAutoChange_eMail()") . "\n\t<div class=caption>{name_the_new_account_explain}</div>\n\t</td>\n\t</tr>\n\t</table>";
$step2 = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre2.png'></td>\n\t<td valign='top'>\n\t<H3>{email}</H3><br>\n\t<strong>{email}:</strong>\n\t<br><input type='hidden' name='email' value='' id='email'>\n\t<span id='prefix_email' style='width:90px;border:1px solid #CCCCCC;padding:2px;font-size:11px;font-weight:bold;margin:2px'></span>@{$field_domains} <a href='javascript:ChangeAddUsereMail();'>[{change}]</a>\n\t<div class=caption>{user_email_text}</div>\n\t</td>\n\t</tr>\n\t</table>";
$step3 = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre3.png'></td>\n\t<td valign='top'>\n\t<H3>{password}</H3><br>\n\t<strong>{give_password}:</strong>\n\t<br>" . Field_password('password') . "\n\t<div class=caption>{give_password_text}</div>\n\t</td>\n\t</tr>\n\t</table>\n\t";
$step4 = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/chiffre4.png'></td>\n\t<td valign='top'>\n\t<H3>{group}</H3><br>\n\t<strong>{select_user_group_title}:</strong>{$groups}\n\t<div class=caption>{select_user_group_text}</div>\n\t</td>\n\t</tr>\n\t</table>\n\t";
if ($_GET["gpid"] > 0) {
$step4 = "<input type='hidden' id='group_id' value='{$_GET["gpid"]}'>";
}
$html = "\n\t<input type='hidden' id='ou-mem-add-form-user' value='{$_GET["ou"]}'>\n\t<input type='hidden' id='ou' value='{$_GET["ou"]}'>\n\t<div style='float:right'><img src='img/64_bg_lego.png'></div><H1>{$title}</H1>\n\t<p class=caption>{create_user_text}</p>\n\t<div id='adduser_ajax_newfrm'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>{$step1}</td>\n\t<td valign='top'>{$step2}</td>\n\t</tr>\n\t<tr>\n\t<td valign='top'><br>{$step3}\n\t</td>\n\t<td valign='top'><br>{$step4}</td>\n\t</tr>\n\t<tr>\n\t<td colspan=2>\n\t<hr>\n\t<div style='padding:10px;text-align:right'>\n\t\t" . button("{add}", "UserADD()") . "\n\t\n\t</td>\n\t</tr>\t\t\n\t\n\t</table>\n\t</div>\n\t";
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($html);
}
示例6: query
function query()
{
$ou = null;
$ldap = new clladp();
$users = new usersMenus();
if (!$users->AsArticaAdministrator) {
$ou = $_SESSION["ou"];
}
if ($ou == null) {
$domains = $ldap->hash_get_all_domains();
} else {
$domains = $ldap->hash_get_domains_ou($ou);
}
$data = array();
$data['page'] = 1;
$data['total'] = $total;
$data['rows'] = array();
$c = 0;
while (list($num, $ligne) = each($domains)) {
if ($num == null) {
continue;
}
if ($_POST["query"] != null) {
$qq = $_POST["query"];
$qq = str_replace(".", "\\.", $qq);
$qq = str_replace("*", ".*?", $qq);
if (!preg_match("#{$qq}#", $num)) {
continue;
}
}
$c++;
$href = "<a href=\"javascript:blur();\" OnClick=\"javascript:{$_GET["callback"]}('{$num}');WinORGHide();\" style='text-decoration:underline'>";
$data['rows'][] = array('id' => $num, 'cell' => array("<img src='img/domain-32.png'>", "<strong style='font-size:16px;style='color:black'>{$href}{$num}</a></strong>"));
}
$data['total'] = $c;
echo json_encode($data);
}
示例7: BACKUP_EMAIL_BEHAVIOR_DASHBOARD
function BACKUP_EMAIL_BEHAVIOR_DASHBOARD()
{
$tpl = new templates();
$ou = $_SESSION["ou"];
@mkdir("/usr/share/artica-postfix/ressources/web/cache_{$ou}", 0755, true);
$filebackup = "/usr/share/artica-postfix/ressources/web/cache_{$ou}/BACKUP_EMAIL_BEHAVIOR_DASHBOARD";
if (file_time_min_Web($filebackup) > 30) {
$q = new postgres_sql();
$ldap = new clladp();
$domains = $ldap->hash_get_domains_ou($ou);
while (list($domain, $MAIN) = each($domains)) {
$domain = trim(strtolower($domain));
if ($domain == null) {
continue;
}
$FDOMS[] = "domainto='{$domain}'";
$FDOMS2[] = "domainfrom='{$domain}'";
}
$imploded1 = @implode(" OR ", $FDOMS);
$imploded2 = @implode(" OR ", $FDOMS2);
$sql = "select count(*) as tcount, SUM(size) as size FROM backupmsg WHERE ({$imploded1}) OR ({$imploded2})";
$ligne = pg_fetch_array($q->QUERY_SQL($sql));
@unlink($filebackup);
@file_put_contents($filebackup, serialize($ligne));
}
$ligne = unserialize(@file_get_contents($filebackup));
$tcount = $ligne["tcount"];
$size = $ligne["size"];
if ($tcount == 0) {
echo $tpl->_ENGINE_parse_body("0 {message}");
return;
}
$size = FormatBytes($size / 1024);
$tcount = FormatNumber($tcount);
echo $tpl->_ENGINE_parse_body("<a href=\"javascript:blur();\"\n\t\tOnClick=\"javascript:GotoBackupMails()\"\n\t\tstyle='text-decoration:underline'>{$tcount} {messages}</a> ({$size})");
}
示例8: import
function import()
{
$ou = $_GET["ou"];
if (is_base64_encoded($ou)) {
$ou = base64_decode($ou);
}
$page = CurrentPageName();
$tpl = new templates();
$ldap = new clladp();
$domains = $ldap->hash_get_domains_ou($ou);
$about_this_section = $tpl->_ENGINE_parse_body("{about_this_section}");
$t = $_GET["t"];
$html = "\n\t\n\t<div id='import-task-{$t}'></div>\n\t<div style='width:98%' class=form>\n\t<table style='width:99%'>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{domain}:</td>\n\t\t<td>" . Field_array_Hash($domains, "domain", null, null, null, 0, "font-size:16px;padding:3px") . " <a href=\"javascript:blur();\" OnClick=\"javascript:YahooWinBrowse('500','{$page}?about=yes','{$about_this_section}');\" style='font-size:14px;text-decoration:underline'>{$about_this_section}</a></td>\n\t\t<td></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend nowrap style='font-size:16px'>{file_path}:</td>\n\t\t<td width=99%>" . Field_text("IMPORTATION_FILE_PATH", "", 'width:85%;font-size:16px;padding:3px') . " </td>\n\t\t<td width=1%>" . button("{browse}", "Loadjs('tree.php?select-file=txt&target-form=IMPORTATION_FILE_PATH')", "16px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{import_datas}", "MigrationImportDatas()", "18px") . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<center>\n\t<div id='taskslistMigr' style='height:200px;overflow:auto;margin-top:8px;width:95%' class=form></div>\n\t</center>\n\t\n\t\n\t<script>\n\tvar x_MigrationImportDatas=function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\n\t\tdocument.getElementById('import-task-{$t}').innerHTML='';\n\t\t\$('#flexRT{$t}').flexReload();\n\t\tLoadAjax('taskslistMigr','{$page}?tasks-list=yes&ou={$_GET["ou"]}');\n\t\t\n\t}\t\n\t\n\tfunction MigrationImportDatas(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('IMPORTATION_FILE_PATH',document.getElementById('IMPORTATION_FILE_PATH').value);\n\t\tXHR.appendData('domain',document.getElementById('domain').value);\n\t\tXHR.appendData('ou','{$_GET["ou"]}');\t\t\n\t\tAnimateDiv('import-task-{$t}');\t\n\t\tXHR.sendAndLoad('{$page}', 'GET', x_MigrationImportDatas);\t\t\t \n\t}\n\t\n\tfunction LauchTasks(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('RELAUNCH_TASKS','yes');\n\t\tAnimateDiv('import-task-{$t}');\t\n\t\tXHR.sendAndLoad('{$page}', 'GET', x_MigrationImportDatas);\t\t\t \n\t}\t\n\t\n\tfunction TaskListsRefresh(){\n\t\tLoadAjax('taskslistMigr','{$page}?tasks-list=yes&ou={$_GET["ou"]}');\n\t}\n\t\n\tfunction TaskMigrDelete(ID){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('DELETE_TASK',ID);\n\t\tXHR.appendData('ou','{$_GET["ou"]}');\t\t\n\t\tAnimateDiv('import-task-{$t}');\t\n\t\tXHR.sendAndLoad('{$page}', 'GET', x_MigrationImportDatas);\t\n\t}\n\t\t\n\tfunction ReloadMembers(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('RELOAD_MEMBERS','yes');\n\t\tdocument.getElementById('users-popup-list').innerHTML='<center><img src=img/wait_verybig.gif></center>';\t\n\t\tXHR.sendAndLoad('{$page}', 'GET', x_MigrationImportDatas);\t\t\t\n\t}\t\n\t\n\tfunction RestartMembers(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('RESTART_MEMBERS','yes');\n\t\tXHR.appendData('ou','{$_GET["ou"]}');\t\n\t\tdocument.getElementById('users-popup-list').innerHTML='<center><img src=img/wait_verybig.gif></center>';\t\n\t\tXHR.sendAndLoad('{$page}', 'GET', x_MigrationImportDatas);\t\t\t\n\t}\t\t\n\t\n\t\n\n\t\n\tTaskListsRefresh();\n</script>\n\t\n\t\n\t\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例9: GRAB_DATAS
function GRAB_DATAS($ligne, $md5)
{
$GLOBALS["zMD5"] = $md5;
$params = unserialize($ligne["params"]);
$influx = new influx();
$mintime = strtotime("2008-01-01 00:00:00");
$params["TO"] = intval($params["TO"]);
$params["FROM"] = abs(intval($params["FROM"]));
if ($params["FROM"] < $mintime) {
$params["FROM"] = strtotime(date("Y-m-d 00:00:00"));
}
$params["TO"] = intval($params["TO"]);
if ($params["TO"] < $mintime) {
$params["TO"] = time();
}
$influx = new influx();
$ou = $ligne["ou"];
$uid = $ligne["uid"];
$to = $params["TO"];
$from = $params["FROM"];
$interval = $params["INTERVAL"];
$user = $params["USER"];
$md5_table = "{$md5}report";
$search = $params["searchuser"];
echo "SMTP Flow: FROM {$from} to {$to} {$interval} organization:{$ou} user:{$user} {$search}\n";
$table = "smtpstats";
//zdate,mailfrom,domainfrom,mailto,domainto,subject,size,spamscore,spamreport,disclaimer,backuped,infected,filtered,whitelisted,compressed,stripped
$sqlSource = null;
$TimeGroup = "date_trunc('hour', zdate) as zdate";
$TimeGroupBy = "date_trunc('hour', zdate)";
$distance = $influx->DistanceHour($from, $to);
echo "Distance: {$distance} hours\n";
$FilterDate = "(zdate >='" . date("Y-m-d H:i:s", $from) . "' and zdate <= '" . date("Y-m-d H:i:s", $to) . "')";
if ($search == "*") {
$search = null;
}
if ($search != null) {
$search = str_replace("*", ".*", $search);
$SSEARCH = "WHERE ( (mailfrom ~* '{$search}') OR (mailto ~* '{$search}')";
}
if ($ou != null) {
$ldap = new clladp();
$domains = $ldap->hash_get_domains_ou($ou);
while (list($domain, $MAIN) = each($domains)) {
$domain = trim(strtolower($domain));
if ($domain == null) {
continue;
}
echo "Domain: {$domain}\n";
$FDOMS[] = "domainfrom ='{$domain}'";
$FDOMS2[] = "domainto ='{$domain}'";
}
$imploded1 = @implode(" OR ", $FDOMS);
$imploded2 = @implode(" OR ", $FDOMS2);
$sqlSource = "(select count(*) as hits,sum(size) as size,mailfrom,domainfrom,mailto,domainto,{$TimeGroup} FROM smtpstats WHERE {$FilterDate} AND (({$imploded1}) OR ({$imploded2})) GROUP BY mailfrom,domainfrom,mailto,domainto,{$TimeGroupBy} ORDER BY {$TimeGroupBy} ) as t";
$sqlSource = "select * FROM {$sqlSource} {$SSEARCH}";
}
if ($sqlSource == null) {
$sqlSource = "(select count(*) as hits,sum(size) as size,mailfrom,domainfrom,mailto,domainto,{$TimeGroup} FROM smtpstats WHERE {$FilterDate} GROUP BY mailfrom,domainfrom,mailto,domainto,{$TimeGroupBy} ORDER BY {$TimeGroupBy} ) as t";
$sqlSource = "select * FROM {$sqlSource} {$SSEARCH}";
}
$sql = "CREATE TABLE IF NOT EXISTS \"{$md5}report\"\n\t(zdate timestamp,\n\tmailfrom VARCHAR(128),\n\tmailto VARCHAR(128),\n\tdomainfrom VARCHAR(128),\n\tdomainto VARCHAR(128),\t\n\tsize BIGINT,\n\thits BIGINT)";
echo "TEMP:\n{$sql}\n";
$q = new postgres_sql();
$q->QUERY_SQL($sql);
if (!$q->ok) {
echo "***************\n{$q->mysql_error}\n***************\n";
return false;
}
$q->QUERY_SQL("TRUNCATE TABLE \"{$md5}report\"");
$q->QUERY_SQL("create index zdate{$md5}report on \"{$md5}report\"(zdate);");
$q->QUERY_SQL("create index mailfrom{$md5}report on \"{$md5}report\"(mailfrom,mailto,reason);");
$sql = "INSERT INTO \"{$md5}report\" (hits,size,mailfrom,domainfrom,mailto,domainto,zdate) {$sqlSource}";
echo "{$sql}\n";
build_progress("{step} {waiting_data}: BigData engine, {please_wait}", 6);
$postgres = new postgres_sql();
$results = $postgres->QUERY_SQL($sql);
if (!$postgres->ok) {
echo "ERROR.....\n";
echo "***************\n{$postgres->mysql_error}\n***************\n";
$q->QUERY_SQL("DROP TABLE \"{$md5}report\"");
return false;
}
$sql = "SELECT COUNT(*) AS tcount FROM \"{$md5}report\"";
$ligne = pg_fetch_assoc($postgres->QUERY_SQL($sql));
$total = intval($ligne["tcount"]);
echo "Members {$total} items inserted to PostGreSQL\n";
if ($total == 0) {
$q->QUERY_SQL("DROP TABLE \"{$md5}report\"");
return false;
}
return true;
}
示例10: List_entities
function List_entities($echo = 0)
{
$ldap = new clladp();
$hash = $ldap->hash_get_ou();
if (!is_array($hash)) {
return null;
}
$html = "<center'>\n\t<fieldset><legend>{entities}</legend><table>\n\t<tr class=rowT>\n\t<td> </td>\n\t<td>{entities}</td>\t\n\t<td>{nb_domains}</td>\t\n\t<td> </td>\n\t</tr>\n\t\n\t";
while (list($num, $val) = each($hash)) {
if ($class == 'rowB') {
$class = 'rowB';
} else {
$class = 'rowB';
}
$count_domains = 0;
$count_domains = count($ldap->hash_get_domains_ou($val));
$html = $html . "<tr class='{$class}'>\n\t\t\t<td width=1%><img src='img/ou.png'></td>\n\t\t\t<td ><a href=\"javascript:ListDomainByEntity('{$val}');\" style='font-size:13px;letter-spacing:3px'>{$val}</td>\n\t\t\t<td ><span style='font-size:13px;letter-spacing:3px'>{$count_domains}</td>\t\t\t\n\t\t\t<td><input type='button' OnClick=\"javascript:AddDomainByEntity('{$val}');\" value='{js_add_domain} »'></td>\n\t\t</tr>";
}
$html = $html . "</table></fieldset>";
if ($echo == 1) {
$tpl = new templates();
$html = $tpl->_parse_body($html);
echo $html;
exit;
}
return $html;
}
示例11: formulaire
function formulaire()
{
$users = new usersMenus();
$ldap = new clladp();
$tpl = new templates();
$page = CurrentPageName();
$TT = time();
$add_new_organisation_text = $tpl->javascript_parse_text("{add_new_organisation_text}");
$lang = null;
$t = $_GET["t"];
if ($users->AsAnAdministratorGeneric) {
$hash = $ldap->hash_get_ou(false);
} else {
if ($_GET["ou"] == null) {
$hash = $ldap->Hash_Get_ou_from_users($_SESSION["uid"], 1);
if (count($hash) == 0) {
if (isset($_SESSION["ou"])) {
$hash[0] = $_SESSION["ou"];
}
}
} else {
$hash[0] = $_GET["ou"];
if (count($hash) == 0) {
if (isset($_SESSION["ou"])) {
$hash[0] = $_SESSION["ou"];
}
}
}
}
if (count($hash) == 0) {
echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{error_no_ou_created}<center style='margin-top:30px'>" . button("{create_a_new_organization}", "Loadjs('organization.js.php?add-ou=yes');", 22) . "</center>"));
return;
}
if (count($hash) == 1) {
$org = $hash[0];
$hash_groups = $ldap->hash_groups($org, 1);
$hash_domains = $ldap->hash_get_domains_ou($org);
$groups = Field_array_Hash($hash_groups, "groupid-{$t}", null, null, null, 0, "font-size:28px;padding:3px");
$domains = Field_array_Hash($hash_domains, "domain-{$t}", null, null, null, 0, "font-size:28px;padding:3px");
}
$artica = new artica_general();
$EnableVirtualDomainsInMailBoxes = $artica->EnableVirtualDomainsInMailBoxes;
if ($users->ZARAFA_INSTALLED) {
$sock = new sockets();
$languages = unserialize(base64_decode($sock->getFrameWork("zarafa.php?locales=yes")));
while (list($index, $data) = each($languages)) {
if (preg_match("#cannot set#i", $data)) {
continue;
}
$langbox[$data] = $data;
}
$ZARAFA_LANG = $sock->GET_INFO("ZARAFA_LANG");
$mailbox_language = Field_array_Hash($langbox, "ZARAFA_LANG-ZARAFA_LANG", $ZARAFA_LANG, "style:font-size:28px;padding:3px");
$lang = "\n\t\t\t<tr>\n\t\t\t\t<td class=legend style='font-size:28px'>{language}:</td>\n\t\t\t\t<td><span id='MAILBOX_ZARAFA_LANG_LIST'>{$mailbox_language}</span>\n\t\t\t\t<div style='float:right;margin-top:5px'>" . button("{build_languages}", "BuildLocalesCreateUser()") . "</div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t";
}
while (list($num, $ligne) = each($hash)) {
$ous[$ligne] = $ligne;
}
$ouenc = urlencode($_GET["ou"]);
$ADMIN = false;
if ($users->AsSquidAdministrator) {
$ADMIN = true;
}
if ($users->AsDebianSystem) {
$ADMIN = true;
}
if ($users->AsSystemAdministrator) {
$ADMIN = true;
}
if ($ADMIN) {
$add_ou = "<div style='float:right'>" . imgtootltip("32-plus.png", "{create_a_new_organization}", "TreeAddNewOrganisation{$TT}()") . "</div>";
$add_group = "<div style='float:right'>" . imgtootltip("32-plus.png", "{new_group}", "CreateGroup{$TT}()") . "</div>";
}
$ou = Field_array_Hash($ous, "organization-{$t}", $_GET["ou"], "ChangeFormValues()", null, 0, "font-size:28px;padding:3px");
$form = "\n\t\n\t<input type='hidden' id='EnableVirtualDomainsInMailBoxes-{$t}' value='{$EnableVirtualDomainsInMailBoxes}'>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:28px'>{organization}:</td>\n\t\t\t<td>{$add_ou}<span id='ou-{$TT}'></span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:28px'>{group}:</td>\n\t\t\t<td>{$add_group}<span id='select_groups-{$t}'>{$groups}</span>\n\t\t</tr>\n\t\t<tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:28px'>{firstname}:</td>\n\t\t\t<td>" . Field_text("firstname-{$t}", null, 'width:531px;font-size:28px;padding:3px', null, 'ChangeFormValues()') . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:28px'>{lastname}:</td>\n\t\t\t<td>" . Field_text("lastname-{$t}", null, 'width:531px;font-size:28px;padding:3px', null, "ChangeFormValues()") . "</td>\n\t\t</tr>\t\t\n\t\t\t{$lang}\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:28px'>{email}:</td>\n\t\t\t<td style='font-size:28px'>" . Field_text("email-{$t}", null, 'width:220px;font-size:28px;padding:3px', null, "ChangeFormValues()") . " @ <span id='select_domain-{$t}'>{$domains}</span></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:28px' nowrap>{uid}:</td>\n\t\t\t<td>" . Field_text("login-{$t}", null, 'width:320px;font-size:28px;padding:3px') . "</td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:28px'>{password}:</td>\n\t\t\t<td>" . Field_password("password-{$t}", null, "font-size:28px;padding:3px", null, null, null, false, "SaveAddUserCheck(event)") . "</td>\n\t\t</tr>\t\n\t\t<tr><td colspan=2> </td></tr>\n\t\t<tr>\n\t\t\t<td colspan=2 align='right' style='padding:10px'><hr>" . button("{add}", "SaveAddUser()", 34) . "\n\t\t\t\t\n\t\t\t</td>\n\t\t</tr>\n\t\t\n\t\t</table>\n\t</div>\n\t";
$html = "<div id='ffform-{$t}'>\n\t<div>{$form}</div>\n\t<script>\n\tvar xTreeAddNewOrganisation{$TT}= function (obj) {\n\t\tvar response=obj.responseText;\n\t\tif(response){alert(response);}\n\t\tOpenOU{$TT}();\n\t\tChangeFormValues();\n\t\t\$('#table-{$t}').flexReload();\n\t}\t\n\t\n\tfunction TreeAddNewOrganisation{$TT}(){\n\t\tvar org=prompt('{$add_new_organisation_text}','');\n\t\tif(!org){return;}\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('TreeAddNewOrganisation',org);\n\t\tXHR.sendAndLoad('domains.php', 'GET',xTreeAddNewOrganisation{$TT});\n\t}\n\t\n\tfunction OpenOU{$TT}(){\n\t\tLoadAjaxSilent('ou-{$TT}','{$page}?ou-field=yes&t={$t}&ou={$ouenc}');\n\t}\n\t\n\tfunction CreateGroup{$TT}(){\n\t\tvar ou=document.getElementById('organization-{$t}').value;\n\t\tLoadjs('domains.edit.group.php?popup-add-group=yes&ou='+ou+'&t={$t}&tt={$_GET["tt"]}&CallBackFunction=ChangeFormValues');\n\t}\n\tOpenOU{$TT}();\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例12: build_members_xml
function build_members_xml($ou, $count)
{
if ($count < 10) {
$numero = "0" . "{$count}";
} else {
$numero = $count;
}
$conf[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
$conf[] = "#include <base/group-member.xml.macro>";
$conf[] = "BEGIN_GROUP_MEMBER_LIST(0x000000{$numero})";
$ldap = new clladp();
if ($ldap->ldapFailed) {
return null;
}
$domains = $ldap->hash_get_domains_ou($ou);
if (is_array($domains)) {
while (list($num, $val) = each($domains)) {
$num = "*@{$num}";
$conf[] = "EMAIL_ENTRY(\"{$num}\")";
}
}
$conf[] = "END_GROUP_MEMBER_LIST";
$conf[] = "";
echo "ou=\"{$ou}\" ({$count})" . count($domains) . " domains in 000000{$numero}-members.xml - {$count}/{$numero}\n";
@file_put_contents("/usr/local/ap-mailfilter3/conf/def/group/000000{$numero}-members.xml", @implode("\n", $conf));
}
示例13: USER_ADD
function USER_ADD()
{
$userid = $_GET["new_userid"];
$password = $_GET["password"];
$group_id = $_GET["group_id"];
$tpl = new templates();
$email = $_GET["email"] . "@" . $_GET["user_domain"];
$user = new usersMenus();
if ($user->EnableVirtualDomainsInMailBoxes == 1) {
writelogs("Adding change {$userid} to \"{$email}\" in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
$userid = $email;
}
$users = new user($userid);
if ($users->UserExists) {
echo $tpl->javascript_parse_text('ERROR: {account_already_exists}');
return false;
}
writelogs("Adding {$userid} in group {$group_id}", __FUNCTION__, __FILE__, __LINE__);
$email = $_GET["email"] . "@" . $_GET["user_domain"];
$ou = $_GET["ou"];
if ($ou == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_ou}'));
exit;
}
if ($userid == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_userid}'));
exit;
}
if ($password == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_password}'));
exit;
}
if ($email == null) {
echo html_entity_decode($tpl->javascript_parse_text('ERROR:{error_no_email}'));
exit;
}
$ldap = new clladp();
if ($group_id == null) {
$default_dn_group = "cn=nogroup,ou={$ou},dc=organizations,{$ldap->suffix}";
if (!$ldap->ExistsDN($default_dn_group)) {
$ldap->AddGroup("nogroup", $ou);
}
$group_id = $ldap->GroupIDFromName($ou, "nogroup");
if ($group_id == null) {
$group_id = 0;
}
}
$emT = explode('@', $email);
//Verify domains --------------------------------------------------------------- 2008 10 05,P3
$hash_domains_table = $ldap->hash_get_domains_ou($ou);
if ($hash_domains_table[$_GET["user_domain"]] == null) {
writelogs("{$userid} have no domains", __FUNCTION__, __FILE__, __LINE__);
writelogs("Create a new local domain by default", __FUNCTION__, __FILE__, __LINE__);
$ldap->AddDomainEntity($ou, $_GET["user_domain"]);
}
//------------------------------------------------------------------------------
$domains = $ldap->domains_get_locals_domains($ou);
$dn = "cn={$userid},ou={$ou},dc=organizations,{$ldap->suffix}";
if ($ldap->ExistsDN($dn)) {
writelogs("{$userid} ({$dn}) already exists", __FUNCTION__, __FILE__, __LINE__);
echo $userid;
exit;
}
$users = new user($userid);
$users->mail = $email;
$users->accountGroup = $group_id;
$users->domainname = $_GET["user_domain"];
if ($password != null) {
$users->password = $password;
}
$users->ou = $ou;
if ($domains[$_GET["user_domain"]] == true) {
writelogs("is a local domain {$_GET["user_domain"]}={$domains[$_GET["user_domain"]]}", __FUNCTION__, __FILE__, __LINE__);
$upd["ObjectClass"][] = 'ArticaSettings';
$users->MailboxActive = "TRUE";
}
if (!$users->add_user()) {
echo "ERROR:" . $users->ldap_error;
exit;
}
if ($group_id > 0) {
$ldap->AddUserToGroup($group_id, $users->uid);
}
echo $users->uid;
}
示例14: BuildQuery
function BuildQuery()
{
$users = new usersMenus();
$ldap = new clladp();
$tpl = new templates();
$recipient = $_GET["recipient"];
if ($_GET["query"] == '*') {
$_GET["query"] = null;
}
writelogs("recipient={$_GET["recipient"]}", __FUNCTION__, __FILE__);
if ($recipient == null) {
$recipient = '*';
}
if (!$users->AsArticaAdministrator) {
writelogs("AsArticaAdministrator=FALSE", __FUNCTION__, __FILE__);
if (strpos(" {$recipient}", '*') == 0) {
$uid = $ldap->uid_from_email($_GET["recipient"]);
if ($uid == null) {
return array(false, $tpl->_ENGINE_parse_body('{error_no_user_exists}'));
} else {
$filter1 = "mailto='{$recipient}'";
}
} else {
if (!preg_match('#(.+?)@(.+)#', $recipient, $re)) {
return array(false, $tpl->_ENGINE_parse_body('{error_bad_recipient_pattern}'));
}
$domains = $ldap->hash_get_domains_ou($_GET["ou"]);
if ($domains[trim($re[2])] == null) {
return array(false, $tpl->_ENGINE_parse_body('{error_match_recipient_domain}'));
}
$re[1] = str_replace('*', '%', $re[1]);
$filter1 = "mailto LIKE '{$re[1]}@{$re[2]}'";
}
}
if ($users->AsPostfixAdministrator) {
writelogs("AsArticaAdministrator=TRUE", __FUNCTION__, __FILE__);
writelogs("recipient={$_GET["recipient"]}", __FUNCTION__, __FILE__);
if (strpos(" {$recipient}", '*') > 0) {
$_GET["recipient"] = str_replace('*', '%', $_GET["recipient"]);
$filter1 = "mailto LIKE '{$_GET["recipient"]}'";
writelogs("filter={$filter1}", __FUNCTION__, __FILE__);
} else {
$filter1 = "mailto='{$_GET["recipient"]}'";
}
}
if ($_GET["limit"] == null) {
$limit = 0;
}
if ($_GET["query"] != null) {
$field2 = ",MessageBody,MATCH (MessageBody) AGAINST ('{$_GET["query"]}') AS pertinence";
$ORDER2 = ",pertinence DESC ";
}
if ($filter1 == "mailto LIKE ''") {
$domains = $ldap->hash_get_domains_ou($_GET["ou"]);
while (list($num, $ligne) = each($domains)) {
$dd[] = "(mailto LIKE '%{$num}')";
}
$filter1 = "(" . implode("OR ", $dd) . ")";
}
$limit = $_GET["next"] * 100;
$sql = "SELECT \n\t\t MessageID,\n\t\t MessageBody,\n\t\t zDate,\n\t\t mailfrom,\n\t\t subject,\n\t\t mailto\n\t\t {$field2}\n\t\t\tFROM `quarantine` WHERE 1\n\t\t\tAND {$filter1}\n\t\t\tORDER BY zDate DESC {$ORDER2} LIMIT {$limit},100";
writelogs($sql, __FUNCTION__, __FILE__);
return array(true, $sql);
}
示例15: filter2_section
function filter2_section()
{
$sock = new sockets();
$users = new usersMenus();
$SpamAssMilterEnabled = intval($sock->GET_INFO("SpamAssMilterEnabled"));
$SpamassassinDelegation = intval($sock->GET_INFO("SpamassassinDelegation"));
$MimeDefangEnabled = intval($sock->GET_INFO('MimeDefangEnabled'));
$MimeDefangAutoWhiteList = intval($sock->GET_INFO("MimeDefangAutoWhiteList"));
$MimeDefangFilterExtensions = intval($sock->GET_INFO("MimeDefangFilterExtensions"));
if ($MimeDefangEnabled == 1) {
$SpamAssMilterEnabled = 1;
}
$TTDOMS = array();
$OK_SPAMASS = false;
if ($SpamAssMilterEnabled == 1) {
if ($SpamassassinDelegation == 1) {
$OK_SPAMASS = true;
}
}
if (!$users->MIMEDEFANG_INSTALLED) {
$MimeDefangEnabled = 0;
}
if ($MimeDefangEnabled == 0) {
$MimeDefangClamav = 0;
$MimeDefangSpamAssassin = 0;
$MimeDefangAutoWhiteList = 0;
$MimeDefangFilterExtensions = 0;
}
$AutoWhite_icon = "arrow-right-24.png";
$AutoWhite_color = "#000000";
$AutoWhite_js = "GotoAutoWhite()";
$AutoWhite_text = null;
$ExtCheck_icon = "arrow-right-24.png";
$ExtCheck_color = "#000000";
$ExtCheck_js = "GotoMimeDefangExtensions()";
$ExtCheck_text = null;
if ($MimeDefangAutoWhiteList == 0) {
$AutoWhite_icon = "arrow-right-24-grey.png";
$AutoWhite_color = "#898989";
$AutoWhite_js = "blur()";
$AutoWhite_text = " <span style='font-size:14px'>({disabled})</span>";
}
if ($MimeDefangFilterExtensions == 0) {
$ExtCheck_icon = "arrow-right-24-grey.png";
$ExtCheck_color = "#898989";
$ExtCheck_js = "blur()";
$ExtCheck_text = " <span style='font-size:14px'>({disabled})</span>";
}
if (!$users->MIMEDEFANG_INSTALLED) {
$mimedefang_icon = "arrow-right-24-grey.png";
$mimedefang_color = "#898989";
$mimedefang_js = "GotoMessagingSecurityUpdate()";
$mimedefang_text = " <span style='font-size:14px'>({not_installed})</span>";
$AutoWhite_text = " <span style='font-size:14px'>({not_installed})</span>";
$ExtCheck_text = " <span style='font-size:14px'>({not_installed})</span>";
}
$ldap = new clladp();
$domains = $ldap->hash_get_domains_ou($_SESSION["ou"]);
$ouencoded = urlencode($_SESSION["ou"]);
$TTDOMS[] = "<table style='width:100%'>\n\t<tr>\n\t<td valign='middle' style='width:25px'><img src='img/arrow-right-24.png'></td>\n\t<td valign='middle' style='font-size:18px;width:99%;color:black'>" . texttooltip("{safety_standards}", "position:right:{safety_standards}", "GoToRFCDomain('{$ouencoded}')") . "</td>\n\t</tr></table>";
$TTDOMS[] = "\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td valign='middle' style='width:25px'><img src='img/{$AutoWhite_icon}'></td>\n\t\t\t<td valign='middle' style='font-size:18px;width:99%;color:{$AutoWhite_color}'>" . texttooltip("{smtp_AutoWhiteList}{$AutoWhite_text}", "position:right:{smtp_AutoWhiteList}", $AutoWhite_js) . "</td>\n\t\t</tr>\n\t</table>";
$TTDOMS[] = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='middle' style='width:25px'><img src='img/{$ExtCheck_icon}'></td>\n\t<td valign='middle' style='font-size:18px;width:99%;color:{$ExtCheck_color}'>" . texttooltip("{title_mime}{$ExtCheck_text}", "position:right:{mimedefang_attachments_text}", $ExtCheck_js) . "</td>\n\t\t</tr>\n\t</table>";
while (list($num, $ligne) = each($domains)) {
$icon = "arrow-right-24.png";
$Color = "#000000";
$js = "GoToAntiSpamsDomain('{$num}')";
$text = null;
if (!$OK_SPAMASS) {
$icon = "arrow-right-24-grey.png";
$js = "blur()";
$text = " <span style='font-size:14px'>({disabled})</span>";
$Color = "#898989";
}
$TTDOMS[] = "<table style='width:100%'>\n\t\t<tr>\n\t<td valign='middle' style='width:25px'>\n\t\t<img src='img/{$icon}'>\n\t</td>\n\t\t<td valign='middle' style='font-size:18px;width:99%;color:{$Color}'>" . texttooltip("Anti-Spam: {$num}{$text}", "{$num}", "{$js}") . "</td>\n\t</tr>\n\t</table>";
}
if (count($TTDOMS) > 0) {
$final = CompileTr2($TTDOMS);
}
$tpl = new templates();
echo $tpl->_ENGINE_parse_body($final);
}