<categoryname>mod.general</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
- <admindefaultvalue>1</admindefaultvalue>
+ <moddefaultvalue>1</moddefaultvalue>
</option>
<option name="user.like.canViewLike">
<categoryname>mod.profileComment</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
- <admindefaultvalue>1</admindefaultvalue>
+ <moddefaultvalue>1</moddefaultvalue>
</option>
<option name="mod.profileComment.canDeleteComment">
<categoryname>mod.profileComment</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
- <admindefaultvalue>1</admindefaultvalue>
+ <moddefaultvalue>1</moddefaultvalue>
</option>
<option name="mod.profileComment.canModerateComment">
<categoryname>mod.profileComment</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
- <admindefaultvalue>1</admindefaultvalue>
+ <moddefaultvalue>1</moddefaultvalue>
</option>
<!-- /mod.general -->
$action->executeAction();
$action = new UserProfileAction(array($editor), 'updateUserOnlineMarking');
$action->executeAction();
-
-// set default mod permissions
-$sql = "INSERT IGNORE 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.%'";
-$statement = WCF::getDB()->prepareStatement($sql);
-$statement->execute();
-$sql = "INSERT IGNORE 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.%'";
-$statement = WCF::getDB()->prepareStatement($sql);
-$statement->execute();
return count(array_diff($groupIDs, $accessibleGroupIDs)) == 0 ? true : false;
}
+ /**
+ * Returns true if the current group is a moderator-group.
+ *
+ * @reutn boolean
+ */
+ public function isModGroup() {
+ // workaround for WCF-Setup
+ if (!PACKAGE_ID && $this->groupID == 5) return true;
+
+ return $this->getGroupOption('mod.general.canUseModeration');
+ }
+
/**
* Loads the group cache.
*/
*/
protected function saveOption($option, $categoryName, $existingOptionID = 0) {
// default values
- $optionName = $optionType = $defaultValue = $adminDefaultValue = $userDefaultValue = $validationPattern = $enableOptions = $permissions = $options = '';
+ $optionName = $optionType = $defaultValue = $adminDefaultValue = $modDefaultValue = $userDefaultValue = $validationPattern = $enableOptions = $permissions = $options = '';
$showOrder = null;
// get values
if (isset($option['optiontype'])) $optionType = $option['optiontype'];
if (isset($option['defaultvalue'])) $defaultValue = $option['defaultvalue'];
if (isset($option['admindefaultvalue'])) $adminDefaultValue = $option['admindefaultvalue'];
+ if (isset($option['moddefaultvalue'])) $modDefaultValue = $option['moddefaultvalue'];
if (isset($option['userdefaultvalue'])) $userDefaultValue = $option['userdefaultvalue'];
if (isset($option['validationpattern'])) $validationPattern = $option['validationpattern'];
if (!empty($option['showorder'])) $showOrder = intval($option['showorder']);
$groupOptionEditor = UserGroupOptionEditor::create($data);
$optionID = $groupOptionEditor->optionID;
- $groupIDs = $this->getGroupIDs();
+ $this->getGroupIDs();
$values = array();
- foreach ($this->groupIDs['admin'] as $groupID) {
- $values[$groupID] = ((isset($option['admindefaultvalue']) && $defaultValue != $adminDefaultValue) ? $adminDefaultValue : $defaultValue);
+ foreach ($this->groupIDs['all'] as $groupID) {
+ $values[$groupID] = $defaultValue;
}
- foreach ($this->groupIDs['registered'] as $groupID) {
- $values[$groupID] = ((isset($option['userdefaultvalue']) && $defaultValue != $userDefaultValue) ? $userDefaultValue : $defaultValue);
+ if (isset($option['userdefaultvalue'])) {
+ foreach ($this->groupIDs['registered'] as $groupID) {
+ $values[$groupID] = $userDefaultValue;
+ }
}
- foreach ($this->groupIDs['other'] as $groupID) {
- $values[$groupID] = $defaultValue;
+ if (isset($option['moddefaultvalue'])) {
+ foreach ($this->groupIDs['mod'] as $groupID) {
+ $values[$groupID] = $modDefaultValue;
+ }
+ }
+ if (isset($option['admindefaultvalue'])) {
+ foreach ($this->groupIDs['admin'] as $groupID) {
+ $values[$groupID] = $adminDefaultValue;
+ }
}
// save values
if ($this->groupIDs === null) {
$this->groupIDs = array(
'admin' => array(),
- 'other' => array(),
+ 'mod' => array(),
+ 'all' => array(),
'registered' => array()
);
$statement->execute();
while ($row = $statement->fetchArray()) {
$group = new UserGroup(null, $row);
- if ($group->groupType == UserGroup::EVERYONE || $group->groupType == UserGroup::GUESTS) {
- $this->groupIDs['other'][] = $group->groupID;
- }
- else {
+ $this->groupIDs['all'][] = $group->groupID;
+
+ if ($group->groupType != UserGroup::EVERYONE && $group->groupType != UserGroup::GUESTS) {
+ $this->groupIDs['registered'][] = $group->groupID;
+
+ if ($group->isModGroup()) {
+ $this->groupIDs['mod'][] = $group->groupID;
+ }
if ($group->isAdminGroup()) {
$this->groupIDs['admin'][] = $group->groupID;
}
- else {
- $this->groupIDs['registered'][] = $group->groupID;
- }
}
}
}
<item name="wcf.acp.group.group3"><![CDATA[Registrierte Benutzer]]></item>
<item name="wcf.acp.group.group4"><![CDATA[Administratoren]]></item>
<item name="wcf.acp.group.group5"><![CDATA[Moderatoren]]></item>
- <item name="wcf.acp.group.group6"><![CDATA[Super-Moderatoren]]></item>
<item name="wcf.acp.group.list"><![CDATA[Benutzergruppen]]></item>
<item name="wcf.acp.group.members"><![CDATA[Mitglieder]]></item>
<item name="wcf.acp.group.option.admin.display.canManagePageMenu"><![CDATA[Kann Seitenmenü verwalten]]></item>
<category name="wcf.user.rank">
<item name="wcf.user.rank.administrator"><![CDATA[Administrator]]></item>
<item name="wcf.user.rank.moderator"><![CDATA[Moderator]]></item>
- <item name="wcf.user.rank.superModerator"><![CDATA[Super-Moderator]]></item>
<item name="wcf.user.rank.user0"><![CDATA[Anfänger]]></item>
<item name="wcf.user.rank.user1"><![CDATA[Schüler]]></item>
<item name="wcf.user.rank.user2"><![CDATA[Fortgeschrittener]]></item>
<item name="wcf.acp.group.group3"><![CDATA[Users]]></item>
<item name="wcf.acp.group.group4"><![CDATA[Administrators]]></item>
<item name="wcf.acp.group.group5"><![CDATA[Moderators]]></item>
- <item name="wcf.acp.group.group6"><![CDATA[Super Moderators]]></item>
<item name="wcf.acp.group.list"><![CDATA[User Groups]]></item>
<item name="wcf.acp.group.members"><![CDATA[Members]]></item>
<item name="wcf.acp.group.option.admin.display.canManagePageMenu"><![CDATA[Can manage page menu]]></item>
<category name="wcf.user.rank">
<item name="wcf.user.rank.administrator"><![CDATA[Administrator]]></item>
<item name="wcf.user.rank.moderator"><![CDATA[Moderator]]></item>
- <item name="wcf.user.rank.superModerator"><![CDATA[Super-Moderator]]></item>
<item name="wcf.user.rank.user0"><![CDATA[Beginner]]></item>
<item name="wcf.user.rank.user1"><![CDATA[Student]]></item>
INSERT INTO wcf1_user_group (groupID, groupName, groupType) VALUES (3, 'wcf.acp.group.group3', 3); -- Registered Users
INSERT INTO wcf1_user_group (groupID, groupName, groupType) VALUES (4, 'wcf.acp.group.group4', 4); -- Administrators
INSERT INTO wcf1_user_group (groupID, groupName, groupType) VALUES (5, 'wcf.acp.group.group5', 4); -- Moderators
-INSERT INTO wcf1_user_group (groupID, groupName, groupType) VALUES (6, 'wcf.acp.group.group6', 4); -- Super-Moderators
-- default user group options
INSERT INTO wcf1_user_group_option (optionID, optionName, categoryName, optionType, defaultValue, showOrder) VALUES (1, 'admin.general.canUseAcp', 'admin.general', 'boolean', '0', 1);
-- default priorities
UPDATE wcf1_user_group SET priority = 10 WHERE groupID = 3;
UPDATE wcf1_user_group SET priority = 1000 WHERE groupID = 4;
-UPDATE wcf1_user_group SET priority = 50 WHERE groupID = 5;
-UPDATE wcf1_user_group SET priority = 100 WHERE groupID = 6;
+UPDATE wcf1_user_group SET priority = 100 WHERE groupID = 5;
-- default 'showOnTeamPage' setting
-UPDATE wcf1_user_group SET showOnTeamPage = 1 WHERE groupID IN (4, 5, 6);
+UPDATE wcf1_user_group SET showOnTeamPage = 1 WHERE groupID IN (4, 5);
-- default ranks
INSERT INTO wcf1_user_rank (groupID, requiredPoints, rankTitle, cssClassName) VALUES
(4, 0, 'wcf.user.rank.administrator', 'blue'),
(5, 0, 'wcf.user.rank.moderator', 'blue'),
- (6, 0, 'wcf.user.rank.superModerator', 'blue'),
(3, 0, 'wcf.user.rank.user0', ''),
(3, 300, 'wcf.user.rank.user1', ''),
(3, 900, 'wcf.user.rank.user2', ''),