You are here

function shib_auth_install in Shibboleth Authentication 6.3

Same name and namespace in other branches
  1. 5.3 shib_auth.install \shib_auth_install()
  2. 5.2 shib_auth.install \shib_auth_install()
  3. 6.4 shib_auth.install \shib_auth_install()
  4. 6 shib_auth.install \shib_auth_install()
  5. 6.2 shib_auth.install \shib_auth_install()

Implementation of hook_install().

Hook to install module, and enable it as a block

File

./shib_auth.install, line 12
This is the install file of the Shibboleth authentication module for Drupal system

Code

function shib_auth_install() {
  drupal_install_schema('shib_auth');

  // Place block into the 'blocks' table manually
  foreach (list_themes() as $key => $theme) {
    if ($theme->status) {

      // Delete block from database for version changes
      $block_query = db_query("SELECT * FROM {blocks} WHERE module = 'shib_auth'");
      if (!db_fetch_object($block_query)) {
        db_query("INSERT INTO {blocks} (visibility, pages, custom, title, module, theme, status, weight, delta, cache, region) VALUES(%d, '%s', %d, '%s', '%s', '%s', %d, %d, '%s', %d, '%s')", 0, '', 0, '', 'shib_auth', $theme->name, TRUE, 0, 0, BLOCK_NO_CACHE, 'left');
      }
    }
  }
  cache_clear_all(NULL, 'cache_block');
  drupal_set_message(t('Shibboleth authentication module installed successfully.'));
}