[dev] [patch] conf.php backup

Jan Schneider jan at horde.org
Thu Aug 12 09:35:47 PDT 2004


Zitat von Coleman <mercury at appisolutions.net>:

> Quoting Jan Schneider <jan at horde.org>:
>
>> 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;
>>    }
>> }
>>
>
> You're right... Trying to make it work under too many conditions :P Try this
> one, it should be a lot cleaner.

Slightly changed and committed, thanks.

Jan.

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


More information about the dev mailing list