【问题标题】:Customize Rouncube webmail server list自定义 Roundcube 网络邮件服务器列表
【发布时间】:2016-06-16 18:44:27
【问题描述】:

我有 -最新版本 1.2.0- webmail 可与 一起使用。我在该服务器上托管多个域,并使用 IIS 作为 Roundcube 的 Web 服务器。 https://mail.xxxx.tld 可以访问网络邮件,其中 xxxx 是我托管的域名。

使用 IIS 网站设置中的bindings,所有域仅指向 IIS 上的一个网站。

在 Roundcube config.inc.php 中:

$config['default_host'] = array('mail.x1.net', 'mail.x2.net', 'mail.x3.org', 'mail.x4.net');

所以,在登录页面中有如下截图所示的服务器列表:

默认情况下始终选择服务器列表中的第一台服务器。我需要得到的是根据访问登录页面的 URL 使选定的服务器或什至使单个服务器可用。

现在,我并不是说如何实现它,无论是使用 javascript 的客户端还是使用 PHP 的服务器端,我只是说我可以在哪里应用任何实现来满足该要求?

我已尝试修改skins/larry/templates/login.html,但除了以下内容外,我无法找到登录表单的任何详细信息:

<roundcube:form name="form" method="post">
<roundcube:object name="loginform" form="form" size="40" submit=true />
</form> 

也就是说,用户名、密码和服务器这三个表单元素都是从&lt;roundcube:object name="loginform" form="form" size="40" submit=true /&gt; 生成的,那么我在哪里可以修改这个对象呢?

【问题讨论】:

    标签: roundcube hmail-server php email roundcube


    【解决方案1】:

    我发现有两种方法:

    1. 任重而道远,学习 Roundcube API 并构建插件。
    2. 简而言之,在skins/larry/templates/login.html末尾添加一点脚本

    以下是我添加的脚本:

    <script>
    /* By: Said Bakr
     Making only one select list server item equals to the current host.
    */
    $(document).ready(function() {
        my_host = $(location).attr('hostname');
        $("#rcmloginhost option").each(function(){
          if ($(this).val().replace(/^(.*)\:\/\//i, "") != my_host){
            $(this).remove();
          } 
        })
    });
    </script>
    </body>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-14
      • 2016-05-17
      • 1970-01-01
      相关资源
      最近更新 更多