shib_auth.install in Shibboleth Authentication 5.3
Same filename and directory in other branches
Installation file of the shib_auth module.
File
shib_auth.installView source
<?php
/**
* @file
* Installation file of the shib_auth module.
*/
/**
* Implementation of hook_install().
*/
function shib_auth_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {shib_auth} (\n id int(10) unsigned NOT NULL auto_increment,\n field varchar(128) default '',\n regexpression varchar(128) default '',\n role varchar(128) default '',\n PRIMARY KEY (id)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
break;
case pgsql:
//TODO
db_query("CREATE TABLE {shib_auth} (\n id iserial CHECK (id>=0),\n field varchar(128) default '',\n regexpression varchar(128) default '',\n role varchar(128) default '',\n PRIMARY KEY (id)\n )");
}
db_query("UPDATE {system} SET bootstrap=1, weight=-100 WHERE name='shib_auth'");
drupal_set_message(t('Shibboleth authentication module installed successfully.'));
}
/**
* Implementation of hook_uninstall().
*/
function shib_auth_uninstall() {
// Drop variables.
$variables = array(
'auth_link_text',
'shib_auth_handler_url',
'shib_auth_handler_protocol',
'shib_auth_wayf_uri',
'shib_auth_username_variable',
'shib_auth_username_email',
);
foreach ($variables as $variable) {
variable_del($variable);
}
db_query("DROP TABLE {shib_auth}");
drupal_set_message(t('The Shibboleth authentication module was uninstalled successfully.'));
}
/**
* Implementation of hook_update
*/
function shib_auth_update_5310() {
shib_auth_install();
}
Functions
Name | Description |
---|---|
shib_auth_install | Implementation of hook_install(). |
shib_auth_uninstall | Implementation of hook_uninstall(). |
shib_auth_update_5310 | Implementation of hook_update |