Added missing permission
authorMarcel Werk <burntime@woltlab.com>
Wed, 1 May 2013 21:44:50 +0000 (23:44 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 1 May 2013 21:44:50 +0000 (23:44 +0200)
com.woltlab.wcf/userGroupOption.xml
wcfsetup/install/files/acp/templates/userAdd.tpl
wcfsetup/install/files/lib/acp/form/UserEditForm.class.php

index 2486d60c757bbfaf37a8b2298f292c0eaadc2d1c..e9e8c7355c75249b4246f9630ea6ffff3263b305 100644 (file)
                                <defaultvalue>0</defaultvalue>
                                <admindefaultvalue>1</admindefaultvalue>
                        </option>
+                       <option name="admin.user.canBanUser">
+                               <categoryname>admin.user.user</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <defaultvalue>0</defaultvalue>
+                               <admindefaultvalue>1</admindefaultvalue>
+                       </option>
                        <option name="admin.user.canMailUser">
                                <categoryname>admin.user.user</categoryname>
                                <optiontype>boolean</optiontype>
index 5987cc6f84579170cde6bfbbeb1128c6202270cc..2746aab6a1a013e5b9ab66f8781cbf71e67c4320 100644 (file)
                                </fieldset>
                        {/if}
                        
-                       {if $action == 'edit'}
+                       {if $action == 'edit' && $__wcf->session->getPermission('admin.user.canBanUser')}
                                <fieldset>
                                        <legend>{lang}wcf.acp.user.banUser{/lang}</legend>
                                        
index f43fe121988c3ad67859a207f5c11e747ba42240..c52f724ae6ec36602514305840268bab8ca4c797 100755 (executable)
@@ -163,6 +163,10 @@ class UserEditForm extends UserAddForm {
                // save user
                $saveOptions = $this->optionHandler->save();
                $this->additionalFields['languageID'] = $this->languageID;
+               if (WCF::getSession()->getPermission('admin.user.canBanUser')) {
+                       $this->additionalFields['banned'] = $this->banned;
+                       $this->additionalFields['banReason'] = $this->banReason;
+               }
                $data = array(
                        'data' => array_merge($this->additionalFields, array(
                                'username' => $this->username,