You are here

guardr_core.install in Guardr Core 7

Install, update and uninstall functions for the deploy_info module.

File

guardr_core.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the deploy_info module.
 */

/**
 * Implements hook_requirements().
 *
 * Display the contents of VERSION.txt on the status report page.
 */
function guardr_core_requirements($phase) {
  $requirements = array();
  if ($phase === 'runtime' && file_exists('profiles/guardr/VERSION.txt')) {
    $version = trim(file_get_contents('profiles/guardr/VERSION.txt'));
    $requirements['distro_guardr'] = array(
      'title' => 'Distribution version (Guardr)',
      'value' => check_plain($version),
      'severity' => REQUIREMENT_INFO,
    );
  }
  return $requirements;
}

/**
 * Enable the remove_generator module.
 */
function guardr_core_update_7100() {
  if (module_enable(array(
    'remove_generator',
  ))) {
    return t('The remove_generator module has been enabled by Guardr Core.');
  }
  else {
    return t('You should install the remove_generator module.');
  }
}

/**
 * Set daily security update checks.
 */
function guardr_core_update_7102() {
  variable_set('update_check_frequency', 1);
  variable_set('update_check_disabled', 0);
  variable_set('update_notification_threshold', 'security');
  return t('Daily security update notifications have been set by Guardr Core.');
}

/**
 * Set daily security update checks.
 */
function guardr_core_update_7103() {
  if (module_enable(array(
    'no_autocomplete',
  ), FALSE)) {
    variable_set('no_autocomplete_login_form', '1');
    variable_set('no_autocomplete_profile_form', '1');
    return t('No Autocomplete options have been activated by Guardr Core.');
  }
  else {
    return t('You should install the no_autocomplete module.');
  }
}

Functions

Namesort descending Description
guardr_core_requirements Implements hook_requirements().
guardr_core_update_7100 Enable the remove_generator module.
guardr_core_update_7102 Set daily security update checks.
guardr_core_update_7103 Set daily security update checks.