Drupal: How to Turn Site to "Read Only" Mode
I would tell you how to disable the ability to add/change content on your site. This is temporary solution! This could help you when you change NS-servers and move data to other server; when you need to keep the site available but do not change its content.
Actually you need to turn your site to “read only” mode – visitors will be able to read content but couldn’t change it. At this time, admin can administer the site.
“Offline” mode (a mode for executing technical works) doesn’t fit in this case, because the site would be unavailable for visitors.
Solutions:
- Set the required permissions
- Use SQL-scripts
- Create a custom module that would change permissions
- Use Mode module
Use Mode module
Here is official module’s page: Mode
This module works for Drupal 6 only.
Features:
- Turn the site to “read only” mode when users just have ‘access content’ permissions.
- Manually switch permissions to specified modules like search, restricting access to ‘search content’ and ‘use advanced search’.
- Craete permission templates for multisiting to make administration easier.
Set the required permissions
- Open “Permissions” page (/admin/user/permissions in Drupal 6)
- Save the page to your PC to make able to restore permissions in future or use Site Documentation module
- Uncheck unnecessary roles (Guests, Registered users etc.) for actions which can change site content.
Actions of users who can change site content:
comment module
- post comments
book module
- add content to files
- create new files
node module
- access to site content
- manage content types
- manage content
- create *
- delete any *
- delete own *
- delete revisions
- edit any *
- edit own *
- switch between redactions
user module
- change username
Tip!
Don’t forget to turn these permissions on.
Use SQL-scripts
- Create a dump of permission table (specify table deletion if it exists).
- Set the required permissions for ‘read only’ mode in Drupal admin area
- Create a dump of permission again
So we got 2 files with sql-sripts. one turns ‘read only’ mode and another one turn it off.
This method has one disadvantage. If dumps are old and permissions were changed since that, you couldn’t use the dumps and will need to create new sql-scripts.