Restrict statistics visibility
authorAlexander Ebert <ebert@woltlab.com>
Wed, 14 Jun 2017 10:49:09 +0000 (12:49 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 14 Jun 2017 10:49:09 +0000 (12:49 +0200)
See #2307

com.woltlab.wcf/userGroupOption.xml
wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index fbf02121bc2b280d80ecd407ed18b4249821cf00..0a9a65af59737b3317dc4652ca573445e5d45ef1 100644 (file)
@@ -648,6 +648,11 @@ pdf</defaultvalue>
                                <optiontype>boolean</optiontype>
                                <defaultvalue>1</defaultvalue>
                        </option>
+                       <option name="user.profile.canViewStatistics">
+                               <categoryname>user.profile</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <defaultvalue>1</defaultvalue>
+                       </option>
                        <option name="user.profile.cannotBeIgnored">
                                <categoryname>user.profile</categoryname>
                                <optiontype>boolean</optiontype>
index 15f01782ba1427324574b8b13ef505c1f8c0d857..d747c83bd9f496d40f363010c8452f3e2e8d9d33 100644 (file)
@@ -22,6 +22,8 @@ class StatisticsBoxController extends AbstractBoxController {
         * @inheritDoc
         */
        protected function loadContent() {
-               $this->content = WCF::getTPL()->fetch('boxStatistics', 'wcf', ['statistics' => UserStatsCacheBuilder::getInstance()->getData()], true);
+               if (WCF::getSession()->getPermission('user.profile.canViewStatistics')) {
+                       $this->content = WCF::getTPL()->fetch('boxStatistics', 'wcf', ['statistics' => UserStatsCacheBuilder::getInstance()->getData()], true);
+               }
        }
 }
index 2faef11712fc626c70882422f75b1b3d0f2a2c99..946bafd495a4c79d6b3261f9f95b7a0689da5cc9 100644 (file)
                <item name="wcf.acp.group.option.user.profile.canViewMembersList"><![CDATA[Kann Mitglieder-Liste sehen]]></item>
                <item name="wcf.acp.group.option.user.profile.canViewUserProfile"><![CDATA[Kann Benutzerprofile sehen]]></item>
                <item name="wcf.acp.group.option.user.profile.canViewUsersOnlineList"><![CDATA[Kann Benutzer-Online-Listen sehen]]></item>
+               <item name="wcf.acp.group.option.user.profile.canViewStatistics"><![CDATA[Kann Statistiken sehen]]></item>
                <item name="wcf.acp.group.option.user.signature.disallowedBBCodes"><![CDATA[Nicht erlaubte BBCodes]]></item>
                <item name="wcf.acp.group.option.user.signature.disallowedBBCodes.description"><![CDATA[Die hier ausgewählten BBCodes dürfen von Mitgliedern dieser Benutzergruppe in ihrer Signatur <em>nicht</em> verwendet werden.]]></item>
                <item name="wcf.acp.group.priority"><![CDATA[Priorisierung]]></item>
index 912e983026654eee47a8bd7f003e33e5b680fd83..2ed2c02de66c541f1e7293450d7c99257587be8f 100644 (file)
                <item name="wcf.acp.group.option.user.profile.canViewMembersList"><![CDATA[Can view members list]]></item>
                <item name="wcf.acp.group.option.user.profile.canViewUserProfile"><![CDATA[Can view users’ profiles]]></item>
                <item name="wcf.acp.group.option.user.profile.canViewUsersOnlineList"><![CDATA[Can view users online list]]></item>
+               <item name="wcf.acp.group.option.user.profile.canViewStatistics"><![CDATA[Can view statistics]]></item>
                <item name="wcf.acp.group.option.user.signature.disallowedBBCodes"><![CDATA[Disallowed BBCodes]]></item>
                <item name="wcf.acp.group.option.user.signature.disallowedBBCodes.description"><![CDATA[Selected BBCodes <em>cannot</em> be used in the signature.]]></item>
                <item name="wcf.acp.group.priority"><![CDATA[Priority]]></item>