summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery_installer.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-07-23 09:29:29 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-07-23 09:29:29 -0700
commitac23b9be185d98e3b672dc4c9051dba1ec9d10fc (patch)
tree73b50afb60202930d7bed2ef982eef0be0106fe0 /modules/gallery/helpers/gallery_installer.php
parentfa0c17ab5be2724b7fa850f2077afe7e69d6ef4d (diff)
parent7f1a7ead589ce85e029ff0eb7f7e88bd04b8c8cb (diff)
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/gallery_installer.php')
-rw-r--r--modules/gallery/helpers/gallery_installer.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index 28c1990f..db13307f 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -305,6 +305,24 @@ class gallery_installer {
module::clear_var("gallery", "version");
module::set_version("gallery", $version = 7);
}
+
+ if ($version == 7) {
+ $groups = ORM::factory("group")->find_all();
+ $permissions = ORM::factory("permission")->find_all();
+ foreach($groups as $group) {
+ foreach($permissions as $permission) {
+ // Update access intents
+ $db->query("ALTER TABLE {access_intents} MODIFY COLUMN {$permission->name}_{$group->id} BINARY(1) DEFAULT NULL");
+ // Update access cache
+ if ($permission->name === "view") {
+ $db->query("ALTER TABLE {items} MODIFY COLUMN {$permission->name}_{$group->id} BINARY(1) DEFAULT FALSE");
+ } else {
+ $db->query("ALTER TABLE {access_caches} MODIFY COLUMN {$permission->name}_{$group->id} BINARY(1) NOT NULL DEFAULT FALSE");
+ }
+ }
+ }
+ module::set_version("gallery", $version = 8);
+ }
}
static function uninstall() {