Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2290 conf.pl gives version error when config.php is unreadable

closed-fixed
None
5
2006-10-07
2006-09-30
blentz
No

Very low priority, I'm sure, but if a Squirrelmail
config.php is unreadable (permissions-wise) by a user
who runs conf.pl, they are presented with the "older
version" error message:

WARNING:
The file "config/config.php" was found, but it is for
an older version of SquirrelMail. It is possible to still
read the defaults from this file but be warned that many
preferences change between versions. It is
recommended that
you start with a clean config.php for each upgrade
that you
do. To do this, just move config/config.php out of
the way.

Continue loading with the old config.php [y/N]?

If the user continues, conf.pl is run with no
information, e.g. no defaults are selected in any of
the configuration dialogs. This dialog is misleading
because it's really due to a stoopid user, and not a
version discrepancy.

Suggest that instead of doing an existence test (-e) of
config.php, do a readable test (-r) or writable test
(-w). This way, if the user can't read config.php, the
system at least loads up config_default.php (with some
actual values) and doesn't give the "older version"
message. It also gives them a new extra seconds to type
away blissfully unaware that they don't have permission
to save their changes.

Relevant section of conf.pl:
############################################################

# First, lets read in the data already in there...
############################################################

if ( -w "config.php" ) {
open( FILE, "config.php" );
while ( $line = <FILE> ) {

Discussion

  • Tomas Kuliavas
    Tomas Kuliavas
    2006-10-05

    • assigned_to: nobody --> tokul
     
  • Tomas Kuliavas
    Tomas Kuliavas
    2006-10-07

    • status: open --> closed-fixed
     
  • Tomas Kuliavas
    Tomas Kuliavas
    2006-10-07

    Logged In: YES
    user_id=225877

    fixed in 1.5.2cvs and 1.4.9cvs