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

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

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条