Hi,

I've found problems when the module require login is activated and I've put the site offline, because the module always redirect you to the login page, and the site offline page will never be seen.

I found this problem when I was preparing my site to put it in the live environment, because I want to maintain the require login functionality, but also to show the site offline page.

To solve this problem adding an if statement before all checking the variable "site_offline", and if it's 0 (it means the site if offline) i do nothing.

You've attached the required patch to apply it

I hope you include it to the next module release

Comments

ericpalace’s picture

Take care about this change that is not compatible with the domain access module activated.

If you need to do this functionality with more than you domain, you must change the code:

if(variable_get('site_offline', 0) == 0){

to

  //Check the domain we're looking.
  global $_domain;
  //Check if the site we're looking is offline. If it's offline, don't apply 
  if(domain_conf_variable_get($_domain['domain_id'], 'site_offline', 0) == 0){

The way to check variables with the domain access module activated is different if not

Cheers!

Jeffrey C.’s picture

@ericpalace, does your solution work with Domain Access module not installed? Please advise so I can commit this and make a new release.

Reuben Unruh’s picture

The original patch is almost working for me in Drupal 7 along with this patch. This variable is 'maintenance_mode' instead of 'site_offline' in D7.

domain_conf_variable_get() is part of Domain Access so the changes in the first comment will not work unless this module is enabled.

Reuben Unruh’s picture

Title: Require login vs Site offline » Require login vs Site offline/Maintenance Mode (Needs backport to D6)
Version: 6.x-1.1 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new1.33 KB

Here is the D7 version of the patch:

  • Commit d2e239e on 7.x-1.x by Jeffrey C.:
    Issue #1968148 by ralva83638, mvd81NL, eelkeblok: Restore reset password...
Jeffrey C.’s picture

Issue summary: View changes
Status: Needs review » Fixed

Actually the patch doesn't work - in Drupal 7, maintenance mode is controlled by variable site_offline instead of maintenance_mode. I've fixed the bug manually. Thank you all for the contribution!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.