[dev] [patch] conf.php backup

Jan Schneider jan at horde.org
Thu Aug 12 01:29:54 PDT 2004


Zitat von Andrew Coleman <mercury at appisolutions.net>:

> Well, i was going to do the cool thing and post a patch to
> bugs.horde.org but it appears to be under some maintenance. Here is a
> proposed patch for generating and reverting configuration settings.

Looks good, but I'd like to see one change. It doesn't make sense to check
twice if the revert button has been clicked. If it has been clicked, it
doesn't matter if the form validates or not, this would also save you from
declaring the revert code in a function.
This should be the logic:

if (revert) {
   revert;
} else {
   if ($form->validate()) {
     make_config;
   } elseif ($form->isSubmitted()) {
     show_error;
   }
}

Jan.

--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting.php


More information about the dev mailing list