You are here

function restrict_by_ip_install in Restrict Login or Role Access by IP Address 6.3

Same name and namespace in other branches
  1. 5 restrict_by_ip.install \restrict_by_ip_install()
  2. 6 restrict_by_ip.install \restrict_by_ip_install()
  3. 6.2 restrict_by_ip.install \restrict_by_ip_install()

Implementation of hook_install(). Creates a table of the variables that will be needed to use this module

File

./restrict_by_ip.install, line 7

Code

function restrict_by_ip_install() {
  $ret = drupal_install_schema('restrict_by_ip');
  $failed = array();
  foreach ($ret as $query) {
    if (!$query['success']) {
      $failed[] = $query['query'];
    }
  }
  if (empty($failed)) {
    drupal_set_message(t('Restrict Logon By IP module installed successfully.'));
  }
  else {
    drupal_set_message(t('Table installation for the Restrict Logon By IP module was unsuccessful. The following queries failed: !queries', array(
      '!queries' => theme('item_list', $failed),
    )), 'error');
  }
}