From: Ben Klang Date: Tue, 9 Mar 2010 01:24:31 +0000 (-0500) Subject: Shout: improve form validation logic X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e520780cf6f7106c62385f9bd07c92cb9e1ac6ac;p=horde.git Shout: improve form validation logic --- 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';