<allowsidebar>1</allowsidebar>
</type>
+ <type>
+ <name>com.woltlab.wcf.user</name>
+ <definitionname>com.woltlab.wcf.moderation.report</definitionname>
+ <classname>wcf\system\moderation\queue\report\UserModerationQueueReportHandler</classname>
+ </type>
+
<!-- user online locations -->
<type>
<name>com.woltlab.wcf.user.UserPage</name>
--- /dev/null
+<div class="container marginTop">
+ <ol class="containerList userList">
+ {include file='userListItem'}
+ </ol>
+</div>
+
+<script data-relocate="true">
+ //<![CDATA[
+ $(function() {
+ $('#removeContent').hide();
+ });
+ //]]>
+</script>
<link rel="canonical" href="{link controller='User' object=$user}{/link}" />
- <script data-relocate="true" src="{@$__wcf->getPath('wcf')}js/WCF.User{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@$__wcfVersion}"></script>
+ <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.Moderation{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>
{event name='javascriptInclude'}
<script data-relocate="true">
//<![CDATA[
});
{/if}
+ WCF.Language.addObject({
+ 'wcf.moderation.report.reportContent': '{lang}wcf.user.profile.report{/lang}',
+ 'wcf.moderation.report.success': '{lang}wcf.moderation.report.success{/lang}'
+ });
+ new WCF.Moderation.Report.Content('com.woltlab.wcf.user', '.jsReportUser');
+
{event name='javascriptInit'}
});
//]]>
</ul>
</li>
{/hascontent}
+ <li class="jsReportUser jsOnly" data-object-id="{@$user->userID}"><a title="{lang}wcf.user.profile.report{/lang}" class="button jsTooltip"><span class="icon icon16 icon-warning-sign"></span> <span class="invisible">{lang}wcf.user.profile.report{/lang}</span></a></li>
{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}
{event name='buttons'}
</ul>
use wcf\data\user\group\UserGroup;
use wcf\data\user\UserList;
use wcf\data\DatabaseObject;
+use wcf\data\IUserContent;
use wcf\system\cache\builder\UserOptionCacheBuilder;
use wcf\system\language\LanguageFactory;
use wcf\system\request\IRouteController;
+use wcf\system\request\LinkHandler;
use wcf\system\user\storage\UserStorageHandler;
use wcf\system\WCF;
use wcf\util\PasswordUtil;
* @subpackage data.user
* @category Community Framework
*/
-final class User extends DatabaseObject implements IRouteController {
+final class User extends DatabaseObject implements IRouteController, IUserContent {
/**
* @see \wcf\data\DatabaseObject::$databaseTableName
*/
return $this->hasAdministrativePermissions;
}
+
+ /**
+ * @see \wcf\data\IMessage::getUserID()
+ */
+ public function getUserID() {
+ return $this->userID;
+ }
+
+ /**
+ * @see \wcf\data\IMessage::getUsername()
+ */
+ public function getUsername() {
+ return $this->username;
+ }
+
+ /**
+ * @see \wcf\data\IMessage::getTime()
+ */
+ public function getTime() {
+ return $this->registrationDate;
+ }
+
+ /**
+ * @see \wcf\data\ILinkableObject::getLink()
+ */
+ public function getLink() {
+ return LinkHandler::getInstance()->getLink('User', array(
+ 'application' => 'wcf',
+ 'object' => $this,
+ 'forceFrontend' => true
+ ));
+ }
}
--- /dev/null
+<?php
+namespace wcf\system\moderation\queue\report;
+use wcf\data\moderation\queue\ModerationQueue;
+use wcf\data\moderation\queue\ViewableModerationQueue;
+use wcf\data\user\UserList;
+use wcf\data\user\UserProfile;
+use wcf\data\user\User;
+use wcf\system\exception\SystemException;
+use wcf\system\moderation\queue\AbstractModerationQueueHandler;
+use wcf\system\moderation\queue\ModerationQueueManager;
+use wcf\system\WCF;
+
+/**
+ * An implementation of IModerationQueueReportHandler for user profiles.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2014 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.moderation.queue
+ * @category Community Framework
+ */
+class UserModerationQueueReportHandler extends AbstractModerationQueueHandler implements IModerationQueueReportHandler {
+ /**
+ * @see \wcf\system\moderation\queue\AbstractModerationQueueHandler::$className
+ */
+ protected $className = 'wcf\data\user\User';
+
+ /**
+ * @see \wcf\system\moderation\queue\AbstractModerationQueueHandler::$definitionName
+ */
+ protected $definitionName = 'com.woltlab.wcf.moderation.report';
+
+ /**
+ * @see \wcf\system\moderation\queue\AbstractModerationQueueHandler::$objectType
+ */
+ protected $objectType = 'com.woltlab.wcf.user';
+
+ /**
+ * list of users
+ * @var array<\wcf\data\user\User>
+ */
+ protected static $users = array();
+
+ /**
+ * @see \wcf\system\moderation\queue\IModerationQueueHandler::assignQueues()
+ */
+ public function assignQueues(array $queues) {
+ $assignments = array();
+ foreach ($queues as $queue) {
+ $assignUser = false;
+ if (WCF::getSession()->getPermission('mod.general.canUseModeration')) {
+ $assignUser = true;
+ }
+
+ $assignments[$queue->queueID] = $assignUser;
+ }
+
+ ModerationQueueManager::getInstance()->setAssignment($assignments);
+ }
+
+ /**
+ * @see \wcf\system\moderation\queue\report\IModerationQueueReportHandler::canReport()
+ */
+ public function canReport($objectID) {
+ if (!$this->isValid($objectID)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * @see \wcf\system\moderation\queue\IModerationQueueHandler::getContainerID()
+ */
+ public function getContainerID($objectID) {
+ return 0;
+ }
+
+ /**
+ * @see \wcf\system\moderation\queue\report\IModerationQueueReportHandler::getReportedContent()
+ */
+ public function getReportedContent(ViewableModerationQueue $queue) {
+ WCF::getTPL()->assign(array(
+ 'user' => new UserProfile($queue->getAffectedObject())
+ ));
+
+ return WCF::getTPL()->fetch('moderationUser');
+ }
+
+ /**
+ * @see \wcf\system\moderation\queue\report\IModerationQueueReportHandler::getReportedObject()
+ */
+ public function getReportedObject($objectID) {
+ if ($this->isValid($objectID)) {
+ return $this->getUser($objectID);
+ }
+
+ return null;
+ }
+
+ /**
+ * @see \wcf\system\moderation\queue\IModerationQueueHandler::isValid()
+ */
+ public function isValid($objectID) {
+ if ($this->getUser($objectID) === null) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns a user object by user id or null if user id is invalid.
+ *
+ * @param integer $objectID
+ * @return \wcf\data\user\User
+ */
+ protected function getUser($objectID) {
+ if (!array_key_exists($objectID, self::$users)) {
+ self::$users[$objectID] = new User($objectID);
+ if (!self::$users[$objectID]->userID) {
+ self::$users[$objectID] = null;
+ }
+ }
+
+ return self::$users[$objectID];
+ }
+
+ /**
+ * @see \wcf\system\moderation\queue\IModerationQueueHandler::populate()
+ */
+ public function populate(array $queues) {
+ $objectIDs = array();
+ foreach ($queues as $object) {
+ $objectIDs[] = $object->objectID;
+ }
+
+ // fetch users
+ $userList = new UserList();
+ $userList->setObjectIDs($objectIDs);
+ $userList->readObjects();
+ $users = $userList->getObjects();
+
+ foreach ($queues as $object) {
+ if (isset($users[$object->objectID])) {
+ $object->setAffectedObject($users[$object->objectID]);
+ }
+ else {
+ $object->setIsOrphaned();
+ }
+ }
+ }
+
+ /**
+ * @see \wcf\system\moderation\queue\IModerationQueueHandler::removeContent()
+ */
+ public function removeContent(ModerationQueue $queue, $message) {
+ throw new SystemException("it's not allowed to delete users using the moderation");
+ }
+}
<item name="wcf.moderation.type.com.woltlab.wcf.moderation.report"><![CDATA[Meldung]]></item>
<item name="wcf.moderation.type.com.woltlab.wcf.comment.comment"><![CDATA[Kommentar]]></item>
<item name="wcf.moderation.type.com.woltlab.wcf.comment.response"><![CDATA[Antwort auf Kommentar]]></item>
+ <item name="wcf.moderation.type.com.woltlab.wcf.user"><![CDATA[Benutzerprofil]]></item>
<item name="wcf.moderation.showAll"><![CDATA[Alle Einträge anzeigen]]></item>
<item name="wcf.moderation.showDeletedContent"><![CDATA[Gelöschte Inhalte anzeigen]]></item>
<item name="wcf.moderation.deletedContent.objectTypes"><![CDATA[Gelöschte Inhalte]]></item>
<item name="wcf.user.profile.menu.wall"><![CDATA[Pinnwand]]></item>
<item name="wcf.user.profile.recentActivity.profileComment"><![CDATA[Hat einen Kommentar an die <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a> geschrieben.]]></item>
<item name="wcf.user.profile.recentActivity.profileCommentResponse"><![CDATA[Hat auf einen Kommentar von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> an der <a href="{link controller='User' object=$user}{/link}#wall">Pinnwand von {$user->username}</a> geantwortet.]]></item>
+ <item name="wcf.user.profile.report"><![CDATA[Benutzerprofil melden]]></item>
</category>
<category name="wcf.user.objectWatch">
<item name="wcf.moderation.type.com.woltlab.wcf.moderation.report"><![CDATA[Report]]></item>
<item name="wcf.moderation.type.com.woltlab.wcf.comment.comment"><![CDATA[Comment]]></item>
<item name="wcf.moderation.type.com.woltlab.wcf.comment.response"><![CDATA[Comment Reply]]></item>
+ <item name="wcf.moderation.type.com.woltlab.wcf.user"><![CDATA[User Profile]]></item>
<item name="wcf.moderation.showAll"><![CDATA[Show All Items]]></item>
<item name="wcf.moderation.showDeletedContent"><![CDATA[Show Deleted Content]]></item>
<item name="wcf.moderation.deletedContent.objectTypes"><![CDATA[Deleted Content]]></item>
<item name="wcf.user.profile.menu.wall"><![CDATA[Wall]]></item>
<item name="wcf.user.profile.recentActivity.profileComment"><![CDATA[Wrote a comment on <a href="{link controller='User' object=$user}{/link}#wall">{$user->username}’s wall</a>.]]></item>
<item name="wcf.user.profile.recentActivity.profileCommentResponse"><![CDATA[Replied to a comment by <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> on <a href="{link controller='User' object=$user}{/link}#wall">{$user->username}’s wall</a>.]]></item>
+ <item name="wcf.user.profile.report"><![CDATA[Report User Profile]]></item>
</category>
<category name="wcf.user.objectWatch">