mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge pull request #6624 from battye/ticket/16553
[ticket/16553] Fix for General Error when approving/disapproving a reported post through the MCP
This commit is contained in:
commit
7f11c1b46d
5 changed files with 14 additions and 1 deletions
|
@ -30,7 +30,7 @@ installer:
|
||||||
server:
|
server:
|
||||||
cookie_secure: false
|
cookie_secure: false
|
||||||
server_protocol: http://
|
server_protocol: http://
|
||||||
force_server_vars: false
|
force_server_vars: true
|
||||||
server_name: localhost
|
server_name: localhost
|
||||||
server_port: 80
|
server_port: 80
|
||||||
script_path: /
|
script_path: /
|
||||||
|
|
|
@ -34,6 +34,14 @@ sudo ln -s /workspaces/phpbb/phpBB /var/www/html
|
||||||
echo "[Codespaces] Copy phpBB configuration"
|
echo "[Codespaces] Copy phpBB configuration"
|
||||||
cp /workspaces/phpbb/.devcontainer/resources/phpbb-config.yml /workspaces/phpbb/phpBB/install/install-config.yml
|
cp /workspaces/phpbb/.devcontainer/resources/phpbb-config.yml /workspaces/phpbb/phpBB/install/install-config.yml
|
||||||
|
|
||||||
|
# Force the server URL to reflect the Codespace
|
||||||
|
# https://docs.github.com/en/codespaces/developing-in-a-codespace/default-environment-variables-for-your-codespace
|
||||||
|
if [ "$CODESPACES" = true ] ; then
|
||||||
|
echo "[Codespaces] Set the phpBB server name using default environment variables"
|
||||||
|
codespaces_url="${CODESPACE_NAME}-80.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}"
|
||||||
|
sed -i "s/localhost/$codespaces_url/g" /workspaces/phpbb/phpBB/install/install-config.yml
|
||||||
|
fi
|
||||||
|
|
||||||
# Install phpBB
|
# Install phpBB
|
||||||
echo "[Codespaces] Run phpBB CLI installation"
|
echo "[Codespaces] Run phpBB CLI installation"
|
||||||
cd /workspaces/phpbb/phpBB && composer install --no-interaction
|
cd /workspaces/phpbb/phpBB && composer install --no-interaction
|
||||||
|
|
|
@ -222,6 +222,7 @@ function mcp_post_details($id, $mode, $action)
|
||||||
'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters
|
'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters
|
||||||
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id"),
|
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id"),
|
||||||
|
|
||||||
|
'S_CAN_APPROVE' => $auth->acl_get('m_approve', $post_info['forum_id']),
|
||||||
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
|
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
|
||||||
'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']),
|
'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']),
|
||||||
'S_CAN_LOCK_POST' => $auth->acl_get('m_lock', $post_info['forum_id']),
|
'S_CAN_LOCK_POST' => $auth->acl_get('m_lock', $post_info['forum_id']),
|
||||||
|
|
|
@ -252,6 +252,7 @@ class mcp_reports
|
||||||
$report_template = array(
|
$report_template = array(
|
||||||
'S_MCP_REPORT' => true,
|
'S_MCP_REPORT' => true,
|
||||||
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&p=' . $post_id),
|
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&p=' . $post_id),
|
||||||
|
'S_CAN_APPROVE' => $auth->acl_get('m_approve', $post_info['forum_id']),
|
||||||
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
|
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
|
||||||
'S_POST_REPORTED' => $post_info['post_reported'],
|
'S_POST_REPORTED' => $post_info['post_reported'],
|
||||||
'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,
|
'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,
|
||||||
|
@ -260,6 +261,7 @@ class mcp_reports
|
||||||
'S_USER_NOTES' => true,
|
'S_USER_NOTES' => true,
|
||||||
|
|
||||||
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&p={$post_info['post_id']}") : '',
|
'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&p={$post_info['post_id']}") : '',
|
||||||
|
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&p=' . $post_id),
|
||||||
'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&p=' . $post_id),
|
'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&p=' . $post_id),
|
||||||
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&p=' . $post_id),
|
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&p=' . $post_id),
|
||||||
'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $report['user_id']),
|
'U_MCP_REPORTER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $report['user_id']),
|
||||||
|
|
|
@ -78,6 +78,7 @@
|
||||||
<p class="author"><span><i class="icon fa-file fa-fw icon-lightgray icon-md" aria-hidden="true"></i><span class="sr-only">{MINI_POST_IMG}</span></span> {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} » {POST_DATE}</p>
|
<p class="author"><span><i class="icon fa-file fa-fw icon-lightgray icon-md" aria-hidden="true"></i><span class="sr-only">{MINI_POST_IMG}</span></span> {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} » {POST_DATE}</p>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
{% if S_CAN_APPROVE %}
|
||||||
<!-- IF S_POST_UNAPPROVED -->
|
<!-- IF S_POST_UNAPPROVED -->
|
||||||
<form method="post" id="mcp_approve" action="{U_APPROVE_ACTION}">
|
<form method="post" id="mcp_approve" action="{U_APPROVE_ACTION}">
|
||||||
|
|
||||||
|
@ -101,6 +102,7 @@
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if S_POST_REPORTED and not S_MCP_REPORT %}
|
{% if S_POST_REPORTED and not S_MCP_REPORT %}
|
||||||
<p class="post-notice reported">
|
<p class="post-notice reported">
|
||||||
|
|
Loading…
Add table
Reference in a new issue