/[drupal]/contributions/modules/account_expiry/account_expiry.install
ViewVC logotype

Contents of /contributions/modules/account_expiry/account_expiry.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Mon Jan 28 07:30:28 2008 UTC (22 months ago) by jdsaward
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
Initial commit of Accountexpiry module
1 <?php
2 /**
3 *$Id:
4 *@package Custom
5 */
6
7 /**
8 * Implementation of hook_install().
9 */
10 function account_expiry_install() {
11 switch ($GLOBALS['db_type']) {
12 case 'mysql':
13 case 'mysqli':
14 $query = db_query("CREATE TABLE {account_expiry} (
15 uid int(10) unsigned NOT NULL default '0',
16 expiry_date int(10) unsigned NOT NULL default '0',
17 PRIMARY KEY (uid)
18 ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
19 break;
20 case 'pgsql':
21 $query = db_query("CREATE TABLE {account_expiry} (
22 uid int NOT NULL default '0',
23 expiry_date int NOT NULL default '0',
24 PRIMARY KEY (uid)
25 )");
26 break;
27 }
28 }
29
30 /**
31 * Implementation of hook_uninstall().
32 */
33 function account_expiry_uninstall() {
34 $query = db_query('DROP TABLE {account_expiry}');
35
36 if ($query) {
37 drupal_set_message('The Account Expiry module was uninstalled successfully.');
38 }
39 else {
40 drupal_set_message('There was an error removing the Account Expiry database tables.', 'error');
41 }
42 }

  ViewVC Help
Powered by ViewVC 1.1.2