summaryrefslogtreecommitdiff
path: root/plugins/password/drivers/virtualmin.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/password/drivers/virtualmin.php')
-rw-r--r--plugins/password/drivers/virtualmin.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/password/drivers/virtualmin.php b/plugins/password/drivers/virtualmin.php
index 2c7aee617..36c54664b 100644
--- a/plugins/password/drivers/virtualmin.php
+++ b/plugins/password/drivers/virtualmin.php
@@ -18,8 +18,7 @@ class rcube_virtualmin_password
{
function save($currpass, $newpass)
{
- $rcmail = rcmail::get_instance();
-
+ $rcmail = rcmail::get_instance();
$format = $rcmail->config->get('password_virtualmin_format', 0);
$username = $_SESSION['username'];
@@ -48,14 +47,14 @@ 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);
}
+ if (!$domain) {
+ $domain = $rcmail->user->get_username('domain');
+ }
+
$username = escapeshellcmd($username);
$domain = escapeshellcmd($domain);
$newpass = escapeshellcmd($newpass);