Removed the legacy option to enable dislikes
authorAlexander Ebert <ebert@woltlab.com>
Mon, 15 Jul 2019 16:17:40 +0000 (18:17 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 15 Jul 2019 16:17:40 +0000 (18:17 +0200)
See #2975

com.woltlab.wcf/option.xml
com.woltlab.wcf/templates/article.tpl
com.woltlab.wcf/templates/commentList.tpl
com.woltlab.wcf/templates/commentResponseList.tpl
constants.php
wcfsetup/install/files/acp/update-com.woltlab.wcf_3.2_reactionUpdate.php
wcfsetup/install/files/lib/data/like/LikeAction.class.php
wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index aecc4a55304484afbcafcfafc3aa4f564b2b4f35..5b1cbe6d9f7de4ad4725b0365e7a445d8847a8bc 100644 (file)
@@ -1464,19 +1464,6 @@ DESC:wcf.global.sortOrder.descending</selectoptions>
                                <suffix>days</suffix>
                        </option>
                        <!-- /user.cleanup -->
-                       <option name="like_allow_for_own_content">
-                               <categoryname>message.general.likes</categoryname>
-                               <optiontype>boolean</optiontype>
-                               <defaultvalue>0</defaultvalue>
-                               <options>module_like</options>
-                       </option>
-                       <option name="like_enable_dislike">
-                               <categoryname>message.general.likes</categoryname>
-                               <optiontype>boolean</optiontype>
-                               <defaultvalue>0</defaultvalue>
-                               <options>module_like</options>
-                               <hidden>1</hidden>
-                       </option>
                        <option name="like_show_summary">
                                <categoryname>message.general.likes</categoryname>
                                <optiontype>boolean</optiontype>
@@ -1765,6 +1752,8 @@ DESC:wcf.global.sortOrder.descending</selectoptions>
        </import>
        <delete>
                <option name="attachment_storage" />
+               <option name="like_allow_for_own_content" />
+               <option name="like_enable_dislike" />
                <option name="module_attachment"/>
        </delete>
 </data>
index 4b317e87e8d37f12b7fed8324261d9de598cf3bd..1b077010251cd8c83804bd7d4a213e3e64328e3e 100644 (file)
                        
                        <div class="col-xs-12 col-md-6 col-md{if !(MODULE_LIKE && ARTICLE_ENABLE_LIKE && $__wcf->session->getPermission('user.like.canViewLike'))} col-md-offset-6{/if}">
                                <ul class="articleLikeButtons buttonGroup">
-                                       {if MODULE_LIKE && ARTICLE_ENABLE_LIKE && $__wcf->session->getPermission('user.like.canLike') && (LIKE_ALLOW_FOR_OWN_CONTENT || $article->userID != $__wcf->user->userID)}
+                                       {if MODULE_LIKE && ARTICLE_ENABLE_LIKE && $__wcf->session->getPermission('user.like.canLike') && $article->userID != $__wcf->user->userID}
                                                <li class="jsOnly"><span class="button reactButton{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID} active{/if}" title="{lang}wcf.reactions.react{/lang}" data-reaction-type-id="{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID}{$articleLikeData[$article->articleID]->reactionTypeID}{else}0{/if}"><span class="icon icon16 fa-smile-o"></span> <span class="invisible">{lang}wcf.reactions.react{/lang}</span></span></li>
                                        {/if}
                                        {if $__wcf->session->getPermission('user.profile.canReportContent')}
                        new UiReactionHandler('com.woltlab.wcf.likeableArticle', {
                                // permissions
                                canReact: {if $__wcf->getUser()->userID}true{else}false{/if},
-                               canReactToOwnContent: {if LIKE_ALLOW_FOR_OWN_CONTENT}true{else}false{/if},
+                               canReactToOwnContent: false,
                                canViewReactions: {if LIKE_SHOW_SUMMARY}true{else}false{/if},
                                
                                // selectors
index 0944a0683bd947f851194c5cfd3cceceb76d02de..a062f7e8ae7938d93c649998e7c44f33e670740e 100644 (file)
@@ -55,7 +55,7 @@
                                                                        <li class="jsReportCommentComment jsOnly" data-object-id="{@$comment->commentID}"><a href="#" title="{lang}wcf.moderation.report.reportContent{/lang}" class="jsTooltip"><span class="icon icon16 fa-exclamation-triangle"></span> <span class="invisible">{lang}wcf.moderation.report.reportContent{/lang}</span></a></li>
                                                                {/if}
                                                                
-                                                               {if MODULE_LIKE && $__wcf->session->getPermission('user.like.canLike') && (LIKE_ALLOW_FOR_OWN_CONTENT || $comment->userID != $__wcf->user->userID)}
+                                                               {if MODULE_LIKE && $__wcf->session->getPermission('user.like.canLike') && $comment->userID != $__wcf->user->userID}
                                                                        <li class="jsOnly"><a href="#" class="reactButton jsTooltip {if $likeData[comment][$comment->commentID]|isset && $likeData[comment][$comment->commentID]->reactionTypeID} active{/if}" title="{lang}wcf.reactions.react{/lang}" data-reaction-type-id="{if $likeData[comment][$comment->commentID]|isset && $likeData[comment][$comment->commentID]->reactionTypeID}{$likeData[comment][$comment->commentID]->reactionTypeID}{else}0{/if}"><span class="icon icon16 fa-smile-o"></span> <span class="invisible">{lang}wcf.reactions.react{/lang}</span></a></li>
                                                                {/if}
                                                                
index 29c00e05ce729e1a302c42dd3b66c9f47d50f9d8..d2803b3b7978b1af4a93f81647933a7a5cd76944 100644 (file)
@@ -48,7 +48,7 @@
                                                                <li class="jsReportCommentResponse jsOnly" data-object-id="{@$response->responseID}"><a href="#" title="{lang}wcf.moderation.report.reportContent{/lang}" class="jsTooltip"><span class="icon icon16 fa-exclamation-triangle"></span> <span class="invisible">{lang}wcf.moderation.report.reportContent{/lang}</span></a></li>
                                                        {/if}
                                                        
-                                                       {if MODULE_LIKE && $__wcf->session->getPermission('user.like.canLike') && (LIKE_ALLOW_FOR_OWN_CONTENT || $response->userID != $__wcf->user->userID)}<li class="jsOnly"><a href="#" class="reactButton jsTooltip {if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID} active{/if}" title="{lang}wcf.reactions.react{/lang}" data-reaction-type-id="{if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID}{$likeData[response][$response->responseID]->reactionTypeID}{else}0{/if}"><span class="icon icon16 fa-smile-o"></span> <span class="invisible">{lang}wcf.reactions.react{/lang}</span></a></li>{/if}
+                                                       {if MODULE_LIKE && $__wcf->session->getPermission('user.like.canLike') && $response->userID != $__wcf->user->userID}<li class="jsOnly"><a href="#" class="reactButton jsTooltip {if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID} active{/if}" title="{lang}wcf.reactions.react{/lang}" data-reaction-type-id="{if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID}{$likeData[response][$response->responseID]->reactionTypeID}{else}0{/if}"><span class="icon icon16 fa-smile-o"></span> <span class="invisible">{lang}wcf.reactions.react{/lang}</span></a></li>{/if}
                                                        
                                                        {event name='commentOptions'}
                                                </ul>
index ee4f6be08e1db72096ee7e017ea0a84d3855c863..2cec03207375379df00723ff4a3bfd4a3c780016 100644 (file)
@@ -186,8 +186,8 @@ define('USERS_ONLINE_RECORD_TIME', 0);
 define('USER_CLEANUP_NOTIFICATION_LIFETIME', 14);
 define('USER_CLEANUP_ACTIVITY_EVENT_LIFETIME', 60);
 define('USER_CLEANUP_PROFILE_VISITOR_LIFETIME', 60);
-define('LIKE_ALLOW_FOR_OWN_CONTENT', 1);
-define('LIKE_ENABLE_DISLIKE', 1);
+define('LIKE_ALLOW_FOR_OWN_CONTENT', 0);
+define('LIKE_ENABLE_DISLIKE', 0);
 define('LIKE_SHOW_SUMMARY', 1);
 define('MESSAGE_SIDEBAR_ENABLE_ONLINE_STATUS', 1);
 define('MESSAGE_SIDEBAR_ENABLE_LIKES_RECEIVED', 1);
index 915ea281494196031c3853ccb62e6d9cf7dd169a..1b535daace22b196a7874de4abdf8077eb48d86f 100644 (file)
@@ -18,7 +18,6 @@ use wcf\system\WCF;
 
 OptionEditor::import([
        'like_show_summary' => 1,
-       'like_enable_dislike' => 0
 ]);
 
 try {
index f230973d397e40f7387f6bec5b646b831bfe5fb1..0326922d0cfc812814df4929278afce6dd6de86b 100644 (file)
@@ -124,7 +124,7 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                // check if liking own content but forbidden by configuration
                $this->likeableObject = $this->objectTypeProvider->getObjectByID($this->parameters['data']['objectID']);
                $this->likeableObject->setObjectType($this->objectType);
-               if (!LIKE_ALLOW_FOR_OWN_CONTENT && ($this->likeableObject->getUserID() == WCF::getUser()->userID)) {
+               if ($this->likeableObject->getUserID() == WCF::getUser()->userID) {
                        throw new PermissionDeniedException();
                }
        }
@@ -140,11 +140,8 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
         * @inheritDoc
         */
        public function validateDislike() {
-               if (!LIKE_ENABLE_DISLIKE) {
-                       throw new PermissionDeniedException();
-               }
-               
-               $this->validateLike();
+               // No longer supported since 5.2.
+               throw new PermissionDeniedException();
        }
        
        /**
index 4d729ec359edb882924e91be2361b2ea4b34fbc0..f7e65cbe53f94dc1d0f4bd88798c94a000aee498 100644 (file)
@@ -194,7 +194,7 @@ class ReactionAction extends AbstractDatabaseObjectAction {
                // check if liking own content but forbidden by configuration
                $this->likeableObject = $this->objectTypeProvider->getObjectByID($this->parameters['data']['objectID']);
                $this->likeableObject->setObjectType($this->objectType);
-               if (!LIKE_ALLOW_FOR_OWN_CONTENT && ($this->likeableObject->getUserID() == WCF::getUser()->userID)) {
+               if ($this->likeableObject->getUserID() == WCF::getUser()->userID) {
                        throw new PermissionDeniedException();
                }
                
index bf3fb73ba14881f4df04d2dc3b6993380d2c3137..86607f2ad5de351745a33897a3973895a403f722 100644 (file)
@@ -356,10 +356,15 @@ class WCF {
         * Loads the options file, automatically created if not exists.
         */
        protected function loadOptions() {
-               // the attachment module is always enabled since 5.2
+               // The attachment module is always enabled since 5.2.
                // https://github.com/WoltLab/WCF/issues/2531
                define('MODULE_ATTACHMENT', 1);
                
+               // Users cannot react to their own content since 5.2.
+               // https://github.com/WoltLab/WCF/issues/2975
+               define('LIKE_ALLOW_FOR_OWN_CONTENT', 0);
+               define('LIKE_ENABLE_DISLIKE', 0);
+               
                $filename = WCF_DIR.'options.inc.php';
                
                // create options file if doesn't exist
index 41b271a4da08baa622b12a9e19648b71f54a3276..c5d62f80ad05ce0b70d32be0e0d9017bc6d1dfe1 100644 (file)
@@ -1507,8 +1507,6 @@ Das Fehlerprotokoll enthält {$data[count]} neue Einträge. Die ersten drei, in
                <item name="wcf.acp.option.user_cleanup_profile_visitor_lifetime.description"><![CDATA[Zeitraum nach dem Profil-Besucher automatisch verworfen werden.]]></item>
                <item name="wcf.acp.option.category.message.general.likes"><![CDATA[Reaktions-System]]></item>
                <item name="wcf.acp.option.module_like"><![CDATA[Reaktions-System]]></item>
-               <item name="wcf.acp.option.like_allow_for_own_content"><![CDATA[Benutzer können auf eigene Inhalte reagieren]]></item>
-               <item name="wcf.acp.option.like_enable_dislike"><![CDATA[Benutzer können Inhalte disliken]]></item>
                <item name="wcf.acp.option.like_show_summary"><![CDATA[Zusammenfassung anzeigen]]></item>
                <item name="wcf.acp.option.module_user_profile_wall"><![CDATA[Benutzerprofil-Pinnwand]]></item>
                <item name="wcf.acp.option.category.message.sidebar"><![CDATA[Seitenleiste]]></item>
index 9f060d5ed88f21375665f23ead713bd1931ce9ae..d67517785a7f85f484e42702f76e3b37ed8da515 100644 (file)
@@ -1487,8 +1487,6 @@ This protocol file contains {$data[count]} new entries. The first three error me
                <item name="wcf.acp.option.user_cleanup_profile_visitor_lifetime.description"><![CDATA[Profile visitors will be removed after the following days.]]></item>
                <item name="wcf.acp.option.category.message.general.likes"><![CDATA[Likes System]]></item>
                <item name="wcf.acp.option.module_like"><![CDATA[Likes system]]></item>
-               <item name="wcf.acp.option.like_allow_for_own_content"><![CDATA[Users can react to their own content]]></item>
-               <item name="wcf.acp.option.like_enable_dislike"><![CDATA[Users can dislike content]]></item>
                <item name="wcf.acp.option.like_show_summary"><![CDATA[Display likes summary]]></item>
                <item name="wcf.acp.option.module_user_profile_wall"><![CDATA[User profile wall]]></item>
                <item name="wcf.acp.option.category.message.sidebar"><![CDATA[Sidebar]]></item>