dtt3399 2016-06-16 18:44
浏览 118
已采纳

自定义Roundcube webmail服务器列表

I have roundcube -latest version 1.2.0- webmail works with hmail-server. I host multiple domains on that server and I use IIS as web server for Roundcube. The webmail is accessible by https://mail.xxxx.tld where xxxx is the domain name that I host.

All the domains points to only one website on the IIS using bindings from IIS's webite settings.

In the Roundcube config.inc.php:

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

So, in the login page there is servers list like the following screen shot:

enter image description here

The first server in the server's list is always selected by default. What I need to get is making the selected server or even make a single server available based on the URL from which the login page is accessed.

Now, I don't meant with how to implement it, either client-side using javascript or server-side using PHP, I just meant with where could I able to apply any implementation for that requirement?

I have tried to modify skins/larry/templates/login.html but I could not able to find any details for the login form other than the following:

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

In other words, all the three form elements, Username, Password and server are generated from <roundcube:object name="loginform" form="form" size="40" submit=true />, so where could I able to modify this object?

  • 写回答

1条回答 默认 最新

  • dongwen2794 2016-06-17 16:14
    关注

    I found that there is two ways:

    1. Long way, study Roundcube API and build a plugin.
    2. Short way, adding a little jquery script at the end of skins/larry/templates/login.html

    The following is the script that I have added:

    <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>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 关于线性结构的问题:希望能从头到尾完整地帮我改一下,困扰我很久了
  • ¥20 设计一个二极管稳压值检测电路
  • ¥15 内网办公电脑进行向日葵
  • ¥15 如何输入双曲线的参数a然后画出双曲线?我输入处理函数加上后就没有用了,不知道怎么回事去掉后双曲线可以画出来
  • ¥50 WPF Lidgren.Network.Core2连接问题
  • ¥15 soildworks装配体的尺寸问题
  • ¥100 有偿寻云闪付SDK转URL技术
  • ¥30 基于信创PC发布的QT应用如何跨用户启动后输入中文
  • ¥20 非root手机,如何精准控制手机流量消耗的大小,如20M
  • ¥15 远程安装一下vasp