From 02868eb680b18f20199297dc1903ba0f47cc7f16 Mon Sep 17 00:00:00 2001 From: Valkum Date: Sun, 26 Dec 2010 20:56:32 +0000 Subject: [PATCH] Added some TODOs and MARKs Some lines in the shells are duplicate git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@917 a1433add-5e2c-0410-b055-b7f2511e0802 --- scripts/shells/alias.php | 24 ++---------------------- scripts/shells/domain.php | 24 ++---------------------- scripts/shells/shell.php | 1 + scripts/shells/user.php | 25 ++----------------------- 4 files changed, 7 insertions(+), 67 deletions(-) diff --git a/scripts/shells/alias.php b/scripts/shells/alias.php index 1c821f11..04e00b36 100644 --- a/scripts/shells/alias.php +++ b/scripts/shells/alias.php @@ -12,28 +12,8 @@ class PostfixAdminAlias extends Shell { var $tasks = array('Add', 'Update', 'Delete', 'View'); -/** - * Starts up the the Shell - * allows for checking and configuring prior to command or main execution - * can be overriden in subclasses - * - * @access public - */ - function startup() { - $this->_welcome(); - $CONF = Config::read('all'); - } -/** - * Displays a header for the shell - * - * @access protected - */ - function _welcome() { - $this->out("\nWelcome to Postfixadmin-CLI v" . $this->Dispatch->version); - $this->out("---------------------------------------------------------------"); - $this->out('Path: '. PATH); - $this->hr(); - } + + /** * Show help for this shell. diff --git a/scripts/shells/domain.php b/scripts/shells/domain.php index d4cac8aa..cabebc8a 100644 --- a/scripts/shells/domain.php +++ b/scripts/shells/domain.php @@ -12,28 +12,8 @@ class PostfixAdminDomain extends Shell { var $tasks = array('Add', 'Update', 'Delete', 'View'); -/** - * Starts up the the Shell - * allows for checking and configuring prior to command or main execution - * can be overriden in subclasses - * - * @access public - */ - function startup() { - $this->_welcome(); - $CONF = Config::read('all'); - } -/** - * Displays a header for the shell - * - * @access protected - */ - function _welcome() { - $this->out("\nWelcome to Postfixadmin-CLI v" . $this->Dispatch->version); - $this->out("---------------------------------------------------------------"); - $this->out('Path: '. PATH); - $this->hr(); - } + + /** * Show help for this shell. diff --git a/scripts/shells/shell.php b/scripts/shells/shell.php index 9f7a854e..85b96d9c 100644 --- a/scripts/shells/shell.php +++ b/scripts/shells/shell.php @@ -167,6 +167,7 @@ class Shell { */ function startup() { $this->_welcome(); + $CONF = Config::read('all'); } /** * Displays a header for the shell diff --git a/scripts/shells/user.php b/scripts/shells/user.php index 6ae99fd8..57cbf7de 100644 --- a/scripts/shells/user.php +++ b/scripts/shells/user.php @@ -12,28 +12,7 @@ class PostfixAdminUser extends Shell { var $tasks = array('Add', 'Update', 'Delete', 'Password', 'View'); -/** - * Starts up the the Shell - * allows for checking and configuring prior to command or main execution - * can be overriden in subclasses - * - * @access public - */ - function startup() { - $this->_welcome(); - $CONF = Config::read('all'); - } -/** - * Displays a header for the shell - * - * @access protected - */ - function _welcome() { - $this->out("\nWelcome to Postfixadmin-CLI v" . $this->Dispatch->version); - $this->out("---------------------------------------------------------------"); - $this->out('Path: '. PATH); - $this->hr(); - } + /** * Show help for this shell. @@ -157,7 +136,7 @@ class AddTask extends Shell { $handler = new UserHandler($address); $return = $handler->add($pw, $name, $quota, true, true ); - if( ! $return) { + if( $return == false ) { $this->err(join("\n", $handler->errormsg)); } else { $this->out("");