You are here

commerce_ups.install in Commerce UPS 7.2

Same filename and directory in other branches
  1. 7 commerce_ups.install

Handles installation for Commerce UPS module.

File

commerce_ups.install
View source
<?php

/**
 * @file
 * Handles installation for Commerce UPS module.
 */

/**
 * Implements hook_uninstall().
 */
function commerce_ups_uninstall() {
  $fields = array(
    'commerce_ups_account_id',
    'commerce_ups_user_id',
    'commerce_ups_password',
    'commerce_ups_access_key',
    'commerce_ups_encrypt',
    'commerce_ups_services',
    'commerce_ups_company_name',
    'commerce_ups_address_line_1',
    'commerce_ups_address_line_2',
    'commerce_ups_city',
    'commerce_ups_state',
    'commerce_ups_postal_code',
    'commerce_ups_country_code',
    'commerce_ups_packaging',
    'commerce_ups_pick_up_schedule',
    'commerce_ups_show_logo',
    'commerce_ups_default_package_size_length',
    'commerce_ups_default_package_size_width',
    'commerce_ups_default_package_size_height',
    'commerce_ups_rates_timeout',
    'commerce_ups_shipto_residential',
    'commerce_ups_log',
    'commerce_ups_negotiated_rates',
  );
  foreach ($fields as $data) {
    variable_del($data);
  }
}
function commerce_ups_requirements($phase) {
  $requirements = array();

  // Ensure translations don't break during installation.
  $t = get_t();

  // The old (insecure) AES module is still being used.
  if (module_exists('aes') && !module_exists('real_aes')) {
    $requirements['commerce_ups_encrypt_credentials'] = array(
      'title' => $t('Commerce UPS'),
      'severity' => REQUIREMENT_ERROR,
      'description' => $t('The AES Encryption module is obsolete and no longer secure, therefore your UPS credentials are not secure. Please see the the Commerce UPS README for instructions on upgrading to the Real AES module.'),
    );
  }
  elseif (!module_exists('real_aes')) {
    $requirements['commerce_ups_encrypt_credentials'] = array(
      'title' => $t('Commerce UPS'),
      'severity' => REQUIREMENT_WARNING,
      'description' => $t('Real AES module is not installed, therefore your UPS credentials will not be encrypted.'),
    );
  }
  return $requirements;
}