Hi,

What would be a good way letting users use Services during Site Maintenance mode?
I realise that normally this is not intended but it would be very useful during BETA-testing. A "Coming soon" (i.e. Site Maintenance) frontpage could be displayed to anonymous usera while beta testers could log in to access the site, and also to test the application using the Services (in my case a Flash app).

So, how do I make the services available during Site Maintenance mode?

Comments

skyredwang’s picture

interesting, I am wondering if Deploy Module actually does this: put site into maintenance mode to block normal users, then push data back and forth via Services with privileged access.

PWG’s picture

Interesting! Thanks, skyredwang! I'll look into it.

Josephnewyork’s picture

I second this... What can be done? I'm currently developing a site that needs to be launched along with its iPhone App counter-part, and in order to do all my dev of both, services needs to work. Is their a solution to this, or am I going to have to create a coming soon "home page" instead of using maintenance mode?

gdd’s picture

I don't think this is possible. You have to go through a standard Drupal menu callback as part of your request and Drupal is kicking it back before you even get to Services. There may be some kind of wacky hook_init() stuff we can do, but it would be somewhat ugly.

Josephnewyork’s picture

Yeah, I realize this and I'm developing a module that pretty much does what the maintenance mode does, but its really just a page theme switcher that arguments the URI at the init hook. Then you can manage it in the CMS, and not the settings.php file... Also it will allow coming soon message/titles, and it will work services. Maintenance mode will disable any PDA devise connection on production sites and this can't happen in such a portable age. Thanks heyrocker for your response.

marcingy’s picture

Status: Active » Closed (won't fix)

As pointed out in #4 this isn't really possible and certainly isn't a service feature.

gdd’s picture

Version: 6.x-2.2 » 7.x-3.x-dev
Category: support » feature
Status: Closed (won't fix) » Active

Note that in D7 you can possibly use the Maintenance Exemptions module

http://drupal.org/project/maintenance_exempt

It looks like D7 exposes some hooks which might make this possible, so I've moved this issue to that version and reopened as a possible feature request.

gdd’s picture

Status: Active » Postponed

Trying to clear out the 7.3 issue queue, will move these to 7.4 when it opens

marcingy’s picture

Status: Postponed » Active
ygerasimov’s picture

In order to implement this functionality we should add new checkbox to endpoint that will controll whether endpoint should be accessible when site is in maintenance mode and using hook_menu_site_status_alter() allow users to access that endpoint.

Volunteers to implement this feature are very welcome!

marcingy’s picture

Status: Active » Closed (won't fix)

No takers

kemsnake’s picture

Issue summary: View changes

Hello, i think it should be as

/*
 *  Implements hook_menu_site_status_alter().
 */
function my_module_menu_site_status_alter(&$menu_site_status, $path) {
  if ($menu_site_status == MENU_SITE_OFFLINE) {
    $paths = '';
    foreach (services_endpoint_load_all() as $endpoint) {
      if (empty($endpoint->disabled)) {
        // Add endpoint path with wildcard for all requests handling.
        $paths .= $endpoint->path . '/*' . PHP_EOL;
      }
    }
    // Allow access to services endpoints even if site is in offline mode.
    if (drupal_match_path($path, $paths)) {
      $menu_site_status = MENU_SITE_ONLINE;
    }
  }
}

*for drupal 7