summaryrefslogtreecommitdiff
path: root/plugins/http_authentication/http_authentication.php
diff options
context:
space:
mode:
authorJohannes Weißl <jargon@molb.org>2012-12-02 18:50:11 +0100
committerJohannes Weißl <jargon@molb.org>2012-12-03 21:44:46 +0100
commitaec2869e49ae178a44917f6829960a4da76b0121 (patch)
tree9e6eb0847becaf5002b3f68b5d7072fa42c6f5d9 /plugins/http_authentication/http_authentication.php
parent0fa54df638a0b0f514d1bfba3cefb93e38991a35 (diff)
Add host config option to http_authentication plugin.
This is useful if the users are free to choose arbitrary mail hosts (or from a list), but have one host they usually want to log into. Otherwise the username/password must always be typed in twice.
Diffstat (limited to 'plugins/http_authentication/http_authentication.php')
-rw-r--r--plugins/http_authentication/http_authentication.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/http_authentication/http_authentication.php b/plugins/http_authentication/http_authentication.php
index a14b5cbcc..382613889 100644
--- a/plugins/http_authentication/http_authentication.php
+++ b/plugins/http_authentication/http_authentication.php
@@ -11,6 +11,8 @@
*
* See logout.html (in this directory) for an example how HTTP auth can be cleared.
*
+ * For other configuration options, see config.inc.php.dist!
+ *
* @version @package_version@
* @license GNU GPLv3+
* @author Thomas Bruederli
@@ -46,6 +48,13 @@ class http_authentication extends rcube_plugin
function authenticate($args)
{
+ // Load plugin's config file
+ $this->load_config();
+
+ $host = rcmail::get_instance()->config->get('http_authentication_host');
+ if (is_string($host) && trim($host) !== '')
+ $args['host'] = rcube_idn_to_ascii(rcube_parse_host($host));
+
// Allow entering other user data in login form,
// e.g. after log out (#1487953)
if (!empty($args['user'])) {