Added 'canReportContent' permission
authorMarcel Werk <burntime@woltlab.com>
Fri, 23 May 2014 19:03:22 +0000 (21:03 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 23 May 2014 19:03:22 +0000 (21:03 +0200)
com.woltlab.wcf/templates/__commentJavaScript.tpl
com.woltlab.wcf/templates/commentList.tpl
com.woltlab.wcf/templates/commentResponseList.tpl
com.woltlab.wcf/templates/user.tpl
com.woltlab.wcf/userGroupOption.xml
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 2f00360666f3157872851ae1e08d7ffa453effc6..bdc6dc9dd1cac88716415b95898547823d16bb96 100644 (file)
                        new WCF.Comment.Response.Like({if $__wcf->getUser()->userID && $__wcf->getSession()->getPermission('user.like.canLike')}1{else}0{/if}, {@LIKE_ENABLE_DISLIKE}, false, {@LIKE_ALLOW_FOR_OWN_CONTENT});
                {/if}
                
-               new WCF.Moderation.Report.Content('com.woltlab.wcf.comment.comment', '.jsReportCommentComment');
-               new WCF.Moderation.Report.Content('com.woltlab.wcf.comment.response', '.jsReportCommentResponse');
+               {if $__wcf->session->getPermission('user.profile.canReportContent')}
+                       new WCF.Moderation.Report.Content('com.woltlab.wcf.comment.comment', '.jsReportCommentComment');
+                       new WCF.Moderation.Report.Content('com.woltlab.wcf.comment.response', '.jsReportCommentResponse');
+               {/if}
        });
        //]]>
 </script>
index 54e9e6eecfd92abb60b4b1816431d153895e30d4..9238db9371d60f0b9d2ca33cb43c61271bf92f42 100644 (file)
@@ -27,7 +27,9 @@
                                        
                                        <nav class="jsMobileNavigation buttonGroupNavigation">
                                                <ul class="commentOptions">
-                                                       <li class="jsReportCommentComment jsOnly" data-object-id="{@$comment->commentID}"><a title="{lang}wcf.moderation.report.reportContent{/lang}" class="jsTooltip"><span class="icon icon16 icon-warning-sign"></span> <span class="invisible">{lang}wcf.moderation.report.reportContent{/lang}</span></a></li>
+                                                       {if $__wcf->session->getPermission('user.profile.canReportContent')}
+                                                               <li class="jsReportCommentComment jsOnly" data-object-id="{@$comment->commentID}"><a title="{lang}wcf.moderation.report.reportContent{/lang}" class="jsTooltip"><span class="icon icon16 icon-warning-sign"></span> <span class="invisible">{lang}wcf.moderation.report.reportContent{/lang}</span></a></li>
+                                                       {/if}
                                                        
                                                        {event name='commentOptions'}
                                                </ul>
index 458140a204d382135d6fa4591664745716026dc4..90c8e7ced6c715b7b838e46c7e33f6cf0bb54ab4 100644 (file)
@@ -26,7 +26,9 @@
                                
                                <nav class="jsMobileNavigation buttonGroupNavigation">
                                        <ul class="commentOptions">
-                                               <li class="jsReportCommentResponse jsOnly" data-object-id="{@$response->responseID}"><a title="{lang}wcf.moderation.report.reportContent{/lang}" class="jsTooltip"><span class="icon icon16 icon-warning-sign"></span> <span class="invisible">{lang}wcf.moderation.report.reportContent{/lang}</span></a></li>
+                                               {if $__wcf->session->getPermission('user.profile.canReportContent')}
+                                                       <li class="jsReportCommentResponse jsOnly" data-object-id="{@$response->responseID}"><a title="{lang}wcf.moderation.report.reportContent{/lang}" class="jsTooltip"><span class="icon icon16 icon-warning-sign"></span> <span class="invisible">{lang}wcf.moderation.report.reportContent{/lang}</span></a></li>
+                                               {/if}
                                                
                                                {event name='commentOptions'}
                                        </ul>
index d8a4d2ea6c201c65d9e9f1df3cbb031547bbcd25..614c0f8b5bb17349d8a95617cb178ac894147696 100644 (file)
                                });
                        {/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');
+                       {if $__wcf->session->getPermission('user.profile.canReportContent')}
+                               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');
+                       {/if}
 
                        {event name='javascriptInit'}
                });
                                </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 $__wcf->session->getPermission('user.profile.canReportContent')}
+                               <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}
                        
                        {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 $isAccessible && $__wcf->user->userID != $user->userID && ($__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>
+                                       <a href="{link controller='UserEdit' object=$user isACP=true}{/link}" class="button jsTooltip jsUserInlineEditor" title="{lang}wcf.user.moderate{/lang}"><span class="icon icon16 fa-wrench"></span> <span class="invisible">{lang}wcf.acp.user.edit{/lang}</span></a>
                                        <ul class="dropdownMenu"></ul>
                                </li>
                        {/if}
index 3579938f2d3887659bb7db1d48c6d8a7249843fe..6c107425e2cc0e7bce4c4d849375a4557a0620d3 100644 (file)
@@ -508,6 +508,11 @@ pdf]]></defaultvalue>
                                <defaultvalue>0</defaultvalue>
                                <admindefaultvalue>1</admindefaultvalue>
                        </option>
+                       <option name="user.profile.canReportContent">
+                               <categoryname>user.profile</categoryname>
+                               <optiontype>boolean</optiontype>
+                               <defaultvalue>1</defaultvalue>
+                       </option>
                        <option name="user.profile.aboutMeMaxLength">
                                <categoryname>user.profile</categoryname>
                                <optiontype>integer</optiontype>
index ad887837fb632319f83e3e977d561411a47b15f1..4a6168bb16cc78fe39973e3815b5a9681267a560 100644 (file)
@@ -68,6 +68,8 @@ class ModerationQueueReportAction extends ModerationQueueAction {
         * Validates parameters to prepare a report.
         */
        public function validatePrepareReport() {
+               WCF::getSession()->checkPermissions(array('user.profile.canReportContent'));
+               
                $this->readInteger('objectID');
                $this->readString('objectType');
                
@@ -108,6 +110,8 @@ class ModerationQueueReportAction extends ModerationQueueAction {
         * Validates parameters for reporting.
         */
        public function validateReport() {
+               WCF::getSession()->checkPermissions(array('user.profile.canReportContent'));
+               
                $this->readString('message');
                
                $this->validatePrepareReport();
index 4ce0f8686f87bf43bbfd5baa27c5815781695b22..3c6e11295e2d024aacf26c7745d8d205496090f1 100644 (file)
                <item name="wcf.acp.group.assignment.userGroup"><![CDATA[Benutzergruppe]]></item>
                <item name="wcf.acp.group.assignment.isDisabled"><![CDATA[Automatische Zuordnung deaktivieren]]></item>
                <item name="wcf.acp.group.option.user.profile.aboutMeMaxLength"><![CDATA[Maximallänge „Über mich“]]></item>
+               <item name="wcf.acp.group.option.user.profile.canReportContent"><![CDATA[Kann Inhalte melden]]></item>
        </category>
        
        <category name="wcf.acp.index">
index 4fa346547a846a8a599d88fecfe45274a647d1f6..6a91fe4798d74f6ddf79bf7e6b52c90baad32e71 100644 (file)
@@ -386,6 +386,7 @@ Examples for medium ID detection:
                <item name="wcf.acp.group.assignment.userGroup"><![CDATA[User Group]]></item>
                <item name="wcf.acp.group.assignment.isDisabled"><![CDATA[Disable Automatic Assignment]]></item>
                <item name="wcf.acp.group.option.user.profile.aboutMeMaxLength"><![CDATA[TODO: Maximallänge „Über mich“]]></item>
+               <item name="wcf.acp.group.option.user.profile.canReportContent"><![CDATA[TODO: Kann Inhalte melden]]></item>
        </category>
        
        <category name="wcf.acp.index">