Hi,
I have searched about this in issue queue but did not find any entry.
What I mean about semi maintenance mode is that in this site will be running running but no posting will be allowed (as we see on youtube and some other sites), only login is allowed, because of protected contents . I know this can be archived through permission, but that is quit laborious and it very much possible if you can miss few things, specially when you are using many cck types ( and if you are using cck field permissions) permission page itself become too big, in my current development site it is 8 page print out.
I think this is a must need feature, what other have to say.

--
Sharique

CommentFileSizeAuthor
#4 romode-6.x-1a2.zip1.55 KBsharique
#3 romode-6.x-1a.tar_.gz1011 bytessharique

Comments

sharique’s picture

I'm trying to develop this functionality in a separate module. I'm a beginner in module development.

I have written this code for testing, it is not working properly. Please tell me what's wrong with this?

function hook_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'node_form') {    
    drupal_set_message(t('Site is in read only mode.'));
  }  
}

This code is written for D6, I'll port it to D7 later.

sharique’s picture

I have write this code in a separate module and it works.

function mymodule_form_alter(&$form, $form_state, $form_id) {  
  if (isset($form['#node']) && $form_id == $form['#node']->type .'_node_form')
  {
    drupal_set_message(t('Site is in read only mode.')); // messgae to be displayed on the site
    drupal_goto('node/1'); // page of the warning page to displayed
  }  
}

Note: It is for D6 need to be tested with D7.
--
Sharique

sharique’s picture

StatusFileSize
new1011 bytes

Here is the alpha release of module for drupal 6. It is working. There is one problem - it not loading setting in admin page.
--
Sharique

sharique’s picture

StatusFileSize
new1.55 KB

Second alpha for d6
setting not loading - fixed

Emyr42’s picture

Shouldn't a read-only mode disable Statistics and other stuff which updates the DB?

sharique’s picture

I'm don't think so, because in most of the cases (AFAIK) site won't be down for long period except upgrading whole site (like from D5 to D6). Also I want keep login enabled because some posting might require permissions.

If you think "read only" is not the appropriate name for the module, so please suggest new name. What about "semi- maintenance mode"?

--
Sharique

Grayside’s picture

Perhaps something like "Site Lock". In the sense of locked-from-editing.

I've been thinking about a module rather like this. Instead of hook_form_alter, try looking at hook_menu_alter to more directly reroute the traffic. A natural step 2 would be token-enabled template messages for display at the rerouted paths.

sun.core’s picture

Version: 7.x-dev » 8.x-dev
valthebald’s picture

This sounds like a natural addition. Can we still add this to D8?

sharique’s picture

Issue summary: View changes

This is implemented in separate module, Read only mode.

valthebald’s picture

Status: Active » Closed (won't fix)

Great, I'll mark this won't fix then