New permission to disallow profile editing
authorAlexander Ebert <ebert@woltlab.com>
Thu, 10 Jan 2019 14:43:36 +0000 (15:43 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 10 Jan 2019 14:43:36 +0000 (15:43 +0100)
See #2775

com.woltlab.wcf/userGroupOption.xml
wcfsetup/install/files/lib/data/user/UserProfile.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index b87349c6f468f43d700bebf751a53b22d8257ca8..182536ce474fd837feb83a09fd23ca5fb1141ac4 100644 (file)
@@ -739,6 +739,12 @@ pdf</defaultvalue>
                                <suffix>chars</suffix>
                                <admindefaultvalue>10000</admindefaultvalue>
                        </option>
+                       <option name="user.profile.canEditUserProfile">
+                               <categoryname>user.profile</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <defaultvalue>1</defaultvalue>
+                               <usersonly>1</usersonly>
+                       </option>
                        <option name="user.profile.avatar.canSeeAvatars">
                                <categoryname>user.profile.avatar</categoryname>
                                <optiontype>boolean</optiontype>
index 1b02f0c9aa06ce2cd4f613c6a50f478e6e258872..92946e4cbd2cf1933a9a6f6f6eae9cc505d2dc5d 100644 (file)
@@ -881,7 +881,11 @@ class UserProfile extends DatabaseObjectDecorator implements ITitledLinkObject {
         * @return      boolean
         */
        public function canEditOwnProfile() {
-               return ($this->activationCode ? false : true);
+               if ($this->activationCode || !$this->getPermission('user.profile.canEditUserProfile')) {
+                       return false;
+               }
+               
+               return true;
        }
        
        /**
index 89752a3d2b93cc2c517e4d86bcf46ec76a2584ad..797054b0613ff2ed2badb0a2006d65bcf3dbf076 100644 (file)
                <item name="wcf.acp.group.option.user.contactForm.attachment.allowedExtensions"><![CDATA[Erlaubte Dateiendungen]]></item>
                <item name="wcf.acp.group.option.user.contactForm.attachment.allowedExtensions.description"><![CDATA[Eine Dateiendung pro Zeile]]></item>
                <item name="wcf.acp.group.option.user.contactForm.attachment.maxCount"><![CDATA[Maximale Dateianhänge pro Nachricht]]></item>
+               <item name="wcf.acp.group.option.user.profile.canEditUserProfile"><![CDATA[Kann eigenes Profil bearbeiten]]></item>
        </category>
        <category name="wcf.acp.index">
                <item name="wcf.acp.index.credits"><![CDATA[Über WoltLab Suite&trade;]]></item>
index ba350e9cbca2ce86481d6bc0c68b7a950ebc1e28..2c33d1198c6502f1391469f24631939dd93b3844 100644 (file)
                <item name="wcf.acp.group.option.user.contactForm.attachment.allowedExtensions"><![CDATA[Allowed Attachment File Extensions]]></item>
                <item name="wcf.acp.group.option.user.contactForm.attachment.allowedExtensions.description"><![CDATA[Enter one extension per line.]]></item>
                <item name="wcf.acp.group.option.user.contactForm.attachment.maxCount"><![CDATA[Maximum Attachments per Message]]></item>
+               <item name="wcf.acp.group.option.user.profile.canEditUserProfile"><![CDATA[Can edit their profile]]></item>
        </category>
        <category name="wcf.acp.index">
                <item name="wcf.acp.index.credits"><![CDATA[About WoltLab Suite&trade;]]></item>