X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/a5227bf01edbe6660486c9f5c0f0ed7b7fea3130..f9001779751f83dc8a10e478bfecb4d8dd5f964c:/wp-content/plugins/akismet/admin.php diff --git a/wp-content/plugins/akismet/admin.php b/wp-content/plugins/akismet/admin.php index a1954039..91cedb29 100644 --- a/wp-content/plugins/akismet/admin.php +++ b/wp-content/plugins/akismet/admin.php @@ -7,11 +7,11 @@ function akismet_admin_init() { global $wp_version; // all admin functions are disabled in old versions - if ( version_compare( $wp_version, '3.0', '<' ) ) { + if ( !function_exists('is_multisite') && version_compare( $wp_version, '3.0', '<' ) ) { function akismet_version_warning() { echo " -

".sprintf(__('Akismet %s required WordPress 3.0 or higher.'), AKISMET_VERSION) ." ".sprintf(__('Please upgrade WordPress to a current version, or downgrade to version 2.4 of the Akismet plugin.'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'). "

+

".sprintf(__('Akismet %s requires WordPress 3.0 or higher.'), AKISMET_VERSION) ." ".sprintf(__('Please upgrade WordPress to a current version, or downgrade to version 2.4 of the Akismet plugin.'), 'http://codex.wordpress.org/Upgrading_WordPress', 'http://wordpress.org/extend/plugins/akismet/download/'). "

"; } add_action('admin_notices', 'akismet_version_warning'); @@ -24,7 +24,11 @@ function akismet_admin_init() { else $hook = 'dashboard_page_akismet-stats-display'; add_action('admin_head-'.$hook, 'akismet_stats_script'); - add_meta_box('akismet-status', __('Akismet Status'), 'akismet_comment_status_meta_box', 'comment', 'normal'); + add_meta_box('akismet-status', __('Comment History'), 'akismet_comment_status_meta_box', 'comment', 'normal'); + wp_register_style('akismet.css', AKISMET_PLUGIN_URL . 'akismet.css'); + wp_enqueue_style('akismet.css'); + wp_register_script('akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery')); + wp_enqueue_script('akismet.js'); } add_action('admin_init', 'akismet_admin_init'); @@ -34,9 +38,18 @@ $akismet_nonce = 'akismet-update-key'; function akismet_config_page() { if ( function_exists('add_submenu_page') ) add_submenu_page('plugins.php', __('Akismet Configuration'), __('Akismet Configuration'), 'manage_options', 'akismet-key-config', 'akismet_conf'); +} + +function akismet_plugin_action_links( $links, $file ) { + if ( $file == plugin_basename( dirname(__FILE__).'/akismet.php' ) ) { + $links[] = ''.__('Settings').''; + } + return $links; } +add_filter( 'plugin_action_links', 'akismet_plugin_action_links', 10, 2 ); + function akismet_conf() { global $akismet_nonce, $wpcom_api_key; @@ -46,11 +59,15 @@ function akismet_conf() { check_admin_referer( $akismet_nonce ); $key = preg_replace( '/[^a-h0-9]/i', '', $_POST['key'] ); + $home_url = parse_url( get_bloginfo('url') ); if ( empty($key) ) { $key_status = 'empty'; $ms[] = 'new_key_empty'; delete_option('wordpress_api_key'); + } elseif ( empty($home_url['host']) ) { + $key_status = 'empty'; + $ms[] = 'bad_home_url'; } else { $key_status = akismet_verify_key( $key ); } @@ -68,6 +85,12 @@ function akismet_conf() { update_option( 'akismet_discard_month', 'true' ); else update_option( 'akismet_discard_month', 'false' ); + + if ( isset( $_POST['akismet_show_user_comments_approved'] ) ) + update_option( 'akismet_show_user_comments_approved', 'true' ); + else + update_option( 'akismet_show_user_comments_approved', 'false' ); + } elseif ( isset($_POST['check']) ) { akismet_get_server_connectivity(0); } @@ -97,19 +120,24 @@ function akismet_conf() { $messages = array( 'new_key_empty' => array('color' => 'aa0', 'text' => __('Your key has been cleared.')), - 'new_key_valid' => array('color' => '2d2', 'text' => __('Your key has been verified. Happy blogging!')), - 'new_key_invalid' => array('color' => 'd22', 'text' => __('The key you entered is invalid. Please double-check it.')), - 'new_key_failed' => array('color' => 'd22', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')), - 'no_connection' => array('color' => 'd22', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')), + 'new_key_valid' => array('color' => '4AB915', 'text' => __('Your key has been verified. Happy blogging!')), + 'new_key_invalid' => array('color' => '888', 'text' => __('The key you entered is invalid. Please double-check it.')), + 'new_key_failed' => array('color' => '888', 'text' => __('The key you entered could not be verified because a connection to akismet.com could not be established. Please check your server configuration.')), + 'no_connection' => array('color' => '888', 'text' => __('There was a problem connecting to the Akismet server. Please check your server configuration.')), 'key_empty' => array('color' => 'aa0', 'text' => sprintf(__('Please enter an API key. (Get your key.)'), 'http://akismet.com/get/')), - 'key_valid' => array('color' => '2d2', 'text' => __('This key is valid.')), - 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.'))); + 'key_valid' => array('color' => '4AB915', 'text' => __('This key is valid.')), + 'key_failed' => array('color' => 'aa0', 'text' => __('The key below was previously validated but a connection to akismet.com can not be established at this time. Please check your server configuration.')), + 'bad_home_url' => array('color' => '888', 'text' => sprintf( __('Your WordPress home URL %s is invalid. Please fix the home option.'), esc_html( get_bloginfo('url') ), admin_url('options.php#home') ) ), + ); ?>

+ +

Sign up success! Please check your email for your Akismet API Key and enter it below.' ); ?>

+
@@ -126,7 +154,8 @@ function akismet_conf() { -

+

+

@@ -136,7 +165,7 @@ function akismet_conf() { -

+

fsockopen or gethostbynamel functions. Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet\'s system requirements.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

0 ) { ?> -

+

Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet and firewalls.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

-

+

-

+

Akismet cannot work correctly until this is fixed. Please contact your web host or firewall administrator and give them this information about Akismet and firewalls.'), 'http://blog.akismet.com/akismet-hosting-faq/'); ?>

$status ) { - $color = ( $status ? '#2d2' : '#d22'); + $color = ( $status ? '#4AB915' : '#888'); ?> - +

+

Click here to confirm that Akismet.com is up.'), 'http://status.automattic.com/9931/136079/Akismet-API', 'http://status.automattic.com/9931/136079/Akismet-API' ); ?>

@@ -206,11 +236,8 @@ function akismet_stats_script() { ?>