You are here

function paranoia_remove_disabled_modules in Paranoia 7

Same name and namespace in other branches
  1. 8 paranoia.module \paranoia_remove_disabled_modules()

Disables modules based on the list in hook_paranoia_disable_modules().

2 calls to paranoia_remove_disabled_modules()
paranoia_enable in ./paranoia.install
Implements hook_enable().
paranoia_module_validate in ./paranoia.module
Custom validation function to make sure no banned modules were enabled.

File

./paranoia.module, line 85
Paranoia module file. Provides various extra security features.

Code

function paranoia_remove_disabled_modules() {
  $disabled_modules = module_invoke_all('paranoia_disable_modules');
  foreach ($disabled_modules as $module) {
    if (module_exists($module)) {
      drupal_set_message(t('The module %module has been disabled as it is not allowed on this site.', array(
        '%module' => $module,
      )));
      module_disable(array(
        $module,
      ));
    }
  }
}