summaryrefslogtreecommitdiffstats
path: root/wp-admin/includes
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-04-22 14:51:22 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-04-22 14:51:22 +0000
commit246f80fc39200b7a603de15c31e9636a580e3d3c (patch)
tree5b07f9a6b8c0f8d9aa09b601e35ea215913ef23f /wp-admin/includes
parent7a92352103d64e1031bf02d92918d51183eec62d (diff)
downloadwordpress-mu-246f80fc39200b7a603de15c31e9636a580e3d3c.tar.gz
wordpress-mu-246f80fc39200b7a603de15c31e9636a580e3d3c.tar.xz
wordpress-mu-246f80fc39200b7a603de15c31e9636a580e3d3c.zip
Warn the site admin if SECRET_SALT and SECRET_SALT are not defined
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1254 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/includes')
-rw-r--r--wp-admin/includes/mu.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/wp-admin/includes/mu.php b/wp-admin/includes/mu.php
index 1579085..9a57663 100644
--- a/wp-admin/includes/mu.php
+++ b/wp-admin/includes/mu.php
@@ -639,4 +639,20 @@ EOF;
}
add_action( 'media_buttons', 'mu_media_buttons' );
remove_action( 'media_buttons', 'media_buttons' );
+
+/* Warn the admin if SECRET SALT information is missing from wp-config.php */
+function secret_salt_warning() {
+ if( !is_site_admin() )
+ return;
+ if( !defined( 'SECRET_KEY' ) || !defined( 'SECRET_SALT' ) ) {
+ $salt1 = wp_generate_password() . wp_generate_password();
+ $salt2 = wp_generate_password() . wp_generate_password();
+ $msg = sprintf( __( 'Warning! You must define SECRET_KEY and SECRET_SALT in <strong>%swp-config.php</strong><br />Please add the following code before the line, <code>/* That\'s all, stop editing! Happy blogging. */</code>' ), ABSPATH );
+ $msg .= "<blockquote>define('SECRET_KEY', '$salt1');<br />define('SECRET_SALT', '$salt2');</blockquote>";
+
+ echo "<div id='update-nag'>$msg</div>";
+ }
+}
+add_action( 'admin_notices', 'secret_salt_warning' );
+
?>