Changeset 10122
- Timestamp:
- Apr 6, 2011, 9:24:30 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/configuration.php
r10097 r10122 64 64 'comments_forall', 65 65 'comments_validation', 66 'comments_update_validation',67 66 'email_admin_on_comment', 68 67 'email_admin_on_comment_validation', -
trunk/admin/themes/default/template/configuration.tpl
r10097 r10122 142 142 <span class="property">{'Validation'|@translate}</span> 143 143 <input type="checkbox" name="comments_validation" {if ($comments.comments_validation)}checked="checked"{/if}> 144 </label>145 </li>146 147 <li>148 <label>149 <span class="property">{'Update Validation'|@translate}</span>150 <input type="checkbox" name="comments_update_validation" {if ($comments.comments_update_validation)}checked="checked"{/if}>151 144 </label> 152 145 </li> -
trunk/include/functions_comment.inc.php
r10097 r10122 266 266 267 267 // should the updated comment must be validated 268 if (!$conf['comments_ update_validation'] or is_admin())268 if (!$conf['comments_validation'] or is_admin()) 269 269 { 270 270 $comment_action='validate'; //one of validate, moderate, reject -
trunk/include/picture_comment.inc.php
r10097 r10122 39 39 } 40 40 41 if (!isset($comment_action)) 42 { 43 if ( $page['show_comments'] and isset( $_POST['content'] ) ) 44 { 45 if ( is_a_guest() and !$conf['comments_forall'] ) 46 { 47 die ('Session expired'); 48 } 49 50 $comm = array( 51 'author' => trim( @$_POST['author'] ), 52 'content' => trim( $_POST['content'] ), 53 'image_id' => $page['image_id'], 54 ); 55 56 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); 57 58 $comment_action = insert_user_comment($comm, @$_POST['key'], $infos ); 59 60 switch ($comment_action) 61 { 62 case 'moderate': 63 array_push( $infos, l10n('An administrator must authorize your comment before it is visible.') ); 64 case 'validate': 65 array_push( $infos, l10n('Your comment has been registered')); 66 break; 67 case 'reject': 68 set_status_header(403); 69 array_push($infos, l10n('Your comment has NOT been registered because it did not pass the validation rules') ); 70 break; 71 default: 72 trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING); 73 } 74 75 $template->assign( 76 ($comment_action=='reject') ? 'errors' : 'infos', 77 $infos 78 ); 79 80 // allow plugins to notify what's going on 81 trigger_action( 'user_comment_insertion', 82 array_merge($comm, array('action'=>$comment_action) ) 83 ); 84 } 85 elseif ( isset($_POST['content']) ) 86 { 87 set_status_header(403); 88 die('ugly spammer'); 89 } 41 if ( $page['show_comments'] and isset( $_POST['content'] ) ) 42 { 43 if ( is_a_guest() and !$conf['comments_forall'] ) 44 { 45 die ('Session expired'); 46 } 47 48 $comm = array( 49 'author' => trim( @$_POST['author'] ), 50 'content' => trim( $_POST['content'] ), 51 'image_id' => $page['image_id'], 52 ); 53 54 include_once(PHPWG_ROOT_PATH.'include/functions_comment.inc.php'); 55 56 $comment_action = insert_user_comment($comm, @$_POST['key'], $infos ); 57 58 switch ($comment_action) 59 { 60 case 'moderate': 61 array_push( $infos, l10n('An administrator must authorize your comment before it is visible.') ); 62 case 'validate': 63 array_push( $infos, l10n('Your comment has been registered')); 64 break; 65 case 'reject': 66 set_status_header(403); 67 array_push($infos, l10n('Your comment has NOT been registered because it did not pass the validation rules') ); 68 break; 69 default: 70 trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING); 71 } 72 73 $template->assign( 74 ($comment_action=='reject') ? 'errors' : 'infos', 75 $infos 76 ); 77 78 // allow plugins to notify what's going on 79 trigger_action( 'user_comment_insertion', 80 array_merge($comm, array('action'=>$comment_action) ) 81 ); 82 } 83 elseif ( isset($_POST['content']) ) 84 { 85 set_status_header(403); 86 die('ugly spammer'); 90 87 } 91 88 -
trunk/install/config.sql
r10097 r10122 4 4 INSERT INTO piwigo_config (param,value,comment) VALUES ('log','true','keep an history of visits on your website'); 5 5 INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_validation','false','administrators validate users comments before becoming visible'); 6 INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_update_validation','false','administrators validate users updated comments before becoming visible');7 6 INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_forall','false','even guest not registered can post comments'); 8 7 INSERT INTO piwigo_config (param,value,comment) VALUES ('user_can_delete_comment','false','administrators can allow user delete their own comments'); -
trunk/language/en_UK/admin.lang.php
r10101 r10122 730 730 $lang['Validate'] = "Validate"; 731 731 $lang['Validation'] = "Validation"; 732 $lang['Update Validation'] = "Validation when a comment is modified";733 732 $lang['Version of create_listing_file.php on the remote site and Piwigo must be the same'] = "Versions of create_listing_file.php on the remote site and Piwigo must be the same"; 734 733 $lang['Version'] = "Version"; -
trunk/language/fr_FR/admin.lang.php
r10101 r10122 170 170 $lang['Validate'] = "Valider"; 171 171 $lang['Validation'] = "Validation"; 172 $lang['Update Validation'] = "Validation quand un commentaire est modifié";173 172 $lang['Version'] = "Version"; 174 173 $lang['Virtual albums to move'] = 'Albums virtuels à déplacer'; -
trunk/picture.php
r10097 r10122 363 363 ); 364 364 365 unset($_POST['content']); 365 366 break; 366 367 }
Note: See TracChangeset
for help on using the changeset viewer.