summaryrefslogtreecommitdiff
path: root/plugins/password/drivers/virtualmin.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-09-23 11:40:24 +0200
committerAleksander Machniak <alec@alec.pl>2013-09-23 11:40:24 +0200
commit0b17aae0cd86e0d253f804045cfe131bff50be1d (patch)
treeb77a0fdd39439e1551f9f54f6f2b329ae2a69c25 /plugins/password/drivers/virtualmin.php
parent221b407307d6b3f32a44788085c2076952303a77 (diff)
Fix setting domain in virtualmin password driver (#1489332)
Diffstat (limited to 'plugins/password/drivers/virtualmin.php')
-rw-r--r--plugins/password/drivers/virtualmin.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/password/drivers/virtualmin.php b/plugins/password/drivers/virtualmin.php
index 2d2f73f97..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'];
@@ -52,6 +51,10 @@ class rcube_virtualmin_password
$domain = substr(strrchr($username, "@"), 1);
}
+ if (!$domain) {
+ $domain = $rcmail->user->get_username('domain');
+ }
+
$username = escapeshellcmd($username);
$domain = escapeshellcmd($domain);
$newpass = escapeshellcmd($newpass);