Page MenuHomePhorge

D755.1775394259.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D755.1775394259.diff

diff --git a/lib/Kolab/DAV/Auth/HTTPBasic.php b/lib/Kolab/DAV/Auth/HTTPBasic.php
--- a/lib/Kolab/DAV/Auth/HTTPBasic.php
+++ b/lib/Kolab/DAV/Auth/HTTPBasic.php
@@ -175,6 +175,7 @@
$storage = $rcube->get_storage();
$login_lc = $rcube->config->get('login_lc');
$default_port = $rcube->config->get('default_port', 143);
+ $username_domain = $rcube->config->get('username_domain');
// parse $host
$a_host = parse_url($host);
@@ -193,6 +194,24 @@
$port = $default_port;
}
+ // Check if we need to add/force domain to username
+ if (!empty($username_domain)) {
+ $domain = is_array($username_domain) ? $username_domain[$host] : $username_domain;
+
+ if ($domain = rcube_utils::parse_host((string)$domain, $host)) {
+ $pos = strpos($username, '@');
+
+ // force configured domains
+ if ($pos !== false && $rcube->config->get('username_domain_forced')) {
+ $username = substr($username, 0, $pos) . '@' . $domain;
+ }
+ // just add domain if not specified
+ else if ($pos === false) {
+ $username .= '@' . $domain;
+ }
+ }
+ }
+
// Convert username to lowercase. If storage backend
// is case-insensitive we need to store always the same username
if ($login_lc) {

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 5, 1:04 PM (5 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18809205
Default Alt Text
D755.1775394259.diff (1 KB)

Event Timeline