You've already forked postfixadmin
mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2025-08-09 05:02:44 +03:00
shells/domain.php:
- *Task / __handle(): check $handler->result after calling "new" - AddTask / __handle(): - don't set domain in $values - it's already included in the "new" call - hardcode "active" to 1 - before, it accidently got the value of "aliases" - use $handler->set() and $handler->store instead of $handler->add() git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1211 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
@@ -142,8 +142,12 @@ class AddTask extends Shell {
|
||||
|
||||
|
||||
$handler = new DomainHandler($domain, 1);
|
||||
if (!$handler->result()) {
|
||||
$this->error("Error:",join("\n", $handler->errormsg));
|
||||
return;
|
||||
}
|
||||
|
||||
$values = array(
|
||||
'domain' => $domain,
|
||||
'description' => $desc,
|
||||
'aliases' => $a,
|
||||
'mailboxes' => $m,
|
||||
@@ -151,19 +155,22 @@ class AddTask extends Shell {
|
||||
'quota' => $d,
|
||||
'transport' => $handler->getTransport($t),
|
||||
'backupmx' => $backup,
|
||||
'active' => $a,
|
||||
'active' => 1,
|
||||
'default_aliases' => $default,
|
||||
);
|
||||
$return = $handler->add($values);
|
||||
|
||||
if(!$return) {
|
||||
if (!$handler->set($values)) {
|
||||
$this->error("Error:", join("\n", $handler->errormsg));
|
||||
}
|
||||
|
||||
if (!$handler->store()) {
|
||||
$this->error("Error:", join("\n", $handler->errormsg));
|
||||
} else {
|
||||
$this->out("");
|
||||
$this->out("Domain ( $domain ) generated.");
|
||||
$this->hr();
|
||||
}
|
||||
return;
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Displays help contents
|
||||
@@ -263,6 +270,11 @@ class DeleteTask extends Shell {
|
||||
*/
|
||||
function __handle($address) {
|
||||
$handler = new DomainHandler($address);
|
||||
if (!$handler->result()) {
|
||||
$this->error("Error:",join("\n", $handler->errormsg));
|
||||
return;
|
||||
}
|
||||
|
||||
$status = $handler->delete();
|
||||
if ($status == true) {
|
||||
$this->out("Domain '$address' was deleted.");
|
||||
@@ -334,6 +346,11 @@ class ViewTask extends Shell {
|
||||
|
||||
|
||||
$handler = new DomainHandler($domain);
|
||||
if (!$handler->result()) {
|
||||
$this->error("Error:",join("\n", $handler->errormsg));
|
||||
return;
|
||||
}
|
||||
|
||||
$status = $handler->view();
|
||||
if (!$status) {
|
||||
$this->error("Error:",join("\n", $handler->errormsg));
|
||||
|
Reference in New Issue
Block a user