Hello,
I'm writting a plugin for select host from user's login, so I have to not show the server box on login form.
If I leave 'default_host' blank at main.inc.php the "Server" box appears, and if I put something on the config variable the plugin does not work, because default host takes precedence over the host selected by the plugin.
Is there a way to hide "server" box on login form without assign a value to "default_host" or I have found a bug on default_host setting?
Thank you all, nice job :)
Pedro
On Wed 09 Sep 2009 01:11:07 PM CEST, "Pedro R. Benito da Rocha" wrote
I'm writting a plugin for select host from user's login, so I have to not show the server box on login form.
so foo@bar.example.com uses example.com server ?
and what about smtp server ?, sieve ?
and what about roundcube database, if there is a database pr imap
server, it will be like winning 100000€ in lotto :=)
i belive what you do is design change in roundcube that need to be
solved so users just login with there email addr and pass and
roundcube from that part self know what imap, smtp, sieve to use pr user
lets design it that way anyway, smtp plugin was imho wroung since end
users dont know the sending servers detalts from webmail
the less users have to setup the better
ironical i use horde where it all worse then in roundcube
Hello,
I manage to use a different login screen, and on exit the plugin
redirects output to that login screen, so i override default login
screen :(
I don't know if database can be changed :), but my problen is this: I
have a cluster of webservers load-balanced and various domains with
different imap servers. I need to log in from one place for all people.
For now I "solved" the problem using the alternate login page, but I
think that RC could be more flexible. The other solution is to patch
RC sources, I will post the patch tomorrow if it works ;)
Next I will try to change the database, but you can do it using an
alternate login page and various RC installations.
And yes, the plugin lets you do thins like that: foo@bar.example.com uses my.own.imapserver.com foobar@example2.com uses my.second.imapserver.net ... etc.
Also lets you change login name :)
If anyone wants to see the plugin I can put it on a web server.
Pedro
On Wed, 09 Sep 2009 18:39:22 +0200, Benny Pedersen me@junc.org wrote:
On Wed 09 Sep 2009 01:11:07 PM CEST, "Pedro R. Benito da Rocha" wrote
I'm writting a plugin for select host from user's login, so I have to not show the server box on login form.
so foo@bar.example.com uses example.com server ?
and what about smtp server ?, sieve ?
and what about roundcube database, if there is a database pr imap
server, it will be like winning 100000€ in lotto :=)i belive what you do is design change in roundcube that need to be
solved so users just login with there email addr and pass and
roundcube from that part self know what imap, smtp, sieve to use pr userlets design it that way anyway, smtp plugin was imho wroung since end
users dont know the sending servers detalts from webmailthe less users have to setup the better
ironical i use horde where it all worse then in roundcube
List info: http://lists.roundcube.net/dev/
Hello all,
I noticed that if default_host is set RC only accepts those hosts, but the side effect is that the login form hides or shows the Server dialog. This is ok for most installations, but plugins can't disable this behavior, also custom templates.
The only way to modify this is modifying the code (file program/include/rcube_template.php, about line 1028 in 0.3-stable). It could be nice to manage the standard fields of login form in order to customize more from templates and/or plugins.
In some cases assign a username or a host could be necessary (log from web portals for example, where only password could be needed).
I have done this way: --- rcube_template.php 2009-09-10 09:15:03.377446000 +0200 +++ rcube_template-orig.php 2009-09-10 09:18:11.329532000 +0200 @@ -1026,5 +1026,5 @@ } }
else if (empty($default_host) &&
(($this->config['show_dialog']['host'] == true))) {
else if (empty($default_host)) {
$input_host = new html_inputfield(array('name' => '_host',
'id' => 'rcmloginhost', 'size' => 30)); }
New config option 'show_dialog' is used.
Pedro
Pedro Raúl Benito da Rocha escribió:
Hello,
I manage to use a different login screen, and on exit the plugin
redirects output to that login screen, so i override default login
screen :(I don't know if database can be changed :), but my problen is this: I
have a cluster of webservers load-balanced and various domains with
different imap servers. I need to log in from one place for all people.For now I "solved" the problem using the alternate login page, but I
think that RC could be more flexible. The other solution is to patch
RC sources, I will post the patch tomorrow if it works ;)Next I will try to change the database, but you can do it using an
alternate login page and various RC installations.And yes, the plugin lets you do thins like that: foo@bar.example.com uses my.own.imapserver.com foobar@example2.com uses my.second.imapserver.net ... etc.
Also lets you change login name :)
If anyone wants to see the plugin I can put it on a web server.
Pedro
Hello all,
Here is the plugin and default config (rename it to config.inc.php). See attached files.
Pedro
Pedro R. Benito da Rocha escribió:
Hello all,
I noticed that if default_host is set RC only accepts those hosts, but the side effect is that the login form hides or shows the Server dialog. This is ok for most installations, but plugins can't disable this behavior, also custom templates.
The only way to modify this is modifying the code (file program/include/rcube_template.php, about line 1028 in 0.3-stable). It could be nice to manage the standard fields of login form in order to customize more from templates and/or plugins.
In some cases assign a username or a host could be necessary (log from web portals for example, where only password could be needed).
I have done this way: --- rcube_template.php 2009-09-10 09:15:03.377446000 +0200 +++ rcube_template-orig.php 2009-09-10 09:18:11.329532000 +0200 @@ -1026,5 +1026,5 @@ } }
else if (empty($default_host) &&
(($this->config['show_dialog']['host'] == true))) {
else if (empty($default_host)) { $input_host = new html_inputfield(array('name' => '_host',
'id' => 'rcmloginhost', 'size' => 30)); }
New config option 'show_dialog' is used.
Pedro
Pedro R. Benito da Rocha wrote:
Hello all,
Here is the plugin and default config (rename it to config.inc.php). See attached files.
Did you try imap_connect/smtp_connect hooks to overwrite host setting?
A.L.E.C wrote:
Pedro R. Benito da Rocha wrote:
Hello all,
Here is the plugin and default config (rename it to config.inc.php). See attached files.
Did you try imap_connect/smtp_connect hooks to overwrite host setting?
<?php
/**
*/ class select_server extends rcube_plugin { public $task = 'mail';
function init() { $this->add_hook('imap_connect', array($this, 'get_server')); $this->add_hook('smtp_connect', array($this, 'get_server')); }
function get_server($args) { $rcmail = rcmail::get_instance();
// add code to determine which server user is on
$new_server = "new.server.dom";
// alter the server as follows
if (isset($args['host'])) {
$args['host'] = $new_server;
}
if (isset($args['smtp_server'])) {
$args['smtp_server'] = $new_server;
}
return $args;
}
}
List info: http://lists.roundcube.net/dev/
Pedro R. Benito da Rocha wrote:
Hello,
I'm writting a plugin for select host from user's login, so I have to not show the server box on login form.
If I leave 'default_host' blank at main.inc.php the "Server" box appears, and if I put something on the config variable the plugin does not work, because default host takes precedence over the host selected by the plugin.
Is there a way to hide "server" box on login form without assign a value to "default_host" or I have found a bug on default_host setting?
I don't know how you wrote your plugin but the 'authenticate' should allow you to set the host. Just set any value (e.g. localhost) to the default_host config parameter and then set 'host' in the return value of the 'authenticate' hook. See index.php line 84 how that hook is implemented.
~Thomas
List info: http://lists.roundcube.net/dev/
Thomas Bruederli escribió:
Pedro R. Benito da Rocha wrote:
Hello,
I'm writting a plugin for select host from user's login, so I have to not show the server box on login form.
If I leave 'default_host' blank at main.inc.php the "Server" box appears, and if I put something on the config variable the plugin does not work, because default host takes precedence over the host selected by the plugin.
Is there a way to hide "server" box on login form without assign a value to "default_host" or I have found a bug on default_host setting?
I don't know how you wrote your plugin but the 'authenticate' should allow you to set the host. Just set any value (e.g. localhost) to the default_host config parameter and then set 'host' in the return value of the 'authenticate' hook. See index.php line 84 how that hook is implemented.
When I leave 'default_host' blank, server box appears in login form but plugin works ok. When I put something on 'default_host' plugin doesn't work, because server tries to connect to 'default_host'.
The plugin is attached, ¿I am doing something wrong?
Thanks,
Pedro
Hello,
I have found the cause of plugin fail. In program/include/rcmail.php: line 450: else if (!empty($config['default_host']) && $host != $config['default_host']) line 451: return false;
If a plugin modifies 'default_host' login is aborted ¿why?
Regards,
Pedro
Pedro R. Benito da Rocha escribió:
Thomas Bruederli escribió:
Pedro R. Benito da Rocha wrote:
Hello,
I'm writting a plugin for select host from user's login, so I have to not show the server box on login form.
If I leave 'default_host' blank at main.inc.php the "Server" box appears, and if I put something on the config variable the plugin does not work, because default host takes precedence over the host selected by the plugin.
Is there a way to hide "server" box on login form without assign a value to "default_host" or I have found a bug on default_host setting?
I don't know how you wrote your plugin but the 'authenticate' should allow you to set the host. Just set any value (e.g. localhost) to the default_host config parameter and then set 'host' in the return value of the 'authenticate' hook. See index.php line 84 how that hook is implemented.
When I leave 'default_host' blank, server box appears in login form but plugin works ok. When I put something on 'default_host' plugin doesn't work, because server tries to connect to 'default_host'.
The plugin is attached, ¿I am doing something wrong?
Thanks,
Pedro
List info: http://lists.roundcube.net/dev/