diff --git a/scripts/shells/alias.php b/scripts/shells/alias.php index 3708eeac..6f0d9955 100644 --- a/scripts/shells/alias.php +++ b/scripts/shells/alias.php @@ -61,8 +61,8 @@ class DeleteTask extends Shell { function execute() { if (empty($this->args)) { - $this->help(); - //$this->__interactive(); +# $this->help(); + $this->__interactive(); } if (!empty($this->args[0])) { @@ -75,12 +75,12 @@ class DeleteTask extends Shell { * @access private */ function __interactive() { - $question[] = "Which Address do you want to view?"; + $question[] = "Which Address do you want to delete?"; $address = $this->in(join("\n", $question)); - $question = "Do you really want to delete mailbox of '$address'?"; + $question = "Do you really want to delete the alias '$address'?"; $create = $this->in($question, array('y','n')); @@ -99,19 +99,14 @@ class DeleteTask extends Shell { */ function __handle($address) { -### TODO: don't use MailboxHandler, instead add delete function to AliasHandler (if not already there) -### using MailboxHandler for deleting aliases is like taking a sledgehammer to crack a nut -### (and will probably cause some error messages that I added today ;-) - -### Implemented check it please! $handler = new AliasHandler(); $handler->init($address); $status = $handler->delete(); if ($status == true) { - $this->out("Mailbox of '$address' was deleted."); + $this->out("Alias '$address' was deleted."); } else { - $this->error("Error:", join("\n", $handler->errormsg)); + $this->err($handler->errormsg); } return; @@ -195,6 +190,7 @@ class ViewTask extends Shell { if( $result['on_vacation'] ) { $this->out("This alias is a vacation address!"); } + $this->out("Active: " . $result['active']); } return; diff --git a/scripts/shells/domain.php b/scripts/shells/domain.php index 1b45ee8c..f54d89ee 100644 --- a/scripts/shells/domain.php +++ b/scripts/shells/domain.php @@ -92,7 +92,7 @@ class DeleteTask extends Shell { $question = "Do you really want to delete domain '$address'?"; $create = $this->in($question, array('y','n')); - $this->__handle($address); + if ($create == 'y') $this->__handle($address); } /** * Interactive @@ -102,7 +102,7 @@ class DeleteTask extends Shell { function __handle($address) { $handler = new DomainHandler(); if (!$handler->init($address)) { - $this->error("Error:",join("\n", $handler->errormsg)); + $this->err($handler->errormsg); return; } @@ -111,7 +111,7 @@ class DeleteTask extends Shell { $this->out("Domain '$address' was deleted."); } else { - $this->error("Error:", join("\n", $handler->errormsg)); + $this->err($handler->errormsg); } return; diff --git a/scripts/shells/mailbox.php b/scripts/shells/mailbox.php index 5f6c8eaf..7d1ef988 100644 --- a/scripts/shells/mailbox.php +++ b/scripts/shells/mailbox.php @@ -84,7 +84,7 @@ class DeleteTask extends Shell { $create = $this->in($question, array('y','n')); - $create == 'y' ? $random = true : $random = false; + $create == 'y' ? $create = true : $create = false; if ($create) $this->__handle($address); @@ -104,7 +104,7 @@ class DeleteTask extends Shell { $status = $handler->delete(); if ( ! $status ) { - $this->error("Error:", join("\n", $handler->errormsg)); + $this->err($handler->errormsg); } else { $this->out("Mailbox of '$address' was deleted.");