当前位置: 首页>>代码示例>>PHP>>正文


PHP clladp::sasl_relayhost方法代码示例

本文整理汇总了PHP中clladp::sasl_relayhost方法的典型用法代码示例。如果您正苦于以下问题:PHP clladp::sasl_relayhost方法的具体用法?PHP clladp::sasl_relayhost怎么用?PHP clladp::sasl_relayhost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在clladp的用法示例。


在下文中一共展示了clladp::sasl_relayhost方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: relayhost

function relayhost()
{
    $sock = new sockets();
    $PostfixRelayHost = trim($sock->GET_INFO("PostfixRelayHost"));
    if ($PostfixRelayHost == null) {
        shell_exec("{$GLOBALS["postconf"]} -e \"relayhost =\" >/dev/null 2>&1");
        return null;
    }
    $tools = new DomainsTools();
    $hash = $tools->transport_maps_explode($PostfixRelayHost);
    if ($hash[2] == null) {
        $hash[2] = 25;
    }
    $PostfixRelayHost_pattern = "[{$hash[1]}]:{$hash[2]}";
    echo "Starting......: Relay host: {$PostfixRelayHost_pattern}\n";
    $ldap = new clladp();
    $sasl_password_string = $ldap->sasl_relayhost($hash[1]);
    if ($sasl_password_string != null) {
        $relayhost_hash = "{$PostfixRelayHost_pattern}\t{$sasl_password_string}\n";
        @file_put_contents("/etc/postfix/sasl_passwd", $relayhost_hash);
        shell_exec("{$GLOBALS["postmap"]} hash:/etc/postfix/sasl_passwd >/dev/null 2>&1");
        shell_exec("{$GLOBALS["postconf"]} -e \"smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd\" >/dev/null 2>&1");
    }
    shell_exec("{$GLOBALS["postconf"]} -e \"relayhost ={$PostfixRelayHost_pattern}\" >/dev/null 2>&1");
}
开发者ID:brucewu16899,项目名称:artica,代码行数:25,代码来源:exec.postfix.hashtables.php

示例2: orangefr_popup

function orangefr_popup()
{
    $sasl = new smtp_sasl_password_maps();
    $domain = new DomainsTools();
    $ISP = $_GET["isp"];
    $ini = new Bs_IniHandler();
    $ldap = new clladp();
    $ini->loadFile("ressources/databases/isp.defaults.settings.conf");
    $default_server = $ini->_params[$ISP]["default_server"];
    $default_port = $ini->_params[$ISP]["default_port"];
    $serverstring = $domain->transport_maps_implode($default_server, $default_port, null, "no");
    $auth = $ldap->sasl_relayhost($default_server);
    if ($auth != null) {
        if (preg_match('#(.+?):(.+)#', $auth, $re)) {
            $username = $re[1];
            $password = $re[2];
        }
    }
    $tpl = new templates();
    $isp_server_address_label = $tpl->_ENGINE_parse_body('{isp_server_address}');
    $isp_server_port_label = $tpl->_ENGINE_parse_body('{isp_server_port}');
    if (strlen($isp_server_address_label) > 25) {
        $isp_server_address_label = texttooltip(substr($isp_server_address_label, 0, 22) . '...', $isp_server_address_label, null, 1);
    }
    if (strlen($isp_server_port_label) > 25) {
        $isp_server_port_label = texttooltip(substr($isp_server_port_label, 0, 22) . '...', $isp_server_port_label, null, 1);
    }
    $page = CurrentPageName();
    $text = "\n\t<div id='anim'></div>\n\t<p class=caption style='font-size:12px'>{please_verify_addressisp}</p>\n\t<strong style='font-size:13px'>{technical_address}:<code>{$serverstring}</code></strong><br>\n\t<form name='FFMISPRELAY'>\n\t<table style='width:100%;background-color:#FFFFFF;border:1px solid #CCCCCC;padding:5px'>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$isp_server_address_label}</td>\n\t\t\t<td>" . Field_text('isp_address', $default_server, 'width:220px;') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{$isp_server_port_label}</td>\n\t\t\t<td>" . Field_text('isp_port', $default_port, 'width:30px;') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{username}</td>\n\t\t\t<td>" . Field_text('isp_username', $username, 'width:190px;') . "</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{password}</td>\n\t\t\t<td>" . Field_password('isp_password', $password, 'width:90px;') . "</td>\n\t\t</tr>\t\n\t\t<tr><td colspan=2>&nbsp;</td></tr>\n\t\t<tr>\n\t\t\t<td colspan=2 style='padding-top:4px;border-top:1px solid #CCCCCC' align='right'>\n\t\t\t" . button("{apply}", "FFMISPRELAY_SAVE()") . "\n\t\t\t\t\n\t\t\t</td\n\t\t</tr>\n\t</table>\t\n\t\n\t";
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=1%><img src='img/{$ini->_params[$ISP]["default_icon"]}' style='margin:4px;padding:5px;border:1px solid #7B787E;background-color:white'></td>\n\t\t<td style='vertical-align:top'>{$text}</td>\n\t</tr>\n\t</table>\n\t<script>\t\t\n\tvar x_FFMISPRELAY_SAVE=function(obj){\n    \tvar tempvalue=trim(obj.responseText);\n\t  \tif(tempvalue.length>3){alert(tempvalue);}\n\t\tdocument.getElementById('anim').innerHTML='';\n\t\t}\n\t\n\t\tfunction FFMISPRELAY_SAVE(){\n\t\t\tvar XHR = new XHRConnection(); \n\t\t\tXHR.appendData('isp_address',document.getElementById('isp_address').value);\n\t\t\tXHR.appendData('isp_password',document.getElementById('isp_password').value);\n\t\t\tXHR.appendData('isp_port',document.getElementById('isp_port').value);\n\t\t\tXHR.appendData('isp_username',document.getElementById('isp_username').value);\n\t\t\tdocument.getElementById('anim').innerHTML='<center style=\"width:100%\"><img src=img/wait_verybig.gif></center>';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_FFMISPRELAY_SAVE);\n\t\t}\t\t\n\t\t\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:32,代码来源:postfix.index.php


注:本文中的clladp::sasl_relayhost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。