summaryrefslogtreecommitdiff
path: root/plugins/password/drivers/virtualmin.php
diff options
context:
space:
mode:
authorGDR\! <gdr@go2.pl>2012-05-24 11:56:39 +0200
committerAleksander Machniak <alec@alec.pl>2012-09-04 11:03:41 +0200
commita0f006748f6127e1e8cca23ffd7fabe1c75d5336 (patch)
treec700012e32960294e18b464090dc6878ef769b2a /plugins/password/drivers/virtualmin.php
parentf9db233b978856b5bb6559c8a366bd31df506aa0 (diff)
Password plugin made compatible with modern Virtualmin
Added a new username format in Virtualmin driver, which works for default Virtualmin settings where username is user.postfix and domain is taken from email address. Example: email - info@goodcoffee.com login - info.goodcof
Diffstat (limited to 'plugins/password/drivers/virtualmin.php')
-rw-r--r--plugins/password/drivers/virtualmin.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/password/drivers/virtualmin.php b/plugins/password/drivers/virtualmin.php
index b2547e07f..f6b9bd412 100644
--- a/plugins/password/drivers/virtualmin.php
+++ b/plugins/password/drivers/virtualmin.php
@@ -48,6 +48,10 @@ class rcube_virtualmin_password
$pieces = explode("_", $username);
$domain = $pieces[0];
break;
+ case 8: // domain taken from alias, username left as it was
+ $email = $rcmail->user->data['alias'];
+ $domain = substr(strrchr($email, "@"), 1);
+ break
default: // username@domain
$domain = substr(strrchr($username, "@"), 1);
}