Minor - remove unused session id

pull/3959/head
Julio 3 years ago
parent 372bf351e3
commit bf17dc8782
  1. 10
      public/main/forum/index.php
  2. 11
      public/main/forum/viewthread.php

@ -458,10 +458,11 @@ if (is_array($forumCategories)) {
}
}*/
// Validation when belongs to a session
$forumInfo['icon_session'] = api_get_session_image(
/*$forumInfo['icon_session'] = api_get_session_image(
$forum->getSessionId(),
$user
);
);*/
$forumInfo['icon_session'] = '';
if ('0' != $forum->getForumOfGroup()) {
$forumOfGroup = $forum->getForumOfGroup();
$my_all_groups_forum_name = $all_groups[$forumOfGroup]['name'] ?? null;
@ -553,9 +554,10 @@ if (is_array($forumCategories)) {
$forumInfo['last_post_text'] = Security::remove_XSS(cut($forum['last_post_text'], 140));
}*/
if (api_is_allowed_to_edit(false, true)
/*if (api_is_allowed_to_edit(false, true)
&& !(0 == $forum->getSessionId() && 0 != $sessionId)
) {
) {*/
if (api_is_allowed_to_edit(false, true)) {
$toolActions .= '<a href="'.api_get_self().'?'.api_get_cidreq()
.'&action=edit_forum&content=forum&id='.$forumId.'">'
.Display::return_icon('edit.png', get_lang('Edit'), [], ICON_SIZE_SMALL)

@ -319,7 +319,7 @@ if (($current_forum_category &&
// new thread link
if ((
api_is_allowed_to_edit(false, true) &&
!(api_is_session_general_coach() && $forumEntity->getSessionId() != $sessionId)) ||
!(api_is_session_general_coach())) || //&& $forumEntity->getSessionId() != $sessionId
(1 == $forumEntity->getAllowNewThreads() && isset($_user['user_id'])) ||
(1 == $forumEntity->getAllowNewThreads() && !isset($_user['user_id']) && 1 == $forumEntity->getAllowAnonymous())
) {
@ -460,7 +460,7 @@ foreach ($posts as $post) {
if (($groupEntity && $tutorGroup) ||
(1 == $forumEntity->getAllowEdit() && $posterId == $userId) ||
(api_is_allowed_to_edit(false, true) &&
!(api_is_session_general_coach() && $forumEntity->getSessionId() != $sessionId))
!(api_is_session_general_coach())) //&& $forumEntity->getSessionId() != $sessionId
) {
if (false == $locked && postIsEditableByStudent($forumEntity, $post)) {
$editUrl = api_get_path(WEB_CODE_PATH).'forum/editpost.php?'.api_get_cidreq();
@ -480,7 +480,7 @@ foreach ($posts as $post) {
if (($groupEntity && $tutorGroup) ||
api_is_allowed_to_edit(false, true) &&
!(api_is_session_general_coach() && $forumEntity->getSessionId() != $sessionId)
!(api_is_session_general_coach()) //&& $forumEntity->getSessionId() != $sessionId
) {
if (false == $locked) {
$deleteUrl = api_get_self().'?'.api_get_cidreq().'&'.http_build_query(
@ -514,8 +514,7 @@ foreach ($posts as $post) {
if (api_is_allowed_to_edit(false, true) &&
!(
api_is_session_general_coach() &&
$forumEntity->getSessionId() != $sessionId
api_is_session_general_coach() //&& $forumEntity->getSessionId() != $sessionId
)
) {
$iconEdit .= return_visible_invisible_icon(
@ -738,7 +737,7 @@ foreach ($posts as $post) {
$post['post_attachments'] .= '<span class="forum_attach_comment" >'.$attachment->getComment().'</span>';
if ((1 == $forumEntity->getAllowEdit() && $post['user_id'] == $userId) ||
(api_is_allowed_to_edit(false, true) &&
!(api_is_session_general_coach() && $forumEntity->getSessionId() != $sessionId))
!(api_is_session_general_coach())) //&& $forumEntity->getSessionId() != $sessionId
) {
$post['post_attachments'] .= '&nbsp;&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&action=delete_attach&id_attach='
.$attachment->getIid().'&forum='.$forumId.'&thread='.$threadId.'&post='.$post['post_id']

Loading…
Cancel
Save