Also adds separate permissions for disabling avatar and signature.
'wcf.global.page.next': '{capture assign=pageNext}{lang}wcf.global.page.next{/lang}{/capture}{@$pageNext|encodeJS}',
'wcf.global.page.previous': '{capture assign=pagePrevious}{lang}wcf.global.page.previous{/lang}{/capture}{@$pagePrevious|encodeJS}',
'wcf.global.pageDirection': '{lang}wcf.global.pageDirection{/lang}',
+ 'wcf.global.reason': '{lang}wcf.global.reason{/lang}',
'wcf.global.sidebar.hideLeftSidebar': '{lang}wcf.global.sidebar.hideLeftSidebar{/lang}',
'wcf.global.sidebar.hideRightSidebar': '{lang}wcf.global.sidebar.hideRightSidebar{/lang}',
'wcf.global.sidebar.showLeftSidebar': '{lang}wcf.global.sidebar.showLeftSidebar{/lang}',
});
{/if}
+ {if $isAccessible}
+ WCF.Language.addObject({
+ 'wcf.user.ban': '{lang}wcf.user.ban{/lang}',
+ 'wcf.user.ban.confirmMessage': '{lang}wcf.user.ban.confirmMessage{/lang}',
+ 'wcf.user.ban.reason.description': '{lang}wcf.user.ban.reason.description{/lang}',
+ 'wcf.user.unban': '{lang}wcf.user.unban{/lang}',
+ 'wcf.user.disableAvatar': '{lang}wcf.user.disableAvatar{/lang}',
+ 'wcf.user.disableAvatar.confirmMessage': '{lang}wcf.user.disableAvatar.confirmMessage{/lang}',
+ 'wcf.user.disableSignature': '{lang}wcf.user.disableSignature{/lang}',
+ 'wcf.user.disableSignature.confirmMessage': '{lang}wcf.user.disableSignature.confirmMessage{/lang}',
+ 'wcf.user.edit': '{lang}wcf.user.edit{/lang}',
+ 'wcf.user.enableAvatar': '{lang}wcf.user.enableAvatar{/lang}',
+ 'wcf.user.enableSignature': '{lang}wcf.user.enableSignature{/lang}'
+ });
+
+ var $userInlineEditor = new WCF.User.InlineEditor('.userHeadline');
+ $userInlineEditor.setPermissions({
+ canBanUser: {if $__wcf->session->getPermission('admin.user.canBanUser')}true{else}false{/if},
+ canDisableAvatar: {if $__wcf->session->getPermission('admin.user.canDisableAvatar')}true{else}false{/if},
+ canDisableSignature: {if $__wcf->session->getPermission('admin.user.canDisableSignature')}true{else}false{/if},
+ canEditUser: {if $__wcf->session->getPermission('admin.general.canUseAcp') && $__wcf->session->getPermission('admin.user.canEditUser')}true{else}false{/if}
+ });
+ {/if}
+
{event name='javascriptInit'}
});
//]]>
{include file='header' sidebarOrientation='left'}
-<header class="boxHeadline userHeadline">
+<header class="boxHeadline userHeadline"
+ {if $isAccessible}
+ data-object-id="{@$user->userID}"
+ {if $__wcf->session->getPermission('admin.user.canBanUser')}
+ data-banned="{@$user->banned}"
+ {/if}
+ {if $__wcf->session->getPermission('admin.user.canDisableAvatar')}
+ data-disable-avatar="{@$user->disableAvatar}"
+ {/if}
+ {if $__wcf->session->getPermission('admin.user.canDisableSignature')}
+ data-disable-signature="{@$user->disableSignature}"
+ {/if}
+ {/if}
+>
<span class="framed invisible">{@$user->getAvatar()->getImageTag(48)}</span>
<h1>{$user->username}{if MODULE_USER_RANK && $user->getUserTitle()} <span class="badge userTitleBadge{if $user->getRank() && $user->getRank()->cssClassName} {@$user->getRank()->cssClassName}{/if}">{$user->getUserTitle()}</span>{/if}</h1>
</ul>
</li>
{/hascontent}
- {if $user->userID != $__wcf->user->userID}{if $user->isAccessible('canViewEmailAddress')}<li><a class="button jsTooltip" href="mailto:{@$user->getEncodedEmail()}" title="{lang}wcf.user.button.mail{/lang}"><span class="icon icon16 icon-envelope-alt"></span> <span class="invisible">{lang}wcf.user.button.mail{/lang}</span></a></li>{elseif $user->isAccessible('canMail') && $__wcf->session->getPermission('user.profile.canMail')}<li><a class="button jsTooltip" href="{link controller='Mail' object=$user}{/link}" title="{lang}wcf.user.button.mail{/lang}"><span class="icon icon16 icon-envelope-alt"></span> <span class="invisible">{lang}wcf.user.button.mail{/lang}</span></a></li>{/if}{/if}
+
+ {if $user->userID != $__wcf->user->userID && $user->isAccessible('canViewEmailAddress')}
+ <li><a class="button jsTooltip" href="mailto:{@$user->getEncodedEmail()}" title="{lang}wcf.user.button.mail{/lang}"><span class="icon icon16 icon-envelope-alt"></span> <span class="invisible">{lang}wcf.user.button.mail{/lang}</span></a></li>{elseif $user->isAccessible('canMail') && $__wcf->session->getPermission('user.profile.canMail')}<li><a class="button jsTooltip" href="{link controller='Mail' object=$user}{/link}" title="{lang}wcf.user.button.mail{/lang}"><span class="icon icon16 icon-envelope-alt"></span> <span class="invisible">{lang}wcf.user.button.mail{/lang}</span></a></li>
+ {/if}
+
{event name='buttons'}
+
+ {if $__wcf->session->getPermission('admin.user.canBanUser') || $__wcf->session->getPermission('admin.user.canDisableAvatar') || $__wcf->session->getPermission('admin.user.canDisableSignature') || ($__wcf->session->getPermission('admin.general.canUseAcp') && $__wcf->session->getPermission('admin.user.canEditUser'))}
+ <li class="dropdown">
+ {* todo: better icon? *}
+ <a href="{link controller='UserEdit' object=$user isACP=true}{/link}" class="button jsTooltip jsUserInlineEditor" title="{lang}wcf.user.moderate{/lang}"><span class="icon icon16 icon-lock"></span> <span class="invisible">{lang}{lang}wcf.acp.user.edit{/lang}{/lang}</span></a>
+ <ul class="dropdownMenu"></ul>
+ </li>
+ {/if}
</ul>
</nav>
</header>
<defaultvalue>0</defaultvalue>
<admindefaultvalue>1</admindefaultvalue>
</option>
+ <option name="admin.user.canDisableAvatar">
+ <categoryname>admin.user.user</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>0</defaultvalue>
+ <admindefaultvalue>1</admindefaultvalue>
+ </option>
+ <option name="admin.user.canDisableSignature">
+ <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>
<defaultvalue>0</defaultvalue>
<admindefaultvalue>1</admindefaultvalue>
</option>
+
<option name="admin.user.canAddGroup">
<categoryname>admin.user.group</categoryname>
<optiontype>boolean</optiontype>
<defaultvalue>0</defaultvalue>
<admindefaultvalue>1</admindefaultvalue>
</option>
+
<option name="admin.user.canManageUserOption">
<categoryname>admin.user.option</categoryname>
<optiontype>boolean</optiontype>
'wcf.global.page.next': '{capture assign=pageNext}{lang}wcf.global.page.next{/lang}{/capture}{@$pageNext|encodeJS}',
'wcf.global.page.previous': '{capture assign=pagePrevious}{lang}wcf.global.page.previous{/lang}{/capture}{@$pagePrevious|encodeJS}',
'wcf.global.pageDirection': '{lang}wcf.global.pageDirection{/lang}',
+ 'wcf.global.reason': '{lang}wcf.global.reason{/lang}',
'wcf.global.success': '{lang}wcf.global.success{/lang}',
'wcf.global.success.add': '{lang}wcf.global.success.add{/lang}',
'wcf.global.success.edit': '{lang}wcf.global.success.edit{/lang}',
</dl>
</fieldset>
- <fieldset>
- <legend>{lang}wcf.acp.user.disableSignature{/lang}</legend>
-
- <dl>
- <dt></dt>
- <dd>
- <label><input type="checkbox" id="disableSignature" name="disableSignature" value="1" {if $disableSignature == 1}checked="checked" {/if}/> {lang}wcf.acp.user.disableSignature{/lang}</label>
- </dd>
- </dl>
+ {if $__wcf->session->getPermission('admin.user.canDisableSignature')}
+ <fieldset>
+ <legend>{lang}wcf.acp.user.disableSignature{/lang}</legend>
+
+ <dl>
+ <dt></dt>
+ <dd>
+ <label><input type="checkbox" id="disableSignature" name="disableSignature" value="1" {if $disableSignature == 1}checked="checked" {/if}/> {lang}wcf.acp.user.disableSignature{/lang}</label>
+ </dd>
+ </dl>
+
+ <dl>
+ <dt><label for="disableSignatureReason">{lang}wcf.acp.user.disableSignatureReason{/lang}</label></dt>
+ <dd>
+ <textarea name="disableSignatureReason" id="disableSignatureReason" cols="40" rows="10">{$disableSignatureReason}</textarea>
+ </dd>
+ </dl>
+ </fieldset>
- <dl>
- <dt><label for="disableSignatureReason">{lang}wcf.acp.user.disableSignatureReason{/lang}</label></dt>
- <dd>
- <textarea name="disableSignatureReason" id="disableSignatureReason" cols="40" rows="10">{$disableSignatureReason}</textarea>
- </dd>
- </dl>
- </fieldset>
-
- <script data-relocate="true">
- //<![CDATA[
- $('#disableSignature').change(function (event) {
- if ($('#disableSignature').is(':checked')) {
- $('#disableSignatureReason').attr('readonly', false);
- }
- else {
- $('#disableSignatureReason').attr('readonly', true);
- }
- });
- $('#disableSignature').change();
- //]]>
- </script>
+ <script data-relocate="true">
+ //<![CDATA[
+ $('#disableSignature').change(function (event) {
+ if ($('#disableSignature').is(':checked')) {
+ $('#disableSignatureReason').attr('readonly', false);
+ }
+ else {
+ $('#disableSignatureReason').attr('readonly', true);
+ }
+ });
+ $('#disableSignature').change();
+ //]]>
+ </script>
+ {/if}
</div>
{/if}
{/if}
</fieldset>
- <fieldset>
- <legend>{lang}wcf.acp.user.disableAvatar{/lang}</legend>
-
- <dl>
- <dt></dt>
- <dd>
- <label><input type="checkbox" id="disableAvatar" name="disableAvatar" value="1" {if $disableAvatar == 1}checked="checked" {/if}/> {lang}wcf.acp.user.disableAvatar{/lang}</label>
- </dd>
- </dl>
+ {if $__wcf->session->getPermission('admin.user.canDisableAvatar')}
+ <fieldset>
+ <legend>{lang}wcf.acp.user.disableAvatar{/lang}</legend>
+
+ <dl>
+ <dt></dt>
+ <dd>
+ <label><input type="checkbox" id="disableAvatar" name="disableAvatar" value="1" {if $disableAvatar == 1}checked="checked" {/if}/> {lang}wcf.acp.user.disableAvatar{/lang}</label>
+ </dd>
+ </dl>
+
+ <dl>
+ <dt><label for="disableAvatarReason">{lang}wcf.acp.user.disableAvatarReason{/lang}</label></dt>
+ <dd>
+ <textarea name="disableAvatarReason" id="disableAvatarReason" cols="40" rows="10">{$disableAvatarReason}</textarea>
+ </dd>
+ </dl>
+ </fieldset>
- <dl>
- <dt><label for="disableAvatarReason">{lang}wcf.acp.user.disableAvatarReason{/lang}</label></dt>
- <dd>
- <textarea name="disableAvatarReason" id="disableAvatarReason" cols="40" rows="10">{$disableAvatarReason}</textarea>
- </dd>
- </dl>
- </fieldset>
-
- <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.Message{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
- <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
- <script data-relocate="true">
+ <script data-relocate="true">
//<![CDATA[
$(function() {
$('#disableAvatar').change(function (event) {
}
});
$('#disableAvatar').change();
-
+ //]]>
+ </script>
+ {/if}
+
+ <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.Message{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
+ <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
+ <script data-relocate="true">
+ //<![CDATA[
+ $(function() {
WCF.Language.addObject({
'wcf.user.avatar.upload.error.invalidExtension': '{lang}wcf.user.avatar.upload.error.invalidExtension{/lang}',
'wcf.user.avatar.upload.error.tooSmall': '{lang}wcf.user.avatar.upload.error.tooSmall{/lang}',
this._proxy.sendRequest();
}
});
+
+/**
+ * Handles inline editing of users.
+ */
+WCF.User.InlineEditor = WCF.InlineEditor.extend({
+ /**
+ * list of permissions
+ * @var object
+ */
+ _permissions: { },
+
+ /**
+ * @see WCF.InlineEditor._execute()
+ */
+ _execute: function(elementID, optionName) {
+ if (!this._validate(elementID, optionName)) {
+ return false;
+ }
+
+ var $data = { };
+ var $element = $('#' + elementID);
+ switch (optionName) {
+ case 'unban':
+ case 'enableAvatar':
+ case 'enableSignature':
+ switch (optionName) {
+ case 'unban':
+ $data.banned = 0;
+ break;
+
+ case 'enableAvatar':
+ $data.disableAvatar = 0;
+ break;
+
+ case 'enableSignature':
+ $data.disableSignature = 0;
+ break;
+ }
+
+ this._proxy.setOption('data', {
+ actionName: optionName,
+ className: 'wcf\\data\\user\\UserAction',
+ objectIDs: [ $element.data('objectID') ]
+ });
+ this._proxy.sendRequest();
+ break;
+
+ case 'ban':
+ case 'disableAvatar':
+ case 'disableSignature':
+ if (optionName == 'unban') {
+ $data.banned = 1;
+ }
+ else {
+ $data[optionName] = 1;
+ }
+
+ this._showReasonDialog($element.data('objectID'), optionName);
+ break;
+
+ case 'advanced':
+ window.location = this._getTriggerElement($element).attr('href');
+ break;
+ }
+
+ if ($.getLength($data)) {
+ this._updateData.push({
+ data: $data,
+ elementID: elementID,
+ });
+ }
+ },
+
+ /**
+ * Executes an action with a reason.
+ *
+ * @param integer userID
+ * @param string optionName
+ * @param string reason
+ */
+ _executeReasonAction: function(userID, optionName, reason) {
+ var $parameters = { };
+ $parameters[optionName + WCF.String.ucfirst('reason')] = reason;
+
+ this._proxy.setOption('data', {
+ actionName: optionName,
+ className: 'wcf\\data\\user\\UserAction',
+ objectIDs: [ userID ],
+ parameters: $parameters
+ });
+ this._proxy.sendRequest();
+ },
+
+ /**
+ * Returns a specific permission.
+ *
+ * @param string permission
+ * @return integer
+ */
+ _getPermission: function(permission) {
+ if (this._permissions[permission]) {
+ return this._permissions[permission];
+ }
+
+ return 0;
+ },
+
+ /**
+ * @see WCF.InlineEditor._getTriggerElement()
+ */
+ _getTriggerElement: function(element) {
+ return element.find('.jsUserInlineEditor');
+ },
+
+ /**
+ * @see WCF.InlineEditor._setOptions()
+ */
+ _setOptions: function() {
+ this._options = [
+ // banning
+ { label: WCF.Language.get('wcf.user.ban'), optionName: 'ban' },
+ { label: WCF.Language.get('wcf.user.unban'), optionName: 'unban' },
+
+ // disabling avatar
+ { label: WCF.Language.get('wcf.user.disableAvatar'), optionName: 'disableAvatar' },
+ { label: WCF.Language.get('wcf.user.enableAvatar'), optionName: 'enableAvatar' },
+
+ // disabling signature
+ { label: WCF.Language.get('wcf.user.disableSignature'), optionName: 'disableSignature' },
+ { label: WCF.Language.get('wcf.user.enableSignature'), optionName: 'enableSignature' },
+
+ // divider
+ { optionName: 'divider' },
+
+ // overlay
+ { label: WCF.Language.get('wcf.user.edit'), optionName: 'advanced' }
+ ];
+ },
+
+ /**
+ * @see WCF.InlineEditor._show()
+ */
+ _show: function(event) {
+ var $element = $(event.currentTarget);
+ var $elementID = $element.data('elementID');
+
+ if (!this._dropdowns[$elementID]) {
+ var $dropdownMenu = $element.next('.dropdownMenu');
+
+ if ($dropdownMenu) {
+ this._dropdowns[$elementID] = $dropdownMenu;
+ WCF.Dropdown.initDropdown(this._getTriggerElement(this._elements[$elementID]), true);
+ }
+ }
+
+ return this._super(event);
+ },
+
+ /**
+ * Shows the dialog to enter a reason for executing the option with the
+ * given name.
+ *
+ * @param string optionName
+ */
+ _showReasonDialog: function(userID, optionName) {
+ var $languageItem = 'wcf.user.' + optionName + '.reason.description';
+ var $reasonDescription = WCF.Language.get($languageItem);
+
+ WCF.System.Confirmation.show(WCF.Language.get('wcf.user.' + optionName + '.confirmMessage'), $.proxy(function(action) {
+ if (action === 'confirm') {
+ this._executeReasonAction(userID, optionName, $('#wcfSystemConfirmationContent').find('textarea').val());
+ }
+ }, this), { }, $('<fieldset><dl><dt>' + WCF.Language.get('wcf.global.reason') + '</dt><dd><textarea cols="40" rows="4" />' + ($reasonDescription != $languageID ? '<small>' + $reasonDescription + '</small>' : '') + '</dd></dl></fieldset>'));
+ },
+
+ /**
+ * @see WCF.InlineEditor._updateState()
+ */
+ _updateState: function(data) {
+ this._notification.show();
+
+ for (var $index in this._updateData) {
+ var $data = this._updateData[$index];
+ var $element = $('#' + $data.elementID);
+
+ for (var $property in $data.data) {
+ $element.data($property, $data.data[$property]);
+ }
+ }
+ },
+
+ /**
+ * @see WCF.InlineEditor._validate()
+ */
+ _validate: function(elementID, optionName) {
+ var $user = $('#' + elementID);
+
+ switch (optionName) {
+ case 'ban':
+ case 'unban':
+ if (!this._getPermission('canBanUser')) {
+ return false;
+ }
+
+ if (optionName == 'ban') {
+ return !$user.data('banned');
+ }
+ else {
+ return $user.data('banned');
+ }
+ break;
+
+ case 'disableAvatar':
+ case 'enableAvatar':
+ if (!this._getPermission('canDisableAvatar')) {
+ return false;
+ }
+
+ if (optionName == 'disableAvatar') {
+ return !$user.data('disableAvatar');
+ }
+ else {
+ return $user.data('disableAvatar');
+ }
+ break;
+
+ case 'disableSignature':
+ case 'enableSignature':
+ if (!this._getPermission('canDisableSignature')) {
+ return false;
+ }
+
+ if (optionName == 'disableSignature') {
+ return !$user.data('disableSignature');
+ }
+ else {
+ return $user.data('disableSignature');
+ }
+ break;
+
+ case 'advanced':
+ return this._getPermission('canEditUser');
+ break;
+ }
+
+ return false;
+ },
+
+ /**
+ * Sets a permission.
+ *
+ * @param string permission
+ * @param integer value
+ */
+ setPermission: function(permission, value) {
+ this._permissions[permission] = value;
+ },
+
+ /**
+ * Sets permissions.
+ *
+ * @param object permissions
+ */
+ setPermissions: function(permissions) {
+ for (var $permission in permissions) {
+ this.setPermission($permission, permissions[$permission]);
+ }
+ }
+});
if (isset($_POST['userTitle'])) $this->userTitle = $_POST['userTitle'];
if (isset($_POST['signature'])) $this->signature = StringUtil::trim($_POST['signature']);
- if (isset($_POST['disableSignatureReason'])) $this->disableSignatureReason = StringUtil::trim($_POST['disableSignatureReason']);
$this->signatureEnableBBCodes = $this->signatureEnableSmilies = 0;
if (!empty($_POST['signatureEnableBBCodes'])) $this->signatureEnableBBCodes = 1;
if (!empty($_POST['signatureEnableSmilies'])) $this->signatureEnableSmilies = 1;
if (!empty($_POST['signatureEnableHtml'])) $this->signatureEnableHtml = 1;
- if (!empty($_POST['disableSignature'])) $this->disableSignature = 1;
+
+ if (WCF::getSession()->getPermission('admin.user.canDisableSignature')) {
+ if (isset($_POST['disableSignatureReason'])) $this->disableSignatureReason = StringUtil::trim($_POST['disableSignatureReason']);
+ if (!empty($_POST['disableSignature'])) $this->disableSignature = 1;
+ }
}
/**
'signature' => $this->signature,
'signatureEnableBBCodes' => $this->signatureEnableBBCodes,
'signatureEnableSmilies' => $this->signatureEnableSmilies,
- 'signatureEnableHtml' => $this->signatureEnableHtml,
- 'disableSignature' => $this->disableSignature,
- 'disableSignatureReason' => $this->disableSignatureReason
+ 'signatureEnableHtml' => $this->signatureEnableHtml
)),
'groups' => $this->groupIDs,
'languages' => $this->visibleLanguages,
'options' => $saveOptions
);
+
+ if (WCF::getSession()->getPermission('admin.user.canDisableSignature')) {
+ $data['data']['disableSignature'] = $this->disableSignature;
+ $data['data']['disableSignatureReason'] = $this->disableSignatureReason;
+ }
+
$this->objectAction = new UserAction(array(), 'create', $data);
$this->objectAction->executeAction();
$this->saved();
if (!empty($_POST['banned'])) $this->banned = 1;
if (isset($_POST['banReason'])) $this->banReason = StringUtil::trim($_POST['banReason']);
if (isset($_POST['avatarType'])) $this->avatarType = $_POST['avatarType'];
- if (!empty($_POST['disableAvatar'])) $this->disableAvatar = 1;
- if (isset($_POST['disableAvatarReason'])) $this->disableAvatarReason = StringUtil::trim($_POST['disableAvatarReason']);
+
+ if (WCF::getSession()->getPermission('admin.user.canDisableAvatar')) {
+ if (!empty($_POST['disableAvatar'])) $this->disableAvatar = 1;
+ if (isset($_POST['disableAvatarReason'])) $this->disableAvatarReason = StringUtil::trim($_POST['disableAvatarReason']);
+ }
}
/**
$this->disableSignatureReason = $this->user->disableSignatureReason;
$this->disableAvatar = $this->user->disableAvatar;
$this->disableAvatarReason = $this->user->disableAvatarReason;
-
+
if ($this->user->avatarID) $this->avatarType = 'custom';
else if (MODULE_GRAVATAR && $this->user->enableGravatar) $this->avatarType = 'gravatar';
}
);
break;
}
- $avatarData['disableAvatar'] = $this->disableAvatar;
- $avatarData['disableAvatarReason'] = $this->disableAvatarReason;
+
+ if (WCF::getSession()->getPermission('admin.user.canDisableAvatar')) {
+ $avatarData['disableAvatar'] = $this->disableAvatar;
+ $avatarData['disableAvatarReason'] = $this->disableAvatarReason;
+ }
+
$this->additionalFields = array_merge($this->additionalFields, $avatarData);
// add default groups
'signature' => $this->signature,
'signatureEnableBBCodes' => $this->signatureEnableBBCodes,
'signatureEnableSmilies' => $this->signatureEnableSmilies,
- 'signatureEnableHtml' => $this->signatureEnableHtml,
- 'disableSignature' => $this->disableSignature,
- 'disableSignatureReason' => $this->disableSignatureReason
+ 'signatureEnableHtml' => $this->signatureEnableHtml
)),
'groups' => $this->groupIDs,
'languages' => $this->visibleLanguages,
'options' => $saveOptions
);
+
+ if (WCF::getSession()->getPermission('admin.user.canDisableSignature')) {
+ $data['data']['disableSignature'] = $this->disableSignature;
+ $data['data']['disableSignatureReason'] = $this->disableSignatureReason;
+ }
+
$this->objectAction = new UserAction(array($this->userID), 'update', $data);
$this->objectAction->executeAction();
/**
* @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
*/
- protected $requireACP = array('create', 'ban', 'delete', 'disable', 'enable', 'unban');
+ protected $requireACP = array('create', 'delete', 'disable', 'enable');
/**
* Validates permissions and parameters.
".$conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute(
- array_merge(array(1, $this->parameters['banReason']), $conditionBuilder->getParameters())
+ array_merge(array(1, $this->parameters['banReason']), $conditionBuilder->getParameters())
);
$this->unmarkItems();
if (empty($this->objectIDs)) {
return;
}
-
+
// get base class
$baseClass = call_user_func(array($this->className, 'getBaseClass'));
-
+
// get objects
$sql = "SELECT user_option_value.*, user_table.*
FROM wcf".WCF_N."_user user_table
$this->objects[] = new $this->className($object);
}
}
+
+ /**
+ * Validates the 'disableSignature' action.
+ */
+ public function validateDisableSignature() {
+ WCF::getSession()->checkPermissions(array('admin.user.canDisableSignature'));
+
+ $this->__validateAccessibleGroups();
+
+ if (empty($this->objects)) {
+ $this->readObjects();
+
+ if (empty($this->objects)) {
+ throw new UserInputException('objectIDs');
+ }
+ }
+
+ $this->readString('disableSignatureReason', true);
+ }
+
+ /**
+ * Disables the signature of the handled users.
+ */
+ public function disableSignature() {
+ if (empty($this->objects)) {
+ $this->readObjects();
+ }
+
+ foreach ($this->objects as $userEditor) {
+ $userEditor->update(array(
+ 'disableSignature' => 1,
+ 'disableSignatureReason' => $this->parameters['disableSignatureReason']
+ ));
+ }
+ }
+
+ /**
+ * Validates the 'enableSignature' action.
+ */
+ public function validateEnableSignature() {
+ WCF::getSession()->checkPermissions(array('admin.user.canDisableSignature'));
+
+ $this->__validateAccessibleGroups();
+
+ if (empty($this->objects)) {
+ $this->readObjects();
+
+ if (empty($this->objects)) {
+ throw new UserInputException('objectIDs');
+ }
+ }
+ }
+
+ /**
+ * Enables the signature of the handled users.
+ */
+ public function enableSignature() {
+ if (empty($this->objects)) {
+ $this->readObjects();
+ }
+
+ foreach ($this->objects as $userEditor) {
+ $userEditor->update(array(
+ 'disableSignature' => 0
+ ));
+ }
+ }
+
+ /**
+ * Validates the 'disableAvatar' action.
+ */
+ public function validateDisableAvatar() {
+ WCF::getSession()->checkPermissions(array('admin.user.canDisableAvatar'));
+
+ $this->__validateAccessibleGroups();
+
+ if (empty($this->objects)) {
+ $this->readObjects();
+
+ if (empty($this->objects)) {
+ throw new UserInputException('objectIDs');
+ }
+ }
+
+ $this->readString('disableAvatarReason', true);
+ }
+
+ /**
+ * Disables the avatar of the handled users.
+ */
+ public function disableAvatar() {
+ if (empty($this->objects)) {
+ $this->readObjects();
+ }
+
+ foreach ($this->objects as $userEditor) {
+ $userEditor->update(array(
+ 'disableAvatar' => 1,
+ 'disableAvatarReason' => $this->parameters['disableAvatarReason']
+ ));
+ }
+ }
+
+ /**
+ * Validates the 'enableAvatar' action.
+ */
+ public function validateEnableAvatar() {
+ WCF::getSession()->checkPermissions(array('admin.user.canDisableAvatar'));
+
+ $this->__validateAccessibleGroups();
+
+ if (empty($this->objects)) {
+ $this->readObjects();
+
+ if (empty($this->objects)) {
+ throw new UserInputException('objectIDs');
+ }
+ }
+ }
+
+ /**
+ * Enables the avatar of the handled users.
+ */
+ public function enableAvatar() {
+ if (empty($this->objects)) {
+ $this->readObjects();
+ }
+
+ foreach ($this->objects as $userEditor) {
+ $userEditor->update(array(
+ 'disableAvatar' => 0
+ ));
+ }
+ }
}
use wcf\data\object\type\ObjectTypeCache;
use wcf\data\user\follow\UserFollowerList;
use wcf\data\user\follow\UserFollowingList;
+use wcf\data\user\group\UserGroup;
use wcf\data\user\profile\visitor\UserProfileVisitor;
use wcf\data\user\profile\visitor\UserProfileVisitorEditor;
use wcf\data\user\profile\visitor\UserProfileVisitorList;
'followingCount' => $this->followingList->countObjects(),
'visitors' => ($this->visitorList !== null ? $this->visitorList->getObjects() : array()),
'visitorCount' => ($this->visitorList !== null ? $this->visitorList->countObjects() : 0),
- 'allowSpidersToIndexThisPage' => true
+ 'allowSpidersToIndexThisPage' => true,
+ 'isAccessible' => UserGroup::isAccessibleGroup($this->user->getGroupIDs())
));
}
<item name="wcf.acp.group.description"><![CDATA[Beschreibung der Benutzergruppe]]></item>
<item name="wcf.acp.group.button.choose"><![CDATA[Benutzergruppe wählen]]></item>
<item name="wcf.acp.group.option.error.validationFailed"><![CDATA[Sie haben einen ungültigen Inhalt eingegeben.]]></item>
+ <item name="wcf.acp.group.option.admin.user.canDisableAvatar"><![CDATA[Kann Avatar sperren]]></item>
+ <item name="wcf.acp.group.option.admin.user.canDisableSignature"><![CDATA[Kann Signatur sperren]]></item>
</category>
<category name="wcf.acp.index">
<item name="wcf.global.filter"><![CDATA[Filter]]></item>
<item name="wcf.global.noItems"><![CDATA[Es wurden keine Einträge gefunden.]]></item>
<item name="wcf.global.button.showAll"><![CDATA[Alle anzeigen]]></item>
+ <item name="wcf.global.reason"><![CDATA[Begründung]]></item>
</category>
<category name="wcf.global.form">
<item name="wcf.user.register.honeyPot.description"><![CDATA[Falls Sie dies sehen können, füllen Sie bitte die nächsten zwei Eingabefelder <strong>NICHT</strong> aus!]]></item>
<item name="wcf.user.searchUserContent"><![CDATA[Inhalte von „{$user->username}“ suchen]]></item>
<item name="wcf.user.author"><![CDATA[Autor]]></item>
+ <item name="wcf.user.moderate"><![CDATA[Benutzer moderieren]]></item>
+ <item name="wcf.user.ban"><![CDATA[Benutzer sperren]]></item>
+ <item name="wcf.user.ban.confirmMessage"><![CDATA[Wollen Sie den Benutzer wirklich sperren?]]></item>
+ <item name="wcf.user.ban.reason.description"><![CDATA[Die Begründung wird dem gesperrten Benutzer beim Aufruf der Seite angezeigt.]]></item>
+ <item name="wcf.user.unban"><![CDATA[Benutzer entsperren]]></item>
+ <item name="wcf.user.disableAvatar"><![CDATA[Avatar sperren]]></item>
+ <item name="wcf.user.disableAvatar.confirmMessage"><![CDATA[Wollen Sie den Avatar des Benutzers wirklich sperren?]]></item>
+ <item name="wcf.user.enableAvatar"><![CDATA[Avatar entsperren]]></item>
+ <item name="wcf.user.disableSignature"><![CDATA[Signatur sperren]]></item>
+ <item name="wcf.user.disableSignature.confirmMessage"><![CDATA[Wollen Sie die Signatur des Benutzers wirklich sperren?]]></item>
+ <item name="wcf.user.enableSignature"><![CDATA[Signatur entsperren]]></item>
+ <item name="wcf.user.edit"><![CDATA[Benutzer bearbeiten]]></item>
</category>
<category name="wcf.user.menu">
<item name="wcf.acp.group.description"><![CDATA[Description]]></item>
<item name="wcf.acp.group.button.choose"><![CDATA[Choose User Group]]></item>
<item name="wcf.acp.group.option.error.validationFailed"><![CDATA[You have entered an invalid value.]]></item>
+ <item name="wcf.acp.group.option.admin.user.canDisableAvatar"><![CDATA[Can block avatar]]></item>
+ <item name="wcf.acp.group.option.admin.user.canDisableSignature"><![CDATA[Can block signature]]></item>
</category>
<category name="wcf.acp.index">
<item name="wcf.global.filter"><![CDATA[Filter]]></item>
<item name="wcf.global.noItems"><![CDATA[There are no items.]]></item>
<item name="wcf.global.button.showAll"><![CDATA[Show All]]></item>
+ <item name="wcf.global.reason"><![CDATA[Reason]]></item>
</category>
<category name="wcf.global.form">
<item name="wcf.user.register.honeyPot.description"><![CDATA[Heads up! If you can see this, you are strongly encouraged <strong>NOT</strong> to fill in the next two input fields!]]></item>
<item name="wcf.user.searchUserContent"><![CDATA[Search for content by “{$user->username}”]]></item>
<item name="wcf.user.author"><![CDATA[Author]]></item>
+ <item name="wcf.user.moderate"><![CDATA[Moderate User]]></item>
+ <item name="wcf.user.ban"><![CDATA[Ban User]]></item>
+ <item name="wcf.user.ban.confirmMessage"><![CDATA[Do you really want to ban this user?]]></item>
+ <item name="wcf.user.ban.reason.description"><![CDATA[The reason will be displayed for the user when visiting the site.]]></item>
+ <item name="wcf.user.unban"><![CDATA[Unban User]]></item>
+ <item name="wcf.user.disableAvatar"><![CDATA[Block Avatar]]></item>
+ <item name="wcf.user.disableAvatar.confirmMessage"><![CDATA[Do you really want to block the avatar of this user?]]></item>
+ <item name="wcf.user.enableAvatar"><![CDATA[Unblock Avatar]]></item>
+ <item name="wcf.user.disableSignature"><![CDATA[Block Signature]]></item>
+ <item name="wcf.user.disableSignature.confirmMessage"><![CDATA[Do you really want to block the signature of this user?]]></item>
+ <item name="wcf.user.enableSignature"><![CDATA[Unblock Signature]]></item>
+ <item name="wcf.user.edit"><![CDATA[Edit User]]></item>
</category>
<category name="wcf.user.menu">