aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2011-12-19 17:08:49 +0000
committermistic100 <mistic@piwigo.org>2011-12-19 17:08:49 +0000
commit4bbd5f66492997cc49276034949a5f984ef6351d (patch)
tree39ff197c1c7c0b667943ea0a0296ff7c63a9417e /picture.php
parent5470df353ab58a5a4664453f2eb29febed15fbb6 (diff)
feature:2538 transmits messages after comment edition trough SESSION (no more ugly url displayed, avoid some minor bugs)
git-svn-id: http://piwigo.org/svn/trunk@12767 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--picture.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/picture.php b/picture.php
index bcc1a2939..015c65de5 100644
--- a/picture.php
+++ b/picture.php
@@ -320,6 +320,7 @@ UPDATE '.USER_CACHE_CATEGORIES_TABLE.'
include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php');
check_input_parameter('comment_to_edit', $_GET, false, PATTERN_ID);
$author_id = get_comment_author_id($_GET['comment_to_edit']);
+
if (can_manage_comment('edit', $author_id))
{
if (!empty($_POST['content']))
@@ -333,21 +334,27 @@ UPDATE '.USER_CACHE_CATEGORIES_TABLE.'
$_POST['key']
);
+ $perform_redirect = false;
switch ($comment_action)
{
case 'moderate':
- array_push($page['infos'], l10n('An administrator must authorize your comment before it is visible.'));
+ $_SESSION['page_infos'][] = l10n('An administrator must authorize your comment before it is visible.');
case 'validate':
- array_push($page['infos'], l10n('Your comment has been registered'));
+ $_SESSION['page_infos'][] = l10n('Your comment has been registered');
+ $perform_redirect = true;
break;
case 'reject':
- set_status_header(403);
- array_push($page['errors'], l10n('Your comment has NOT been registered because it did not pass the validation rules'));
+ $_SESSION['page_errors'][] = l10n('Your comment has NOT been registered because it did not pass the validation rules');
+ $perform_redirect = true;
break;
default:
trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
}
-
+
+ if ($perform_redirect)
+ {
+ redirect($url_self);
+ }
unset($_POST['content']);
break;
}