From 87fde3f360d557d48241d09cae4f25949e748d4f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 5 Jun 2010 23:35:32 -0700 Subject: Create a UI under Admin > Settings > Comments where you can limit comments only to registered users. It's simplistic, but is better than adding a permission since generally this setting will be used Gallery-wide. Fixes ticket #1002 --- modules/comment/helpers/comment_installer.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules/comment/helpers/comment_installer.php') diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php index 9ca47f1a..7a32bf67 100644 --- a/modules/comment/helpers/comment_installer.php +++ b/modules/comment/helpers/comment_installer.php @@ -47,7 +47,8 @@ class comment_installer { DEFAULT CHARSET=utf8;"); module::set_var("comment", "spam_caught", 0); - module::set_version("comment", 2); + module::set_var("comment", "access_permissions", "everybody"); + module::set_version("comment", 3); } static function upgrade($version) { @@ -56,6 +57,11 @@ class comment_installer { $db->query("ALTER TABLE {comments} CHANGE `state` `state` varchar(15) default 'unpublished'"); module::set_version("comment", 2); } + + if ($version == 2) { + module::set_var("comment", "access_permissions", "everybody"); + module::set_version("comment", 3); + } } static function uninstall() { -- cgit v1.2.3 From 94ada2361df1132d83fa5b14d1b6843725b29166 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 15 Jun 2010 16:14:30 -0700 Subject: Fix a bug in the upgrader where we weren't bumping the version number during the upgrade path, so the 2nd stanza (version 2 to version 3) was never getting executed. --- modules/comment/helpers/comment_installer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/comment/helpers/comment_installer.php') diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php index 7a32bf67..18d51758 100644 --- a/modules/comment/helpers/comment_installer.php +++ b/modules/comment/helpers/comment_installer.php @@ -55,12 +55,12 @@ class comment_installer { $db = Database::instance(); if ($version == 1) { $db->query("ALTER TABLE {comments} CHANGE `state` `state` varchar(15) default 'unpublished'"); - module::set_version("comment", 2); + module::set_version("comment", $version = 2); } if ($version == 2) { module::set_var("comment", "access_permissions", "everybody"); - module::set_version("comment", 3); + module::set_version("comment", $version = 3); } } -- cgit v1.2.3