Single RoundCube setup for multiple ISPConfig3 servers

Discussion in 'Tips/Tricks/Mods' started by Hans, Mar 11, 2010.

  1. JeGr

    JeGr Member

    This solution is a bit limited as you rewrite the default_host by looking which domain it is called from. But this isn't possible if you install it centrally via e.g. "webmail.serviceprovider.com" not only because of the www-part, but also because a central domain for all customers wouldn't hold any additional information. With my plugin approach, RC selects the server from the ISPConfig database so it will always match the right one, even if you move a user from one server to another.

    Only thing left is the login mask. I have an idea about that, but that will have to wait until tomorrow.
     
  2. Hans

    Hans Moderator ISPConfig Developer

    Ok i see, and i will test your plugins anyway! :)
     
  3. austingecko

    austingecko New Member

    Can you post your plugin code so we can see the queries, etc. Thanks.
     
  4. JeGr

    JeGr Member

    As the plugin isn't currently working with Hans' setup, we are in progress of debugging. Perhaps it's some change in code from 0.3.1 to 0.4-beta but we'll see. As soon as it seems to work, I'll happily provide you with necessary details.
     
  5. JeGr

    JeGr Member

    As it seems in Hans' tests, the plugin only works for RC versions >= 0.4(-beta). Somehow the API hooks don't seem to work properly in 0.3.1 (old)stable. But as soon as 0.4 hits gold (shouldn't take that long), it will work as intended. So my plugin is 0.4 only (a pity) but if any of you need it before 0.4 gets gold, let me know.

    Cheers
     
  6. Horfic

    Horfic Member

    So... I quickly wrote a working autoselect plugin for Roundcube 0.3.x <=
    You just have to put it in the plugin folder, add the plugin to the plugin array in the main config and also change the default_host to $rcmail_config['default_host'] = '';

    Yes, the server field won't be shown. It will use the config file of the ISPConfig3_account plugin, if you are using it, otherwise you have to edit the config file which is in the config folder of the plugin.

    Requirements:
    *) The server names in ISPConfig 3 must be the domain of the Server. Like xen1.bb-hosting.org

    Oh... nearly forgot, you have to add in the /usr/local/ispconfig/interface/lib/classes/remoting.inc.php this:
    Code:
    	//** server functions -----------------------------------------------------------------------------------	
      public function server_get_name($session_id, $server_id)
        {
    		global $app;
    		/*if(!$this->checkPerm($session_id, 'server_get')) {
    			$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
    			return false;
    		}*/
    		
    		$server_id = intval($server_id);
    		
    		$rec = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ".$server_id);
    		if(isset($rec['server_name'])) {
    			return $rec['server_name'];
    		} else {
    			$this->server->fault('no_server_found', 'There is no server with this ID.');
    			return false;
    		}
    		
    	}
    just before this
    Code:
    //** private functions -----------------------------------------------------------------------------------
    PS: You can find it in my SVN Repository http://svn.web-wack.at/ispconfig3_roundcube3/trunk/

    PPS: I know that I outcommented the checkPermission function
     
  7. Hans

    Hans Moderator ISPConfig Developer

    Hi Horfic,
    Thanks for your nice work as well! :)
     
  8. Hans

    Hans Moderator ISPConfig Developer

    @Grey,
    As i let you know already, your solution is working with RoundCube 0.4-stable! Maybe you would like to share your solution with other users as well ...
     

Share This Page