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

Contents of /contributions/modules/level1/level1.install

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


Revision 1.1 - (show annotations) (download) (as text)
Fri Jun 29 22:05:37 2007 UTC (2 years, 4 months ago) by dldege
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
Added installer, support for update,delete grants
1 <?php
2
3 /**
4 * Implementation of hook_install().
5 */
6 function level1_install() {
7 switch ($GLOBALS['db_type']) {
8 case 'mysql':
9 case 'mysqli':
10 db_query("CREATE TABLE {level1_access} (
11 nid int(10) unsigned NOT NULL default '0',
12 gid int(10) unsigned NOT NULL default '0',
13 realm varchar(255) NOT NULL default '',
14 grant_view tinyint(3) unsigned NOT NULL default '0',
15 grant_update tinyint(3) unsigned NOT NULL default '0',
16 grant_delete tinyint(3) unsigned NOT NULL default '0',
17 PRIMARY KEY (nid,gid,realm))");
18 break;
19 }
20 }
21
22 /**
23 * Implementation of hook_uninstall().
24 */
25 function level1_uninstall() {
26 db_query('DROP TABLE {level1_access}');
27 }

  ViewVC Help
Powered by ViewVC 1.1.2