|
|
@ -41,17 +41,17 @@ class rcube_virtualmin_password
|
|
|
|
// Get the domain using virtualmin CLI:
|
|
|
|
// Get the domain using virtualmin CLI:
|
|
|
|
exec("$curdir/chgvirtualminpasswd list-domains --mail-user $username --name-only", $output_domain, $returnvalue);
|
|
|
|
exec("$curdir/chgvirtualminpasswd list-domains --mail-user $username --name-only", $output_domain, $returnvalue);
|
|
|
|
|
|
|
|
|
|
|
|
if ($returnvalue == 0 && count($output_domain) == 1)
|
|
|
|
if ($returnvalue == 0 && count($output_domain) == 1) {
|
|
|
|
{
|
|
|
|
|
|
|
|
$domain = trim($output_domain[0]);
|
|
|
|
$domain = trim($output_domain[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
rcube::raise_error(array(
|
|
|
|
rcube::raise_error(array(
|
|
|
|
'code' => 600,
|
|
|
|
'code' => 600,
|
|
|
|
'type' => 'php',
|
|
|
|
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'message' => "Password plugin: Unable to execute $curdir/chgvirtualminpasswd or domain for mail-user '$username' not known to Virtualmin"
|
|
|
|
'message' => "Password plugin: Unable to execute $curdir/chgvirtualminpasswd or domain for mail-user '$username' not known to Virtualmin"
|
|
|
|
), true, false);
|
|
|
|
), true, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return PASSWORD_ERROR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$domain = escapeshellarg($domain);
|
|
|
|
$domain = escapeshellarg($domain);
|
|
|
@ -65,7 +65,6 @@ class rcube_virtualmin_password
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
rcube::raise_error(array(
|
|
|
|
rcube::raise_error(array(
|
|
|
|
'code' => 600,
|
|
|
|
'code' => 600,
|
|
|
|
'type' => 'php',
|
|
|
|
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'file' => __FILE__, 'line' => __LINE__,
|
|
|
|
'message' => "Password plugin: Unable to execute $curdir/chgvirtualminpasswd"
|
|
|
|
'message' => "Password plugin: Unable to execute $curdir/chgvirtualminpasswd"
|
|
|
|
), true, false);
|
|
|
|
), true, false);
|
|
|
|