From f6a27d19b05628fd627f5436ccddaade28fdfc33 Mon Sep 17 00:00:00 2001
From: Matt Mullenweg
user_login; ?> | @@ -162,14 +162,41 @@ if (isset($updated)) { ?>|||
- | - | ||
+ | + | ||
@@ -195,27 +222,8 @@ if (isset($updated)) { ?> | |||
- | + | + | |
Password (Leave blank to stay the same.)') ?> | diff --git a/wp-admin/upgrade-schema.php b/wp-admin/upgrade-schema.php index ead50925c8..65583d8748 100644 --- a/wp-admin/upgrade-schema.php +++ b/wp-admin/upgrade-schema.php @@ -204,7 +204,7 @@ function populate_options() { add_option('ping_sites', 'http://rpc.pingomatic.com/'); add_option('advanced_edit', 0); add_option('comment_max_links', 2); - // 1.3 + // 1.5 add_option('default_email_category', 1, 'Posts by email go to this category'); add_option('recently_edited'); add_option('use_linksupdate', 0); @@ -213,6 +213,7 @@ function populate_options() { add_option('comment_whitelist', 1); add_option('page_uris'); add_option('blacklist_keys'); + add_option('comment_registration', 0); // Delete unused options $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file', 'use_preview', 'use_htmltrans', 'smilies_directory', 'rss_language', 'fileupload_allowedusers', 'use_phoneemail', 'default_post_status', 'default_post_category', 'archive_mode', 'time_difference', 'links_minadminlevel', 'links_use_adminlevels', 'links_rating_type', 'links_rating_char', 'links_rating_ignore_zero', 'links_rating_single_image', 'links_rating_image0', 'links_rating_image1', 'links_rating_image2', 'links_rating_image3', 'links_rating_image4', 'links_rating_image5', 'links_rating_image6', 'links_rating_image7', 'links_rating_image8', 'links_rating_image9', 'weblogs_cacheminutes', 'comment_allowed_tags', 'search_engine_friendly_urls', 'default_geourl_lat', 'default_geourl_lon', 'use_default_geourl'); diff --git a/wp-comments-post.php b/wp-comments-post.php index 115c24e218..bf03915ac6 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -18,9 +18,18 @@ $comment_author_email = $_POST['email']; $comment_author_url = $_POST['url']; $comment_content = $_POST['comment']; -$comment_type = ''; +// If the user is logged in +get_currentuserinfo(); +if ( $user_ID ) : + $comment_author = $user_login; + $comment_author_email = $user_email; + $comment_author_url = str_replace('http://', '', $user_url); +else : + if ( get_option('comment_registration') ) + die( __('Sorry, you must be logged in to post a comment.') ); +endif; -$user_ip = apply_filters('pre_comment_user_ip', $_SERVER['REMOTE_ADDR']); +$comment_type = ''; if ( get_settings('require_name_email') && ('' == $comment_author_email || '' == $comment_author) ) die( __('Error: please fill the required fields (name, email).') ); @@ -28,7 +37,7 @@ if ( get_settings('require_name_email') && ('' == $comment_author_email || '' == if ( '' == $comment_content ) die( __('Error: please type a comment.') ); -$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type'); +$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID'); wp_new_comment($commentdata); diff --git a/wp-content/themes/default/comments.php b/wp-content/themes/default/comments.php index 435e334f98..871fc7e371 100644 --- a/wp-content/themes/default/comments.php +++ b/wp-content/themes/default/comments.php @@ -33,18 +33,16 @@