You are here

securitytxt.install in Security.txt 7

Install, update and uninstall functions for the securitytxt module.

File

securitytxt.install
View source
<?php

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

/**
 * Implements hook_install().
 *
 * @see http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_install/7
 */
function securitytxt_install() {
  $settings = array();
  $settings['enabled'] = FALSE;
  $settings['contact_email'] = '';
  $settings['contact_phone'] = '';
  $settings['contact_url'] = '';
  $settings['encryption_key_url'] = '';
  $settings['policy_url'] = '';
  $settings['acknowledgement_url'] = '';
  $settings['signature_text'] = '';
  variable_set('securitytxt', $settings);

  /* Configure permissions */
  user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
    'view securitytxt',
  ));
  user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array(
    'view securitytxt',
  ));
}

/**
 * Implements hook_uninstall().
 *
 * @see http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_uninstall/7
 */
function securitytxt_uninstall() {
  variable_del('securitytxt');
}

Functions