diff options
author | GDR\! <gdr@go2.pl> | 2012-05-24 11:56:39 +0200 |
---|---|---|
committer | GDR\! <gdr@go2.pl> | 2012-05-24 12:07:44 +0200 |
commit | 6ffe0beaa4524f3a0cce64415052bbdda44a16d8 (patch) | |
tree | b90513eb181f98415f6840ac396611e179edc94a /plugins | |
parent | 7eb4f2e1be6ee02bb386731209c77a156716b292 (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')
-rw-r--r-- | plugins/password/config.inc.php.dist | 3 | ||||
-rw-r--r-- | plugins/password/drivers/virtualmin.php | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist index aed0eaf28..37c79315d 100644 --- a/plugins/password/config.inc.php.dist +++ b/plugins/password/config.inc.php.dist @@ -308,7 +308,8 @@ $rcmail_config['hmailserver_server'] = array( // 5: domain-username // 6: username_domain // 7: domain_username -$rcmail_config['password_virtualmin_format'] = 0; +// 8: username@domain; mbox.username +$rcmail_config['password_virtualmin_format'] = 8; // pw_usermod Driver options 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); } |