diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-11-29 22:47:15 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-11-29 22:47:15 +0000 |
commit | 4271f7702a2754d8470949209f2db82990eb2d1a (patch) | |
tree | 6c7bc6933f58a0462373f550d219ab07308d51f4 /core/helpers | |
parent | 6c2869f8227944e56b6bb73da0d72b4c52f87da9 (diff) |
Add access model (not fully baked yet).
Update scaffolding to allow addition of just albums (helpful for testing permissions)
Diffstat (limited to 'core/helpers')
-rw-r--r-- | core/helpers/core_installer.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/core/helpers/core_installer.php b/core/helpers/core_installer.php index 1066b08c..792798ea 100644 --- a/core/helpers/core_installer.php +++ b/core/helpers/core_installer.php @@ -31,12 +31,12 @@ class core_installer { } if ($version == 0) { - $db->query("CREATE TABLE `modules` ( + $db->query("CREATE TABLE `access` ( `id` int(9) NOT NULL auto_increment, - `name` char(255) default NULL, - `version` int(9) default NULL, - PRIMARY KEY (`id`), - UNIQUE KEY(`name`)) + `item_id` int(9), + `group_id` int(9) NOT NULL, + `perm` char(255) default NULL, + PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); $db->query("CREATE TABLE `items` ( @@ -62,6 +62,14 @@ class core_installer { KEY `type` (`type`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE `modules` ( + `id` int(9) NOT NULL auto_increment, + `name` char(255) default NULL, + `version` int(9) default NULL, + PRIMARY KEY (`id`), + UNIQUE KEY(`name`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + foreach (array("albums", "resizes") as $dir) { @mkdir(VARPATH . $dir); } @@ -83,6 +91,7 @@ class core_installer { public static function uninstall() { $db = Database::instance(); + $db->query("DROP TABLE IF EXISTS `access`;"); $db->query("DROP TABLE IF EXISTS `items`;"); $db->query("DROP TABLE IF EXISTS `modules`;"); system("/bin/rm -rf " . VARPATH . "albums"); |