Use moddefaultvalue to set moderation permissions
authorMarcel Werk <burntime@woltlab.com>
Tue, 5 Apr 2022 15:58:30 +0000 (17:58 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 5 Apr 2022 15:58:30 +0000 (17:58 +0200)
Closes #172

files/acp/install_com.woltlab.wcf.conversation.php [deleted file]
package.xml
userGroupOption.xml

diff --git a/files/acp/install_com.woltlab.wcf.conversation.php b/files/acp/install_com.woltlab.wcf.conversation.php
deleted file mode 100644 (file)
index 05cfae8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/**
- * @author  Matthias Schmidt
- * @copyright   2001-2019 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- */
-
-use wcf\data\user\group\UserGroup;
-use wcf\system\WCF;
-
-// set default mod permissions
-$group = new UserGroup(5);
-if ($group->groupID) {
-    $sql = "REPLACE INTO    wcf" . WCF_N . "_user_group_option_value
-                            (groupID, optionID, optionValue)
-            SELECT          5, optionID, 1
-            FROM            wcf" . WCF_N . "_user_group_option
-            WHERE       optionName LIKE 'mod.conversation.%'";
-    $statement = WCF::getDB()->prepareStatement($sql);
-    $statement->execute();
-}
-
-$group = new UserGroup(6);
-if ($group->groupID) {
-    $sql = "REPLACE INTO    wcf" . WCF_N . "_user_group_option_value
-                            (groupID, optionID, optionValue)
-            SELECT          6, optionID, 1
-            FROM            wcf" . WCF_N . "_user_group_option
-            WHERE           optionName LIKE 'mod.conversation.%'";
-    $statement = WCF::getDB()->prepareStatement($sql);
-    $statement->execute();
-}
index 1301f733def515a7772897f6d05bc92cf7a3472e..dc80b7a6c97015e63fff64d57f7287b9763f6c5a 100644 (file)
@@ -37,7 +37,6 @@
                <instruction type="userNotificationEvent" />
                <instruction type="userOption" />
                <instruction type="eventListener" />
-               <instruction type="script">acp/install_com.woltlab.wcf.conversation.php</instruction>
                <instruction type="page" />
        </instructions>
        
index d28aa9d0d09b3265173f411f9653f4683fb3ed99..7b75369a02a4b5594d2ca7c70ecdc976d7b5355e 100644 (file)
@@ -18,6 +18,7 @@
                                <optiontype>boolean</optiontype>
                                <defaultvalue>0</defaultvalue>
                                <options>module_conversation</options>
+                               <moddefaultvalue>1</moddefaultvalue>
                                <admindefaultvalue>1</admindefaultvalue>
                                <usersonly>1</usersonly>
                        </option>
@@ -26,6 +27,7 @@
                                <optiontype>boolean</optiontype>
                                <defaultvalue>0</defaultvalue>
                                <options>module_conversation</options>
+                               <moddefaultvalue>1</moddefaultvalue>
                                <admindefaultvalue>1</admindefaultvalue>
                                <usersonly>1</usersonly>
                        </option>