You are here

function secure_permissions_drush_toggle_active in Secure Permissions 7.2

Same name and namespace in other branches
  1. 6 includes/secure_permissions.drush.inc \secure_permissions_drush_toggle_active()
  2. 7 secure_permissions.drush.inc \secure_permissions_drush_toggle_active()

Callback function for drush secure-permissions.

Currently activates/deactivates the Secure Permissions module.

Parameters

$action: (string) 'on' to activate, 'off' to deactivate.

1 string reference to 'secure_permissions_drush_toggle_active'
secure_permissions_drush_command in ./secure_permissions.drush.inc
Implements hook_drush_command().

File

./secure_permissions.drush.inc, line 71
Drush commands for Secure Permissions.

Code

function secure_permissions_drush_toggle_active($action) {
  if ($action == 'on') {
    variable_set('secure_permissions_active', 1);
    _secure_permissions_message_drush('Secure Permissions module has been activated.', array(), 'success');
  }
  elseif ($action == 'off') {
    variable_set('secure_permissions_active', 0);
    _secure_permissions_message_drush('Secure Permissions module has been deactivated.', array(), 'success');
  }
  else {
    _secure_permissions_message_drush('Could not understand the response !active. Doing nothing.', array(
      '!active' => $active,
    ), 'error');
  }
}