Locker is a site authentication module using session to forbid access and hide website. One is required to login to gain access to the website. Locker is not a replacement for Drupal authentication but it serves as an additional layer to hide your Drupal
site from public. Locker is an alternative to HTTP Auth standard and recommended to be used in case your server doesn’t support HTTP Auth or you don’t have permission to set it up or you want additional features that Locker module provides.
WARNING - files will be still accessible via direct links!
Use cases
- White label development
- Verify site after update as anonymous user - is cache working correctly?
- Replacement for maintenance mode
- Alternative to HTTP Auth
- Hide site from Google Analytics
Drupal 8 Installation
* Install as you would normally install a contributed Drupal module.
See: https://www.drupal.org/docs/8/extending-drupal/installing-modules-composer dependencies for further information.
- composer require drupal/locker 8.x.*@dev
- composer require "drupal/locker ~8.1"
Drupal 7 Installation
- Extract Locker module to your sites/all/modules directory
- Enable the Locker module in admin/modules
Drupal 7 Re-Installation / update, for now:
- Disable and uninstall module then install new version and enable
Using Locker
- Activate module in Administration » Modules » Locker -> Configure
- Lock your Drupal site: Yes
- Set Username/passwords or Passphrase
- Click "Submit" to lock your drupal site
WARNING: This will lock your Drupal site immediately! Use your credentials to gain access. If you forget you credentials you need to use drush unlock.
- Unlock your Drupal site: No
- Click "Submit" to unlock your drupal site
Drush commands
- drush lock (choose options)
- drush lock u username password - to use username and password OR
- drush lock passphrase
- drush unlock
Drupal console commands
Lock site using drupal console:
- drupal locker:lock
- Select "yes" to lock using username/password or "no" to lock only using password
- Enter username or password to lock site
Unlock site using drupal console:
- drupal locker:unlock
Websolutions Agency can be contacted for paid customisation and setup of this module.
Project information
- Module categories: Administration Tools, Access Control, Security
- 30 sites report using this module
- Created by ws.agency on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.