本文整理汇总了PHP中clladp::Hash_relay_domains方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::Hash_relay_domains方法的具体用法?PHP clladp::Hash_relay_domains怎么用?PHP clladp::Hash_relay_domains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clladp
的用法示例。
在下文中一共展示了clladp::Hash_relay_domains方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: config
function config()
{
$page = CurrentPageName();
$tpl = new templates();
$ldap = new clladp();
$ou = $_GET["ou"];
$domain = $_GET["domain"];
$HashDomains = $ldap->Hash_relay_domains($_GET["ou"]);
$routage = $HashDomains[$_GET["domain"]];
$tools = new DomainsTools();
$arr = $tools->transport_maps_explode($routage);
$dn = "cn=@{$_GET["domain"]},cn=relay_recipient_maps,ou={$ou},dc=organizations,{$ldap->suffix}";
$html = "\n\t<div style='font-size:30px;margin-bottom:20px'>{$_GET["ou"]}: {$_GET["domain"]}</div>\n\t<div class=explain id='div-{$_GET["domain"]}' style='font-size:18px'>{relaydomain_explain}</div>\n\t<p> </p>\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{target_computer_name}:</td>\n\t\t<td style='font-size:16px'>" . Field_text("target_computer_name", "{$arr[1]}", "font-size:22px;width:490px") . "</td>\n\t\t<td> </td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:22px'>{port}:</td>\n\t\t<td style='font-size:16px'>" . Field_text("remote-port", "{$arr[2]}", "font-size:22px;width:110px;text-align:right") . "</td>\n\t\t<td> </td>\n\t</tr>\t\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "SaveRelayDomainNew()", 40) . "</td>\n\t</tr>\n\t</table>\n\t\n\t</div>\n\t<script>\n\t\t\n\t\tvar x_SaveRelayDomainNew= function (obj) {\n\t\t\tvar tempvalue=obj.responseText;\n\t\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\t\tif(IsFunctionExists('FlexReloadRemoteDomainList')){FlexReloadRemoteDomainList();}\n\t\t\tRefreshTab('main_config_relay_domain');\n\t\t}\t\t\n\t\t\n\t\t\n\n\n\tfunction SaveRelayDomainNew(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('remote',document.getElementById('target_computer_name').value);\n\t\t\tXHR.appendData('port',document.getElementById('remote-port').value);\n\t\t\tXHR.appendData('ou','{$ou}');\n\t\t\tXHR.appendData('domain','{$domain}');\n\t\t\tdocument.getElementById('div-{$_GET["domain"]}').innerHTML='<center style=\"width:100%\"><img src=img/wait_verybig.gif></center>';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveRelayDomainNew);\t\t\n\t\n\t}\n\n\t</script>\n\t";
echo $tpl->_ENGINE_parse_body($html);
}
示例2: RELAY_DOMAINS_LIST_SEARCH
function RELAY_DOMAINS_LIST_SEARCH()
{
$ldap = new clladp();
$page = CurrentPageName();
$tpl = new templates();
$users = new usersMenus();
$ou = $_GET["ou"];
include_once "ressources/class.amavis.inc";
$amavis = new amavis();
$amavis_oui = false;
$t = $_GET["t"];
writelogs("----------------> Hash_relay_domains", __FUNCTION__, __FILE__, __LINE__);
$HashDomains = $ldap->Hash_relay_domains($ou);
$aliases = new AutoAliases($ou);
$users->LoadModulesEnabled();
if ($users->AMAVIS_INSTALLED) {
if ($users->EnableAmavisDaemon == 1) {
$amavis_oui = true;
}
}
$disclaimer = IS_DISCLAIMER();
$tools = new DomainsTools();
$domainstyle = "font-size:16px";
if (isset($_GET["expand"])) {
$domainstyle = "font-size:18px";
}
if ($_POST["query"] != null) {
$search = str_replace("*", ".*?", $_POST["query"]);
}
$data = array();
$c = 0;
while (list($num, $ligne) = each($HashDomains)) {
if ($search != null) {
if (!preg_match("#{$search}#", $num)) {
continue;
}
}
$c++;
$autoalias = " ";
$disclaimer_domain = " ";
$amavis_infos = " ";
$amavis_duplicate = " ";
$delete = imgtootltip("delete-24.png", '{label_delete_transport}', "DeleteRelayDomain{$t}('{$num}')");
if ($amavis->copy_to_domain_array[strtolower($num)]["enable"] == 1) {
$amavis_duplicate = "<strong style='font-size:12px'>{$amavis->copy_to_domain_array[strtolower($num)]["duplicate_host"]}:{$amavis->copy_to_domain_array[strtolower($num)]["duplicate_port"]}";
}
$autoalias = $tpl->_ENGINE_parse_body($autoalias);
writelogs("add in row {$ligne} ", __FUNCTION__, __FILE__);
$arr = $tools->transport_maps_explode($ligne);
$alreadyDomain[$num] = true;
$count++;
$js = "Loadjs('domains.relay.domains.php?domain={$num}&ou={$ou}')";
$relay = "{$arr[1]}:{$arr[2]}";
if (strlen($aliases->DomainsArray[$num]) > 0) {
$autoalias = "<img src='img/20-check.png'>";
}
if ($arr[3] == "yes") {
$mx = "{yes}";
} else {
$mx = "{no}";
}
if ($amavis_oui) {
$amavis_infos = imgtootltip("24-parameters.png", "AS -> {$num}", "Loadjs('domains.amavis.php?domain={$num}')");
}
if ($disclaimer) {
$disclaimer_domain = imgtootltip("24-parameters.png", "disclaimer -> {$num}", "Loadjs('domains.disclaimer.php?domain={$num}&ou={$ou}')");
}
$data['rows'][] = array('id' => "dom-{$num}", 'cell' => array("\n\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:{$js}\" style='{$domainstyle};font-weight:bold;text-decoration:underline'>{$num}</span>", "<span style='font-size:14px'>{$autoalias}</span>", "<span style='font-size:14px'>{$amavis_infos}</span>", "<span style='font-size:14px'>{$disclaimer_domain}</span>", "<span style='font-size:14px'>{$relay}</span>", $delete));
}
$dn = "cn=transport_map,ou={$ou},dc=organizations,{$ldap->suffix}";
$hash = $ldap->Ldap_search($dn, '(objectclass=transportTable)', array());
for ($i = 0; $i < $hash["count"]; $i++) {
$transport = $hash[$i]["transport"][0];
$domain = $hash[$i]["cn"][0];
if (isset($alreadyDomain[$domain])) {
continue;
}
if ($search != null) {
if (!preg_match("#{$search}#", $domain)) {
continue;
}
}
$arr = $tools->transport_maps_explode($transport);
$relay = "{$arr[1]}:{$arr[2]}";
$js = "PostfixAddRoutingTable('{$domain}')";
$count++;
$data['rows'][] = array('id' => "dom-{$domain}", 'cell' => array("\n\t\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:{$js}\" style='font-size:16px;font-weight:bold;text-decoration:underline'>{$domain}</span>", "<span style='font-size:14px'> </span>", "<span style='font-size:14px'> </span>", "<span style='font-size:14px'> </span>", "<span style='font-size:14px'>{$relay}</span>", " "));
}
$data['page'] = 1;
$data['total'] = $c;
echo json_encode($data);
}
示例3: remotedomain_search
function remotedomain_search()
{
$users = new usersMenus();
$page = CurrentPageName();
$boot = new boostrap_form();
$t = time();
$tpl = new templates();
$ldap = new clladp();
$are_you_sure_to_delete = $tpl->javascript_parse_text("{are_you_sure_to_delete}");
if ($users->AsPostfixAdministrator) {
$HashDomains = $ldap->Hash_relay_domains();
} else {
$HashDomains = $ldap->Hash_relay_domains($_SESSION["ou"]);
}
if (!is_array($HashDomains)) {
$HashDomains = array();
}
$tools = new DomainsTools();
$search = string_to_flexregex("remotedomain-search");
while (list($domain, $ligne) = each($HashDomains)) {
$id = md5($domain);
$delete = imgsimple("delete-32.png", null, "DeleteRemoteDomain{$t}('{$domain}','{$id}')");
if ($search != null) {
if (!preg_match("#{$search}#", $domain)) {
continue;
}
}
$arr = $tools->transport_maps_explode($ligne);
$relay = "{$arr[1]}:{$arr[2]}";
$js = "Loadjs('{$page}?remotedomain-new-js=yes&domain=" . urlencode($domain) . "')";
$trSwitch = $boot->trswitch($js);
$tr[] = "\n\t\t<tr id='{$id}'>\n\t\t<td style='font-size:18px' {$trSwitch}><i class='icon-globe'></i> {$domain}</td>\n\t\t<td style='font-size:18px' nowrap {$trSwitch}><i class='icon-arrow-right'></i> {$relay}</td>\n\t\t<td style='text-align:center'>{$delete}</td>\n\t\t</tr>";
}
echo $tpl->_ENGINE_parse_body("\n\t\n\t\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th style='width:99%'>{domains}</th>\n\t\t\t\t\t<th style='width:99%'>{destination}</th>\n\t\t\t\t\t<th> </th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t") . @implode("\n", $tr) . " </tbody>\n\t\t\t\t\t\t</table>\n<script>\n\tvar xmem{$t}='';\nvar xDeleteRemoteDomain{$t}= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue); return;};\n\t\$('#'+xmem{$t}).remove();\n}\n\t\nfunction DeleteRemoteDomain{$t}(domain,id){\n\txmem{$t}=id;\n\tif(confirm('{$are_you_sure_to_delete} '+domain)){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('remotedomain-remove',domain);\n\t\tXHR.appendData('ou','{$_SESSION["ou"]}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDeleteRemoteDomain{$t});\n\t}\n}\n</script>\n";
}
示例4: organization_list
function organization_list()
{
$ldap = new clladp();
$tpl = new templates();
$tools = new DomainsTools();
$t = $_GET["t"];
$localdomains = $ldap->Hash_associated_domains();
$relaydomains = $ldap->Hash_relay_domains();
$sock = new sockets();
$PostfixLocalDomainToRemote = $sock->GET_INFO("PostfixLocalDomainToRemote");
if (!is_numeric($PostfixLocalDomainToRemote)) {
$PostfixLocalDomainToRemote = 0;
}
$PostfixLocalDomainToRemoteAddr = $sock->GET_INFO("PostfixLocalDomainToRemoteAddr");
$forwared = $tpl->_ENGINE_parse_body("{forwarded}");
while (list($domain, $ligne) = each($localdomains)) {
$array[$domain]["DELETE"] = "DeleteLocalDomain{$t}('{$domain}')";
$ou = $ldap->organization_name_from_localdomain($domain);
if ($ou == null) {
$ou = "{none}";
}
$array[$domain]["TEXT"] = "<span style='font-size:18px'>{localdomain}</span><br><span style='font-size:16px'>{organization}: <strong>{$ou}</strong>";
if ($PostfixLocalDomainToRemote == 1) {
$array[$domain]["TEXT"] = "<span style='font-size:18px'>{localdomain}</span><br><span style='font-size:16px'>{organization}: <strong>{$ou}</strong></span><br>{$forwared} -» smtp:{$PostfixLocalDomainToRemoteAddr} ";
}
}
while (list($domain, $ligne) = each($relaydomains)) {
$arr = $tools->transport_maps_explode($ligne);
$ou = $ldap->organization_name_from_transporttable($domain);
$array[$domain]["TEXT"] = "{$arr[1]}:{$arr[2]} ({$ou})";
$array[$domain]["OU"] = $ou;
$array[$domain]["DELETE"] = "DeleteTransportDomain{$t}('{$domain}')";
}
$data = array();
if ($_POST["query"] != null) {
$search = string_to_regex($_POST["query"]);
}
$c = 0;
if ($_POST["sortorder"] == "desc") {
krsort($array);
} else {
ksort($array);
}
while (list($domain, $ligne) = each($array)) {
if ($search != null) {
if (!preg_match("#{$search}#", $domain)) {
continue;
}
}
$c++;
$ligne["TEXT"] = $tpl->_ENGINE_parse_body($ligne["TEXT"]);
$domainenc = urlencode($domain);
$OuEnc = urlencode($ligne["OU"]);
$delete = imgsimple("delete-48.png", '{label_delete_transport}', $ligne["DELETE"]);
$m5 = md5($domain);
$js = "Loadjs('domains.relay.domains.php?domain={$domainenc}&ou={$OuEnc}')";
$data['rows'][] = array('id' => "dom{$m5}", 'cell' => array("\n\t\t<a href=\"javascript:blur();\" \n\t\t\tOnClick=\"javascript:{$js}\" \n\t\t\tstyle='font-size:24px;font-weight:bold;text-decoration:underline'>{$domain}</span>", "<span style='font-size:24px'>{$ligne["TEXT"]}</span>", "<center>{$delete}</center>"));
if ($c > $_POST["rp"]) {
break;
}
}
if ($c == 0) {
json_error_show("no data");
}
$data['page'] = 1;
$data['total'] = $c;
echo json_encode($data);
}
示例5: RELAY_DOMAINS_LIST
function RELAY_DOMAINS_LIST($ou)
{
$ldap = new clladp();
$tpl = new templates();
$amavis_oui = false;
writelogs("----------------> Hash_relay_domains", __FUNCTION__, __FILE__);
$HashDomains = $ldap->Hash_relay_domains($ou);
$aliases = new AutoAliases($ou);
if (!is_array($HashDomains)) {
return $tpl->_ENGINE_parse_body('<H5>{no_remote_domain_here}</H5>');
}
$users = new usersMenus();
$users->LoadModulesEnabled();
if (!$users->POSTFIX_INSTALLED) {
return null;
}
if ($users->AMAVIS_INSTALLED) {
if ($users->EnableAmavisDaemon == 1) {
$amavis_oui = true;
}
}
$disclaimer = IS_DISCLAIMER();
$tools = new DomainsTools();
if (is_array($HashDomains)) {
$ul[] = "<ul id='domains-checklist'>";
while (list($num, $ligne) = each($HashDomains)) {
writelogs("add in row {$ligne} ", __FUNCTION__, __FILE__);
$arr = $tools->transport_maps_explode($ligne);
$count = $count = 1;
$js = "AddRemoteDomain_form('{$ou}','{$num}')";
$relay = "{$arr[1]}:{$arr[2]}";
if (strlen($aliases->DomainsArray[$num]) > 0) {
$autoalias = "{yes}";
} else {
$autoalias = "{no}";
}
if ($arr[3] == "yes") {
$mx = "{yes}";
} else {
$mx = "{no}";
}
if ($amavis_oui) {
$amavis = "\n\t\t\t\t<tr>\n\t\t\t\t<td class=legend width=1% nowrap>{Anti-spam}:</td>\n\t\t\t\t<td>" . texttooltip("[{settings}]", "{Anti-spam}:{$num}", "Loadjs('domains.amavis.php?domain={$num}')", null, 0, "font-weight:bold;font-size:12px") . "</td>\n\t\t\t\t</tr>";
}
if ($disclaimer) {
$disclaimer_domain = "\n\t\t\t\t<tr>\n\t\t\t\t<td class=legend width=1% nowrap>{disclaimer}:</td>\n\t\t\t\t<td>" . texttooltip("[{settings}]", "{disclaimer}:{$num}", "Loadjs('domains.disclaimer.php?domain={$num}&ou={$ou}')", null, 0, "font-weight:bold;font-size:12px") . "</td>\n\t\t\t\t</tr>";
}
$ul[] = "<li class='domainsli' style='width:350px'><table style='width:100%'>\n\t\t\t<tr>\n\t\t\t\t<td width=1% valign='top'>" . imgtootltip("domain-relay-64.png", "{edit}", $js) . "</td>\n\t\t\t\t<td valign='top'>";
$ul[] = "\n\t\t\t<table style='width:90%'>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><strong style='font-size:16px'>" . texttooltip($num, "{parameters}", $js, null, 0, "font-size:16px;color:#005447") . "</strong>\n\t\t\t\t\t\t<div style='font-size:12px;text-align:right;border-top:1px solid #005447;padding:3px;font-weight:bolder'>{$relay}</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td valign='top' width=1% align='right'>" . imgtootltip("delete-24.png", '{label_delete_transport}', "DeleteRelayDomain('{$num}')") . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t<tr>\n\t\t\t\t<td class=legend width=1% nowrap>{mx_look_text}:</td>\n\t\t\t\t<td><strong>{$autoalias}</strong></td>\n\t\t\t</tr>\t\t\t\n\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend width=1% nowrap>{aliases}:</td>\n\t\t\t\t<td><strong>{$autoalias}</strong></td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t{$amavis}\n\t\t\t{$amavis_duplicate}\n\t\t\t{$disclaimer_domain}\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t";
$ul[] = "</li>";
}
$ul[] = "</ul>";
}
return $tpl->_ENGINE_parse_body(@implode("\n", $ul));
}
示例6: default_outgoing_rule
function default_outgoing_rule()
{
if (!is_file("/opt/kaspersky/klms/bin/klms-control")) {
echo "Starting......: " . date("H:i:s") . " Kaspersky Mail security Suite `klms-control` no such binary\n";
return;
}
$unix = new unix();
$ruleslist = ruleslist();
$ID = $ruleslist["From Local Network"];
if (!is_numeric($ID)) {
$ID = 0;
}
echo "Starting......: " . date("H:i:s") . " Kaspersky Mail security Suite default rule ID:{$ID}\n";
$sock = new sockets();
$MynetworksInISPMode = $sock->GET_INFO("MynetworksInISPMode");
$PostfixBadNettr = unserialize(base64_decode($sock->GET_INFO("PostfixBadNettr")));
if (!is_numeric($MynetworksInISPMode)) {
$MynetworksInISPMode = 0;
}
$ldap = new clladp();
$NEWAR["127.0.0.1"] = true;
if ($MynetworksInISPMode == 0) {
$array = $ldap->load_mynetworks();
while (list($key, $IP) = each($array)) {
if (isset($PostfixBadNettr[$IP])) {
if ($PostfixBadNettr[$IP] == 1) {
continue;
}
}
$NEWAR[$IP] = true;
}
}
$tools = new DomainsTools();
$HashDomains = $ldap->Hash_relay_domains();
if (is_array($HashDomains)) {
while (list($num, $ligne) = each($HashDomains)) {
$arr = $tools->transport_maps_explode($ligne);
$NEWAR[$arr[1]] = true;
}
}
$q = new mysql();
$sql = "SELECT ipaddr FROM postfix_whitelist_con";
$results = $q->QUERY_SQL($sql, "artica_backup");
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
$NEWAR[$ligne["ipaddr"]] = true;
}
$f = array();
$f[] = "<root>";
$f[] = " <belongingCriteria>";
$f[] = " <sender>";
while (list($key, $none) = each($NEWAR)) {
if ($key == null) {
continue;
}
$f[] = " <item>";
$f[] = " <type>CIDR</type>";
$f[] = " <value>{$key}</value>";
$f[] = " </item>";
}
$f[] = " </sender>";
$f[] = " <recipient>";
$f[] = " <item>";
$f[] = " <type>EMailMask</type>";
$f[] = " <value>*</value>";
$f[] = " </item>";
$f[] = " </recipient>";
$f[] = " </belongingCriteria>";
$f[] = " <scanSettings>";
$f[] = " <ruleDescription>Local networks will be not scanned for outgoing connexions...</ruleDescription>";
$f[] = " <active>1</active>";
$f[] = " <ruleAction>Scan</ruleAction>";
$f[] = " <avScanSettings>";
$f[] = " <engineSettings>";
$f[] = " <enableScan>1</enableScan>";
$f[] = " <maxSizeLimit>0</maxSizeLimit>";
$f[] = " <excludedNames />";
$f[] = " <excludedFormats>";
$f[] = " <executableCategory>";
$f[] = " <executableWin>0</executableWin>";
$f[] = " <executableMsi>0</executableMsi>";
$f[] = " <executableJava>0</executableJava>";
$f[] = " <executableElf>0</executableElf>";
$f[] = " <executableDeb>0</executableDeb>";
$f[] = " <executableRpm>0</executableRpm>";
$f[] = " </executableCategory>";
$f[] = " <officeCategory>";
$f[] = " <documentSubcategory>";
$f[] = " <msOfficeDoc>0</msOfficeDoc>";
$f[] = " <msOfficeDocx>0</msOfficeDocx>";
$f[] = " <msOfficeDocm>0</msOfficeDocm>";
$f[] = " <msOfficeDot>0</msOfficeDot>";
$f[] = " <msOfficeDotx>0</msOfficeDotx>";
$f[] = " <msOfficeDotm>0</msOfficeDotm>";
$f[] = " <officePdf>0</officePdf>";
$f[] = " <officeXps>0</officeXps>";
$f[] = " <officeRtf>0</officeRtf>";
$f[] = " <officeOdt>0</officeOdt>";
$f[] = " <officeSxw>0</officeSxw>";
$f[] = " </documentSubcategory>";
$f[] = " <spreadsheetSubcategory>";
//.........这里部分代码省略.........