There is a specific process that I perform in my website and requires that I block all user input during that period. Usually, the process does not take more than half an hour to be completed, and I do not want to turn my whole site off. Is there a module/way of blocking all user input (I don't want role specific options, just disable all input) and probably posting a message that will notify users that they cannot post comments or new content during the period?

In a way, I would like to make my website "read-only" for the period that the process is being executed.

Comments

cayenne’s picture

I was going to say "no" and then point to the "site maintenance" option, but a few more constructive thoughts occurred to me.

1. Create a static clone of your site (using webcrawler or wget), add a header that says "Site under maintenance, logins and input blocked temporarily", and point your site url to that.

2. Maybe less stupid would be to create a "No Input" theme or page template that sets the $user-uid to 0 if $user->uid <>1, effectively logging out any attempted logins. Again, you'll want some sort of warning or notice to the users.

3. Clone your site, make your changes on the clone, and then check the logs for any inputs to port manually. That seems like a good idea, but you will forget someting and then look bad.

Let us know what works!

:)

FortEZ’s picture

Thanks a lot for your suggestions. Some comments:

1) Regarding the static clone, the thing that worries me is that by the time the static clone is completed, there will be more data input from the users. It's a bit of overkill in my opinion.
2) This sounds like a good idea and is pretty close to the other suggestion from mtsanford. A problem here is that I want the warning to appear only on pages where the user could originally enter some inputs (comment forms, node creation forms etc).
3) This is what I'm doing right now, and believe me it is not cool... :S

I was thinking about Backup and Migrate... The solution goes like this:
- I clone my main site (A) and make the changes that I want to the clone site (B).
- In the meantime site (A) continues to receive comments and posts.
- When my job is finished, I backup the database from site (A) (through Backup and Migrate module) and Restore the database in site (B) (by using the sql file that I retrieved before).
- This process takes a couple of seconds and then I switch the elastic ip to point to site (B).

Do you think that this solution could worK?

If not, I will probably try to develop a module that will make a drupal site read only :-)

mtsanford’s picture

you could take away permissions to add comments, create content.

For the message clone your theme, add a message in the page.tpl.php, and switch to that theme during the process.

dmartens’s picture

Your desired function sounded so good that I did a search and found the following module that purports to limit posting:

http://drupalmodules.com/module/read-only-mode

Whether your desire to block "all input" is fully addressed by this module remains to be seen but at least this gives you (presumably) more than you had when you asked.

Disclaimer: I haven't tried this but will in the near future

FortEZ’s picture

I have tested this module in a virtual ubuntu server that has the exact same configuration with my website and it does not seem to work at all. If you try this module please let me know how it worked for you (since it seems like it has all the functionality that I need).