Changeset 1737
- Timestamp:
- 10/04/2004 08:49:45 AM (21 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options-discussion.php
r1620 r1737 58 58 <form name="form1" method="post" action="options.php"> 59 59 <input type="hidden" name="action" value="update" /> 60 <input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','require_name_email','comment_ max_links','moderation_keys'" />60 <input type="hidden" name="page_options" value="'default_pingback_flag','default_ping_status','default_comment_status','comments_notify','moderation_notify','comment_moderation','require_name_email','comment_whitelist','comment_max_links','moderation_keys'" /> 61 61 <fieldset class="options"> 62 62 <legend><?php _e('Usual settings for an article: <em>(These settings may be overridden for individual articles.)</em>') ?></legend> … … 102 102 <?php _e('An administrator must approve the comment (regardless of any matches below)') ?> </label> 103 103 </li> 104 <li> 105 <label for="require_name_email"> 106 <input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> /> 107 <?php _e('User must fill out name and e-mail') ?> </label> 108 </li> 104 <li><label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked('1', get_settings('require_name_email')); ?> /> <?php _e('Comment author must fill out name and e-mail') ?></label></li> 105 <li><label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_settings('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment') ?></label></li> 109 106 </ul> 110 107 </fieldset> -
trunk/wp-admin/upgrade-schema.php
r1735 r1737 212 212 add_option('template', 'default'); 213 213 add_option('stylesheet', 'default'); 214 add_option('comment_whitelist', 0); 214 215 215 216 // Delete unused options -
trunk/wp-includes/functions.php
r1734 r1737 1474 1474 1475 1475 function check_comment($author, $email, $url, $comment, $user_ip) { 1476 global $wpdb; 1477 1476 1478 if (1 == get_settings('comment_moderation')) return false; // If moderation is set to manual 1477 1479 … … 1479 1481 return false; // Check # of external links 1480 1482 1481 if ('' == trim( get_settings('moderation_keys') ) ) return true; // If moderation keys are empty 1482 $words = explode("\n", get_settings('moderation_keys') ); 1483 // Comment whitelisting: 1484 if ( 1 == get_settings('comment_whitelist')) { 1485 $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author_email = '$email' and comment_approved = '1' "); 1486 if ( 1 == $ok_to_comment && false === strpos( $email, get_settings('moderation_keys')) ) 1487 return true 1488 return false; 1489 } 1490 1491 $mod_keys = trim( get_settings('moderation_keys') ); 1492 if ('' == $mod_keys ) 1493 return true; // If moderation keys are empty 1494 $words = explode("\n", $mod_keys ); 1495 1483 1496 foreach ($words as $word) { 1484 1497 $word = trim($word);
Note: See TracChangeset
for help on using the changeset viewer.