本文整理汇总了PHP中clladp::ou_by_smtp_domain方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::ou_by_smtp_domain方法的具体用法?PHP clladp::ou_by_smtp_domain怎么用?PHP clladp::ou_by_smtp_domain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clladp
的用法示例。
在下文中一共展示了clladp::ou_by_smtp_domain方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: servers_list
function servers_list()
{
$search = $_GET["search"];
$MyPage = CurrentPageName();
$page = 1;
$users = new usersMenus();
$tpl = new templates();
$sock = new sockets();
$q = new mysql();
$table = "ejabberd";
$database = "artica_backup";
$t = $_GET["t"];
if ($q->COUNT_ROWS($table, $database) == 0) {
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
echo json_encode($data);
return;
}
if (isset($_POST["sortname"])) {
if ($_POST["sortname"] != null) {
$ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
}
}
if (isset($_POST['page'])) {
$page = $_POST['page'];
}
if ($_POST["query"] != null) {
$_POST["query"] = str_replace("*", "%", $_POST["query"]);
$search = $_POST["query"];
$searchstring = "AND (`{$_POST["qtype"]}` LIKE '{$search}')";
$sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$searchstring}";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
$total = $ligne["TCOUNT"];
} else {
$sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}`";
$ligne = mysql_fetch_array($q->QUERY_SQL($sql, $database));
$total = $ligne["TCOUNT"];
}
if (isset($_POST['rp'])) {
$rp = $_POST['rp'];
}
$pageStart = ($page - 1) * $rp;
$limitSql = "LIMIT {$pageStart}, {$rp}";
if ($OnlyEnabled) {
$limitSql = null;
}
$sql = "SELECT * FROM `{$table}` WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
$results = $q->QUERY_SQL($sql, $database);
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
if (mysql_num_rows($results) == 0) {
$data['rows'][] = array('id' => $ligne[time()], 'cell' => array($sql, "", "", ""));
}
$ldap = new clladp();
while ($ligne = mysql_fetch_assoc($results)) {
$color = black;
$groupware = $tpl->_ENGINE_parse_body($groupware);
$forward_text = $tpl->_ENGINE_parse_body($forward_text);
$servername_text = $tpl->_ENGINE_parse_body($servername_text);
$ServerAlias = $tpl->_ENGINE_parse_body($ServerAlias);
$uptime = $tpl->_ENGINE_parse_body($uptime);
$memory = $tpl->_ENGINE_parse_body($memory);
$requests_second = $tpl->_ENGINE_parse_body("{$requests_second}");
$traffic_second = $tpl->_ENGINE_parse_body($traffic_second);
$checkResolv = $tpl->_ENGINE_parse_body($checkResolv);
$checkDNS = $tpl->_ENGINE_parse_body($checkDNS);
$checkMember = $tpl->_ENGINE_parse_body($checkMember);
$delete = $tpl->_ENGINE_parse_body($delete);
$md5S = md5($ligne["hostname"]);
$icon = "jabberd-24.png";
$servername_text = $ligne["hostname"];
$enabled = Field_checkbox("enabled_{$md5S}", 1, $ligne["enabled"], "eJabberdEnableHost('enabled_{$md5S}','{$ligne["hostname"]}')");
$href = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('ejabberd.edit.php?hostname={$ligne["hostname"]}&t={$t}')\" style='text-decoration:underline'>";
$spanStyle1 = "<span style='font-size:13px;font-weight:bold;color:#5F5656;'>";
$ou = $ldap->ou_by_smtp_domain($ligne["hostname"]);
$delete = "<a href=\"javascript:blur();\" OnClick=\"javascript:JabberdDelete('{$ligne["hostname"]}','{$md5S}');\"><img src='img/delete-24.png'></a>";
$data['rows'][] = array('id' => $md5S, 'cell' => array("<img src='img/{$icon}'>", "<strong style='font-size:14px;style='color:{$color}'>{$href}{$servername_text}</a>{$groupware}{$forward_text}</strong>", "{$spanStyle1}{$enabled}</span>", "{$spanStyle1}{$ou}/{$ligne["uid"]}</span>", $delete));
}
echo json_encode($data);
}
示例2: main_fetchmail_build
function main_fetchmail_build(){
include_once('ressources/class.user.inc');
include_once('ressources/class.main_cf.inc');
include_once('ressources/class.fetchmail.inc');
$failed=false;
$isp_address_mail=$_GET["isp_address_mail"];
$isp_pop3_server=$_GET["isp_pop3_server"];
$isp_smtp_server=$_GET["isp_smtp_server"];
$isp_account=$_GET["isp_account"];
$isp_password=$_GET["isp_password"];
$local_email=$_GET["local_email"];
$local_password=$_GET["local_password"];
$isp_smtp_account=$_GET["isp_smtp_account"];
$isp_smtp_password=$_GET["isp_smtp_password"];
$relay_server=$_GET["relay_server"];
if($local_email==null){
echo main_fetchmail_build_results(true,'local mail (False)');
exit;
}
$ldap=new clladp();
writelogs("i try to found if user exists",__FUNCTION__,__FILE__);
$uid=$ldap->uid_from_email($local_email);
if($uid<>null){
$user=new user($local_email);
$ou=$user->ou;
}else{
writelogs("no user found, create it",__FUNCTION__,__FILE__);
$tb=explode("@",$local_email);
$local_domain=$tb[1];
$user=new user($tb[0]);
$ou=$ldap->ou_by_smtp_domain($local_domain);
if($ou==null){
$ou=$local_domain;
writelogs("Adding new organization $ou",__FUNCTION__,__FILE__);
$ldap->AddOrganization($ou);
}
}
writelogs("Creating user",__FUNCTION__,__FILE__);
$user=new user($local_email);
$user->mail=$local_email;
$user->password=$local_password;
$user->ou=$ou;
$user->SenderCanonical=$isp_address_mail;
if(!$user->add_user()){
echo main_fetchmail_build_results(true,$user->ldap_error);
exit;
}
if($isp_smtp_account<>null){
writelogs("Creating SMTP authentification for $isp_smtp_server width $isp_smtp_account",__FUNCTION__,__FILE__);
$sasl=new smtp_sasl_password_maps();
$sasl->add($isp_address_mail,$isp_smtp_account,$isp_password);
$main=new main_cf();
writelogs("Enable sasl engine in postfix",__FUNCTION__,__FILE__);
$main->smtp_sasl_password_maps_enable_2();
}
writelogs("Creating sender_dependent_relayhost_maps -> $isp_smtp_server",__FUNCTION__,__FILE__);
$sender=new sender_dependent_relayhost_maps();
if(!$sender->Add($isp_address_mail,$isp_smtp_server)){
echo main_fetchmail_build_results(true,"sender_dependent_relayhost_maps:$sender->ldap_error");
exit;
}
$fetchmail=new Fetchmail_settings();
$array["poll"]=$isp_pop3_server;
$array["proto"]="auto";
$array["keep"]="yes";
$array["user"]=$isp_account;
$array["pass"]=$isp_password;
$array["is"]=$local_email;
$array["fetchall"]="yes";
$line=$fetchmail->compile($array);
if(!$user->fetchmail_add_rule($line)){
echo main_fetchmail_build_results(true,"fetchmail rule:$user->ldap_error");
exit;
}
$relay=new Routing($ou);
if($relay_server<>null){
if(!$relay->create_relay_server($local_domain,$relay_server,$ou)){
echo main_fetchmail_build_results(true,"relay:$relay->ldap_error");
}
}else{
if(!$relay->create_localdomain($ou,$local_domain)){
//.........这里部分代码省略.........
示例3: blacklistdom
function blacklistdom($domain = null)
{
$ldap = new clladp();
if ($domain != null) {
$domain = "*";
}
$hash = $ldap->BlackListFromDomain($domain);
$data = array();
$data['page'] = $page;
$data['total'] = $total;
$data['rows'] = array();
if ($_POST["query"] != null) {
$search = $_POST["query"];
$search = str_replace(".", "\\.", $search);
$search = str_replace("*", ".*?", $search);
}
$c = 0;
if (is_array($hash)) {
while (list($from, $line) = each($hash)) {
$recipient_domain = $from;
if (preg_match("#(.+?)@(.+)#", $recipient_domain, $re)) {
$recipient_domain = $re[2];
}
$ou = $ldap->ou_by_smtp_domain($recipient_domain);
while (list($num, $wl) = each($line)) {
if ($search != null) {
if (!preg_match("#{$search}#", $wl)) {
continue;
}
}
$c++;
$id = md5("{$from}{$wl}");
$delete = imgsimple("delete-24.png", "{delete}", "DeleteBlackList('{$from}','{$wl}','{$id}');");
$data['rows'][] = array('id' => $id, 'cell' => array("<span style='font-size:14px;color:{$color}'>{$ou}</span>", "<span style='font-size:14px;color:{$color}'>{$wl}</span>", "<span style='font-size:14px;color:{$color}'>{$from}</span>", $delete));
}
}
}
$data['total'] = $c;
echo json_encode($data);
}
示例4: remotedomain_remove
function remotedomain_remove()
{
$ldap = new clladp();
$domain_name = $_POST["remotedomain-remove"];
$ou = $_POST["ou"];
if ($ou == null) {
$ou = $ldap->ou_by_smtp_domain($domain_name);
}
$ldap = new clladp();
$ldap->DeleteRemoteDomain($domain_name, $ou);
ChockServices();
}
示例5: blacklistdom
function blacklistdom($domain=null){
if($domain==null){$domain="*";}
$ldap=new clladp();
$hash=$ldap->BlackListFromDomain($domain);
$html="
<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>
<thead class='thead'>
<tr>
<th colspan=2>{search}:$domain</th>
<th>{from}</th>
<th>{recipients}</th>
<th> </th>
</tr>
</thead>
<tbody class='tbody'>";
if(is_array($hash)){
while (list ($from, $line) = each ($hash)){
$recipient_domain=$from;
if(preg_match("#(.+?)@(.+)#",$from,$re)){$recipient_domain=$re[2];}
$ou=$ldap->ou_by_smtp_domain($recipient_domain);
while (list ($num, $wl) = each ($line)){
if($classtr=="oddRow"){$classtr=null;}else{$classtr="oddRow";}
$html=$html .
"<tr class=$classtr>
<td width=1%><img src='img/fw_bold.gif'></td>
<td><strong style='font-size:13px'>$ou</strong></td>
<td><strong style='font-size:13px'>$wl</strong>
<td><strong style='font-size:13px'>$from</strong></td>
<td width=1%>" . imgtootltip('delete-32.png','{delete}',"DeleteBlackList('$from','$wl');")."</td>
</tr>";}
}}
$html=$html . "</table>";
$form=$html;
return $form;
}
示例6: CreateThisUser
function CreateThisUser($email)
{
if (!preg_match("#(.+?)@(.+)#", $email, $re)) {
return null;
}
$domain = $re[2];
$uid = $re[1];
$ldap = new clladp();
$ou = $ldap->ou_by_smtp_domain($domain);
if ($ou == null) {
write_syslog("CreateThisUser():: Unable to detect organization by domain \"{$domain}\"", __FILE__);
return null;
}
$ct = new user($uid);
$ct->ou = $ou;
$ct->mail = $email;
$ct->uid = $uid;
if (!$ct->add_user()) {
write_syslog("CreateThisUser():: Unable to Create user {$uid} \"{$email}\"", __FILE__);
return null;
}
$uid2 = $ldap->uid_from_email($email);
write_syslog("CreateThisUser():: new user \"{$uid2}\"", __FILE__);
return $uid2;
}
示例7: blacklistdom
function blacklistdom($domain = null)
{
if ($domain == null) {
$domain = "*";
}
$ldap = new clladp();
$hash = $ldap->BlackListFromDomain($domain);
$html = "<H5>{$domain}</H5>\n\t<table style='width:99%' class=table_form>\n\t<tr style='background-color:#CCCCCC'>\n\t\t<td> </td>\n\t\t<td> </td>\n\t\t<td><strong>{recipients}</strong></td>\n\t\t<td><strong>{from}</strong></td>\n\t\t<td> </td>\n\t</tr>";
if (is_array($hash)) {
while (list($from, $line) = each($hash)) {
$recipient_domain = $from;
if (preg_match("#(.+?)@(.+)#", $from, $re)) {
$recipient_domain = $re[2];
}
$ou = $ldap->ou_by_smtp_domain($recipient_domain);
while (list($num, $wl) = each($line)) {
$html = $html . "<tr " . CellRollOver() . ">\n\t\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t\t<td><strong>{$ou}</strong></td>\n\t\t\t\t<td><strong>{$from}</strong></td>\n\t\t\t\t<td><strong>{$wl}</strong>\n\t\t\t\t<td width=1%>" . imgtootltip('x.gif', '{delete}', "DeleteBlackList('{$from}','{$wl}');") . "</td>\n\t\t\t</tr>";
}
}
}
$html = $html . "</table>";
$form = $html;
return $form;
}
示例8: hostname_config
function hostname_config()
{
$t = $_GET["t"];
$tpl = new templates();
$users = new usersMenus();
$page = CurrentPageName();
$sock = new sockets();
$hostname = $_GET["hostname"];
$buttonname = "{apply}";
$jaberd = new ejabberd($hostname);
$status = "{activew}";
if ($jaberd->enabled == 0) {
$status = "{inactive}";
}
$ldap = new clladp();
$ou = $ldap->ou_by_smtp_domain($hostname);
$html = "<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{status}:</td>\n\t\t<td style='font-size:18px'>{$status}</td>\n\t\t<td> </td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{administrator}:</td>\n\t\t<td>" . Field_text("uid-{$t}", $jaberd->uid, "font-size:18px;width:220px") . "</td>\n\t\t<td>" . button("{browse}...", "Loadjs('MembersBrowse.php?OnlyUsers=1&NOComputers=1&field-user=uid-{$t}&Zarafa=1&organization={$ou}')", 12) . "</td>\n\t</tr>\n\n\t</table>\n<hr>\n<div style='text-align:right'>" . button($buttonname, "SaveeJabberdCHost()", 22) . "</div>\t\n\t<script>\n\t\n\tvar x_SaveeJabberdCHost= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tvar currenthost='{$hostname}';\n\t\tif (res.length>3){alert(res);}\n\t\t\$('#jabberd-table-{$t}').flexReload();\n\t\tRefreshTab('main_ejabberd_{$t}');\n\t}\t\t\t\n\t\t\n\t\tfunction SaveeJabberdCHost(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('uid',document.getElementById('uid-{$t}').value);\n\t\t\tXHR.appendData('hostname','{$hostname}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveeJabberdCHost);\t\n\t\t}\t\n\t\n\t</script>\n\t\n\t";
echo $tpl->_ENGINE_parse_body($html);
}