|
From: Eric O. <er...@ob...> - 2003-06-21 20:54:45
|
on 18/6/03 1:01 pm, Marco van Beek at mva...@su... wrote:
> Hi All,
>
> I haven't seen this reported on the list, but I think there is a bug in 1.3
> when saving the ppp profiles. It seems to save the settings file as
> "setting-" without the number, and the profile list dropdown always shows
> empty profiles.
>
> As long as you only have one profile, it is fine, but if you set up a second
> profile, it overwrites the first.
>
> I think this may be to do with needing to select a profile before saving, as
> the file saving routine uses a variable, which probably isn't set if you
> start on a blank page. I think the line I mean is indicated below. If there
> isn't a $pppsettings{'PROFILE'} variable set, it would be blank, causing
> what I see when it saves the profile. The workaround isn't difficult, but
> may be we need some additional error checking here asking people to select a
> blank profile first, maybe?
>
> ===========================
> if ($errormessage) {
> $pppsettings{'VALID'} = 'no'; }
> else {
> $pppsettings{'VALID'} = 'yes'; }
>
> # write cgi vars to the file.
>>>> &writehash("${swroot}/ppp/settings-$pppsettings{'PROFILE'}",
> \%pppsettings);
>
> # make link and write secret file.
> &updatesettings();
> &writesecrets();
>
> &log("$tr{'profile saved'} $pppsettings{'PROFILENAME'}");
> =============================
>
> Regards
>
> Marco van Beek
> Supporting Role Ltd.
Hi
I can confirm this behaviour. Can I suggest adding this into the error
checking when the action is 'save'?
if ( $pppsettings{'PROFILE'} eq '') {
$errormessage = $tr{'select a profile'};
goto ERROR; }
and adding the translated phrase to en.pl (* required). You may want to pick
a better error message, such as "Select a profile before saving" or "Select
a profile first".
Anybody else like to test and confirm this?
Eric
(* It won't appear as an error with a blank errormessage string).
|