From e520780cf6f7106c62385f9bd07c92cb9e1ac6ac Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Mon, 8 Mar 2010 20:24:31 -0500 Subject: [PATCH] Shout: improve form validation logic --- shout/extensions.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/shout/extensions.php b/shout/extensions.php index df3468edb..ca72760c1 100644 --- a/shout/extensions.php +++ b/shout/extensions.php @@ -26,12 +26,10 @@ switch ($action) { case 'add': case 'edit': $vars = Horde_Variables::getDefaultVariables(); - $vars->set('account', $curaccount['code']); + $vars->set('account', $curaccount); $Form = new ExtensionDetailsForm($vars); - $FormValid = $Form->validate($vars, true); - - if ($Form->isSubmitted() && $FormValid) { + if ($Form->isSubmitted() && $Form->validate($vars, true)) { // Form is Valid and Submitted try { $Form->execute(); @@ -54,7 +52,7 @@ case 'edit': $vars->set('oldextension', $extension); } $vars->set('action', $action); - $Form = new ExtensionDetailsForm($vars); + //$Form = new ExtensionDetailsForm($vars); // Make sure we get the right template below. $action = 'edit'; -- 2.11.0