aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2011-04-06 19:31:02 +0000
committermistic100 <mistic@piwigo.org>2011-04-06 19:31:02 +0000
commit4fdaeb8308c17a07a0412a56aeb246a3e3432ae5 (patch)
tree3d086cbd94bd0072d9eb799a4c3e0744bde1512f /picture.php
parent4ad720c22878abefcbc2f9b8870a539783ae2a96 (diff)
merge r10097 & r10122 from trunk
git-svn-id: http://piwigo.org/svn/branches/2.2@10123 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--picture.php29
1 files changed, 25 insertions, 4 deletions
diff --git a/picture.php b/picture.php
index 5e58bba9a..d111d5301 100644
--- a/picture.php
+++ b/picture.php
@@ -189,6 +189,8 @@ function default_picture_content($content, $element_info)
// | initialization |
// +-----------------------------------------------------------------------+
+$infos = array();
+
// caching first_rank, last_rank, current_rank in the displayed
// section. This should also help in readability.
$page['first_rank'] = 0;
@@ -331,7 +333,7 @@ UPDATE '.USER_CACHE_CATEGORIES_TABLE.'
{
if (!empty($_POST['content']))
{
- update_user_comment(
+ $comment_action = update_user_comment(
array(
'comment_id' => $_GET['comment_to_edit'],
'image_id' => $page['image_id'],
@@ -340,7 +342,28 @@ UPDATE '.USER_CACHE_CATEGORIES_TABLE.'
$_POST['key']
);
- redirect($url_self);
+ switch ($comment_action)
+ {
+ case 'moderate':
+ array_push($infos, l10n('An administrator must authorize your comment before it is visible.'));
+ case 'validate':
+ array_push($infos, l10n('Your comment has been registered'));
+ break;
+ case 'reject':
+ set_status_header(403);
+ array_push($infos, l10n('Your comment has NOT been registered because it did not pass the validation rules'));
+ break;
+ default:
+ trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
+ }
+
+ $template->assign(
+ ($comment_action=='reject') ? 'errors' : 'infos',
+ $infos
+ );
+
+ unset($_POST['content']);
+ break;
}
else
{
@@ -834,8 +857,6 @@ if (isset($picture['current']['comment'])
);
}
-$infos = array();
-
// author
if (!empty($picture['current']['author']))
{