Hi,

When a user moves/duplicates a site with clean_urls on, caching etc. he is very frequently locked out if he can't get mod_rewrite etc. working. Similarly, with the new Site Offline/Online feature, there doesn't seem to be any option for the admin to turn it off or log back in if he accidentally logs out..

The site/default/settings.php file has a section that allows overriding these DB variables. If the above mentioned variables can be added (and commented out), it might make things a lot easier to rescue the site without having to mess around with serialized variables in the variables table..

<?php
  $conf = array(
    'site_name' => 'My Drupal site',
    'clean_url' => 0,
    'clean_url_ok' => 0,
    'cache' => 0,
    'site_offline' => '0',
  );
?>

(I'm not entirely sure what clean_url_ok does, but I've added it in anyways..)

If and when all the variables to be added are decided, I'll attach a patch file.

Cheers
Karthik.
P.S User Experience/usability seemed like the best place to put this..

CommentFileSizeAuthor
#4 settings_5.patch579 bytesZen

Comments

Geary’s picture

This is an outstanding idea! I have been in this fix myself, and naturally looked in settings.php to see if there was an override. Having these "safe mode" settings visible and commented out would save a lot of people a lot of headache.

lekei’s picture

In my settings.php I have the ability to launch the site in safe mode:

/*
 * Safe mode -- launch site with safe settings
 */
if ($ALLOW_SAFE_SETTINGS && isset($_GET['SAFE_SETTINGS'])) {  
  $conf = array_merge( $conf,array(
    'site_name' => trim($_SERVER['HTTP_HOST'],"/").' (SAFE MODE)',
    'theme_default' => 'pushbutton',
    'clean_url' => 0,
    'cache' => 0,
    'site_offline' => '0'
  ));
}

at the beginning of settings.php there is a line allowing disabling safe mode:

// Permits launching the site in "safe mode" by acccesing it with:
// http://yourdomain?SAFE_SETTINGS
$ALLOW_SAFE_SETTINGS = TRUE;
Zen’s picture

@lekei: ah, that's a lot cleaner. But I assume that you're either using Civic or have added this in yourself? It isn't present in standard installations. I'm not sure the _GET is really required though.

Either way, you should make that into a patch and submit it.

Cheers
Karthik.

Zen’s picture

Status: Active » Needs review
StatusFileSize
new579 bytes

Patch attached.

-K

drlingo’s picture

I have tried to use your patch however, I receive a blank screen when I installed the patch. What must I do to make this work? This problem with the online, offline function needs to be resolved I know I can't be the only one.

nisguy’s picture

"This problem with the online, offline function needs to be resolved I know I can't be the only one."

That confused me too at first. Until I read you could visit http://localhost/user to get in the back-door login page.

cosmicdreams’s picture

Project: » Drupal core
Version: » 5.x-dev
Component: usability » base system

Sounds like a bug or feature request for Drupal not a userland issue.

drumm’s picture

Version: 5.x-dev » 6.x-dev
Status: Needs review » Needs work

This should go into 6.x first. I think there should be some comments explaining how these settings might be used.

If you do log out of a site in maintenance mode, just go to .../user/login and log in as user 1, which is allowed. Maybe the UI around that needs to be improved, but that should be handledin another issues.

pancho’s picture

Version: 6.x-dev » 7.x-dev

Moving feature requests to D7 queue.

Jaza’s picture

Version: 7.x-dev » 8.x-dev

Moving.

mlncn’s picture

Title: Variable overrides in settings.php » Document 'safe mode' (e.g., clean URLs off) variable overrides in settings.php
Issue tags: +SettingsAPI

Subscribe-- so the issue here is simply communicating what is possible, correct?

mile23’s picture

Version: 8.x-dev » 7.0
Assigned: Zen » Unassigned
Status: Needs work » Closed (fixed)

Look for the copious documentation around $update_free_access in default.settings.php.