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

Contents of /contributions/modules/couriermta/couriermta.install

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


Revision 1.2 - (show annotations) (download) (as text)
Thu Jun 19 12:22:21 2008 UTC (17 months, 1 week ago) by oadaeh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +78 -0 lines
File MIME type: text/x-php
Populating HEAD.
1 <?php
2 // $Id: couriermta.install,v 1.1.2.3 2007/11/07 16:04:34 oadaeh Exp $
3
4 /**
5 * Implementation of hook_install()
6 */
7 function couriermta_install() {
8 switch ($GLOBALS['db_type']) {
9 case 'mysqli':
10 case 'mysql':
11 $query = db_query(
12 "CREATE TABLE {couriermta_users} (
13 userid INT UNSIGNED NOT NULL DEFAULT '0',
14 email CHAR(128) NOT NULL DEFAULT '',
15 crypt CHAR(128) NOT NULL DEFAULT '',
16 clear CHAR(128) NOT NULL DEFAULT '',
17 uid INT(10) UNSIGNED NOT NULL DEFAULT '65534',
18 gid INT(10) UNSIGNED NOT NULL DEFAULT '65534',
19 home CHAR(255) NOT NULL DEFAULT '',
20 name CHAR(128),
21 maildir CHAR(255),
22 defaultdelivery CHAR(255),
23 quota CHAR(255),
24 auxoptions CHAR(255),
25 alias CHAR(128),
26 status TINYINT NOT NULL DEFAULT '0',
27 KEY userid (userid),
28 PRIMARY KEY (userid)
29 ) /*!40100 DEFAULT CHARACTER SET UTF8 */;");
30 break;
31
32 case 'pgsql':
33 break;
34 }
35 }
36
37
38 /**
39 * Implementation of hook_uninstall()
40 */
41 function couriermta_uninstall() {
42 switch ($GLOBALS['db_type']) {
43 case 'mysqli':
44 case 'mysql':
45 db_query('DROP TABLE {couriermta_users}');
46 break;
47
48 case 'pgsql':
49 break;
50 }
51
52 variable_del('couriermta_allow_email_alias');
53 variable_del('couriermta_defaultdelivery_pattern');
54 variable_del('couriermta_email_pattern');
55 variable_del('couriermta_email_users_address');
56 variable_del('couriermta_gid_pattern');
57 variable_del('couriermta_home_pattern');
58 variable_del('couriermta_maildir_pattern');
59 variable_del('couriermta_name_pattern');
60 variable_del('couriermta_options_pattern');
61 variable_del('couriermta_password');
62 variable_del('couriermta_password_type');
63 variable_del('couriermta_password_users_password');
64 variable_del('couriermta_quota_pattern');
65 variable_del('couriermta_uid_pattern');
66 variable_del('couriermta_users_name');
67 variable_del('couriermta_use_token_module');
68 }
69
70
71 /**
72 * Implementation of hook_update()
73 */
74 function couriermta_update_5100() {
75 $items = array();
76 $items[] = update_sql("ALTER TABLE {couriermta_users} DROP KEY userid");
77 return $items;
78 }

  ViewVC Help
Powered by ViewVC 1.1.2