Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: How to Turn Site to "Read Only" Mode

Submitted by on November 5, 2010 – 8:50 amNo Comment

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.

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.