You are here

party_user.install in Party 8.2

Same filename and directory in other branches
  1. 7 modules/party_user/party_user.install

party_user.install Contains install hooks.

File

modules/party_user/party_user.install
View source
<?php

/**
 * @file party_user.install
 * Contains install hooks.
 */

/**
 * Implements hook_enable().
 */
function party_user_enable() {

  // Force core's setting to require e-mail verification on new user accounts
  // created by visitors, so we know users are who they say they are.
  variable_set('user_email_verification', TRUE);
}

/**
 * Implements hook_requirements().
 */
function party_user_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break at install time
  $t = get_t();

  // Check the core setting we set in party_user_enable() hasn't been reverted.
  if ($phase == 'runtime') {
    if (!variable_get('user_email_verification', TRUE)) {
      $requirements['party_user_core_verification'] = array(
        'title' => $t('New account email verification'),
        'description' => $t('The Party User module requires new user accounts to verifify their email addresses. You should change the setting on the <a href="!url">account settings page</a>.', array(
          '!url' => url('admin/config/people/accounts'),
        )),
        'severity' => REQUIREMENT_ERROR,
        'value' => $t('Not set'),
      );
    }
  }
  return $requirements;
}

/**
 * Bring across party_user_create_on_register variable to new format.
 */
function party_user_update_7001() {
  $on_registration = variable_get('party_user_create_on_register', FALSE) ? 'create' : 'nothing';
  variable_set('party_user_on_registration', $on_registration);
}

Functions

Namesort descending Description
party_user_enable Implements hook_enable().
party_user_requirements Implements hook_requirements().
party_user_update_7001 Bring across party_user_create_on_register variable to new format.