Add canViewTrophy user option
authorJoshua Rüsweg <josh@bastelstu.be>
Wed, 19 Jul 2017 19:54:31 +0000 (21:54 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Wed, 19 Jul 2017 19:54:52 +0000 (21:54 +0200)
See #2315

com.woltlab.wcf/userOption.xml
wcfsetup/install/files/lib/data/user/trophy/UserTrophy.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 547a264ca5667d37e39535881f4142d9527b2a96..3c1d26973ee69f9be68f225d471335a3c8f26ce8 100644 (file)
 3:wcf.user.access.nobody</selectoptions>
                                <defaultvalue>0</defaultvalue>
                        </option>
+                       <option name="canViewTrophies">
+                               <categoryname>settings.privacy.content</categoryname>
+                               <optiontype>select</optiontype>
+                               <editable>3</editable>
+                               <selectoptions>0:wcf.user.access.everyone
+1:wcf.user.access.registered
+2:wcf.user.access.following
+3:wcf.user.access.nobody</selectoptions>
+                               <options>module_trophy</options>
+                               <permissions>user.profile.trophy.canSeeTrophies</permissions>
+                               <defaultvalue>0</defaultvalue>
+                       </option>
                        
                        <!-- settings.privacy.messaging -->
                        <option name="canViewEmailAddress">
index 1bb469996f8d08c2c48eed13182fd00792b2e956..7fc18f1e7ca211a00fddf039e66e227ec3c42fa3 100644 (file)
@@ -96,8 +96,7 @@ class UserTrophy extends DatabaseObject {
                        return false;
                }
                
-               // @TODO check user option canViewTrophies
-               return true;
+               return $this->getUserProfile()->isAccessible('canViewTrophies') || $user->userID == $this->userID;
        }
        
        /**
index b1aa694dab63233aec755faeb910e7e2126e16ae..aa23d4a6b839e694ea301d6c1899028416ee7a85 100644 (file)
@@ -3943,6 +3943,7 @@ Benachrichtigungen auf <a href="{link isEmail=true}{/link}">{PAGE_TITLE|language
                <item name="wcf.user.option.canViewEmailAddress"><![CDATA[Kann E-Mail-Adresse sehen]]></item>
                <item name="wcf.user.option.canViewOnlineStatus"><![CDATA[Kann Online-Status sehen]]></item>
                <item name="wcf.user.option.canViewProfile"><![CDATA[Kann Benutzerprofil sehen]]></item>
+               <item name="wcf.user.option.canViewTrophies"><![CDATA[Kann Trophäen sehen]]></item>
                
                <item name="wcf.user.option.category.profile"><![CDATA[Persönliche Daten]]></item>
                <item name="wcf.user.option.category.profile.aboutMe"><![CDATA[Über mich]]></item>
index 83fde96f641a821740166851e2e5a6977fef5cec..09a1bcb1bbbb64634d2595608086064b9ffed96f 100644 (file)
@@ -3936,6 +3936,7 @@ your notifications on <a href="{link isEmail=true}{/link}">{PAGE_TITLE|language}
                <item name="wcf.user.option.canViewEmailAddress"><![CDATA[Can View My Email Address]]></item>
                <item name="wcf.user.option.canViewOnlineStatus"><![CDATA[Can View My Online Status]]></item>
                <item name="wcf.user.option.canViewProfile"><![CDATA[Can View My Profile]]></item>
+               <item name="wcf.user.option.canViewTrophies"><![CDATA[Can View Trophies]]></item>
                
                <item name="wcf.user.option.category.profile"><![CDATA[Personal Data]]></item>
                <item name="wcf.user.option.category.profile.aboutMe"><![CDATA[About Me]]></item>