From: Marcel Werk Date: Mon, 29 Apr 2013 23:01:58 +0000 (+0200) Subject: Added user ban function X-Git-Tag: 2.0.0_Beta_1~275 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=baa1ddc329edb16204efd6957d44fdf50c7af8b5;p=GitHub%2FWoltLab%2FWCF.git Added user ban function --- diff --git a/wcfsetup/install/files/acp/templates/userAdd.tpl b/wcfsetup/install/files/acp/templates/userAdd.tpl index f46e85ca7a..638bc0b99b 100644 --- a/wcfsetup/install/files/acp/templates/userAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userAdd.tpl @@ -44,6 +44,8 @@ {foreach from=$optionTree item=categoryLevel1}
  • {lang}wcf.user.option.category.{@$categoryLevel1[object]->categoryName}{/lang}
  • {/foreach} + + {event name='tabMenuTabs'} @@ -152,6 +154,45 @@ {event name='passwordFields'} {/if} + + {if $action == 'edit'} +
    + {lang}wcf.acp.user.banUser{/lang} + +
    +
    + + {lang}wcf.acp.user.banUser.description{/lang} +
    +
    + +
    +
    +
    + + {lang}wcf.acp.user.banReason.description{/lang} +
    +
    + + {event name='banFields'} +
    + + + {/if} + + {event name='fieldsets'} {foreach from=$optionTree item=categoryLevel1} @@ -202,6 +243,8 @@ {/foreach} {/foreach} + + {event name='tabMenuContent'}
    diff --git a/wcfsetup/install/files/acp/templates/userList.tpl b/wcfsetup/install/files/acp/templates/userList.tpl index a14561cdf9..d31ebbe600 100644 --- a/wcfsetup/install/files/acp/templates/userList.tpl +++ b/wcfsetup/install/files/acp/templates/userList.tpl @@ -46,16 +46,12 @@
    -
    - - - {hascontent} +{if $users|count} +
    +
    +

    {lang}wcf.acp.user.list{/lang} {#$items}

    +
    + @@ -64,7 +60,7 @@ {foreach from=$columnHeads key=column item=columnLanguageVariable} - + {/foreach} {event name='columnHeads'} @@ -72,39 +68,37 @@ - {content} - {foreach from=$users item=user} - - - - - - - {foreach from=$columnHeads key=column item=columnLanguageVariable} - - {/foreach} + {foreach from=$users item=user} + + + - {/foreach} - {/content} + {event name='rowButtons'} + + + + + {foreach from=$columnHeads key=column item=columnLanguageVariable} + + {/foreach} + + {event name='columns'} + + {/foreach}
    {lang}wcf.user.username{/lang}{lang}{$columnLanguageVariable}{/lang}{if $sortField == $column} {/if}{lang}{$columnLanguageVariable}{/lang}
    - {if $user->editable} - - {else} - - {/if} - {if $user->deletable} - - {else} - - {/if} - - {event name='rowButtons'} - {@$user->userID}{if $user->editable}{$user->username}{else}{$user->username}{/if}{if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if}
    + {if $user->editable} + + {else} + + {/if} + {if $user->deletable} + + {else} + + {/if} - {event name='columns'} -
    {@$user->userID}{if $user->editable}{$user->username}{else}{$user->username}{/if}{if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if}
    - +
    {@$pagesLinks} @@ -121,10 +115,8 @@
    -{hascontentelse} -
    - -

    {lang}wcf.acp.user.search.error.noMatches{/lang}

    -{/hascontent} +{else} +

    {lang}wcf.acp.user.search.error.noMatches{/lang}

    +{/if} {include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/userSearch.tpl b/wcfsetup/install/files/acp/templates/userSearch.tpl index 65a5e5fd0f..be594950e9 100644 --- a/wcfsetup/install/files/acp/templates/userSearch.tpl +++ b/wcfsetup/install/files/acp/templates/userSearch.tpl @@ -31,152 +31,151 @@
    -
    -
    - {lang}wcf.acp.user.search.conditions.general{/lang} - -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    - - {if $__wcf->session->getPermission('admin.user.canEditMailAddress')} -
    -
    -
    - -
    -
    - {/if} - - {if $availableGroups|count} +
    + + +
    + + {event name='resultOptionFieldsets'}
    diff --git a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php index d2e7c39ff2..f43fe12198 100755 --- a/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserEditForm.class.php @@ -43,6 +43,18 @@ class UserEditForm extends UserAddForm { */ public $user = null; + /** + * ban status + * @var boolean + */ + public $banned = 0; + + /** + * ban reason + * @var string + */ + public $banReason = ''; + /** * @see wcf\page\IPage::readParameters() */ @@ -76,6 +88,9 @@ class UserEditForm extends UserAddForm { if (!WCF::getSession()->getPermission('admin.user.canEditPassword')) $this->password = $this->confirmPassword = ''; if (!WCF::getSession()->getPermission('admin.user.canEditMailAddress')) $this->email = $this->confirmEmail = $this->user->email; + + if (!empty($_POST['banned'])) $this->banned = 1; + if (isset($_POST['banReason'])) $this->banReason = StringUtil::trim($_POST['banReason']); } /** @@ -108,6 +123,8 @@ class UserEditForm extends UserAddForm { $this->email = $this->confirmEmail = $this->user->email; $this->groupIDs = $this->user->getGroupIDs(true); $this->languageID = $this->user->languageID; + $this->banned = $this->user->banned; + $this->banReason = $this->user->banReason; } /** @@ -121,7 +138,9 @@ class UserEditForm extends UserAddForm { 'action' => 'edit', 'url' => '', 'markedUsers' => 0, - 'user' => $this->user + 'user' => $this->user, + 'banned' => $this->banned, + 'banReason' => $this->banReason )); } @@ -149,6 +168,8 @@ class UserEditForm extends UserAddForm { 'username' => $this->username, 'email' => $this->email, 'password' => $this->password, + 'banned' => $this->banned, + 'banReason' => $this->banReason )), 'groups' => $this->groupIDs, 'languages' => $this->visibleLanguages, diff --git a/wcfsetup/install/files/style/layout.less b/wcfsetup/install/files/style/layout.less index ad3cae31bd..50c7db05e1 100644 --- a/wcfsetup/install/files/style/layout.less +++ b/wcfsetup/install/files/style/layout.less @@ -1438,7 +1438,7 @@ padding: @wcfGapSmall; > input[type="checkbox"] { - margin: 0 3px; + margin: -1px 3px 0; } } } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index d69fbc9214..2d69db590c 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -671,6 +671,10 @@ + + + + username}“ wirklich löschen?]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index d261a9ce41..58c834ae54 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -671,6 +671,10 @@ + + + + username}”?]]>