summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-02 16:58:00 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-02 16:58:00 +0000
commit9a3b52a00835411618a6ca1b3859c3121b836e8d (patch)
tree1829b93ea69b3b4c28f1d9a61552226fa55f78a7
parent6d572cbe19ffedb5b92d8528798c5683154bb185 (diff)
downloadwordpress-mu-9a3b52a00835411618a6ca1b3859c3121b836e8d.tar.gz
wordpress-mu-9a3b52a00835411618a6ca1b3859c3121b836e8d.tar.xz
wordpress-mu-9a3b52a00835411618a6ca1b3859c3121b836e8d.zip
Added LOGGED_IN KEY and SALT, fixes #670
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1345 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--index-install.php1
-rw-r--r--wp-admin/includes/mu.php14
-rw-r--r--wp-config-sample.php6
3 files changed, 14 insertions, 7 deletions
diff --git a/index-install.php b/index-install.php
index 1a049b6..99c85ed 100644
--- a/index-install.php
+++ b/index-install.php
@@ -339,6 +339,7 @@ function step2() {
break;
case "define('SECRET_K":
case "define('SECRET_S":
+ case "define('LOGGED_I":
fwrite($handle, str_replace('put your unique phrase here', md5( mt_rand() ) . md5( mt_rand() ), $line));
break;
default:
diff --git a/wp-admin/includes/mu.php b/wp-admin/includes/mu.php
index 8d7aa1a..03d6c42 100644
--- a/wp-admin/includes/mu.php
+++ b/wp-admin/includes/mu.php
@@ -631,11 +631,15 @@ remove_action( 'media_buttons', 'media_buttons' );
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>";
+ $secret_keys = array( 'SECRET_KEY', 'SECRET_SALT', 'LOGGED_IN_KEY', 'LOGGED_IN_SALT' );
+ $out = '';
+ foreach( $secret_keys as $key ) {
+ if( !defined( $key ) )
+ $out .= "define( '$key', '" . wp_generate_password() . wp_generate_password() . "' );<br />";
+ }
+ if( $out != '' ) {
+ $msg = sprintf( __( 'Warning! WordPress encrypts user cookies, but you must add the following lines to <strong>%swp-config.php</strong> for it to work properly.<br />Please add the code before the line, <code>/* That\'s all, stop editing! Happy blogging. */</code>' ), ABSPATH );
+ $msg .= "<blockquote>$out</blockquote>";
echo "<div id='update-nag'>$msg</div>";
}
diff --git a/wp-config-sample.php b/wp-config-sample.php
index 11a4d30..72daf8d 100644
--- a/wp-config-sample.php
+++ b/wp-config-sample.php
@@ -13,8 +13,10 @@ $base = 'BASE';
// Change SECRET_KEY to a unique phrase. You won't have to remember it later,
// so make it long and complicated. You can visit http://api.wordpress.org/secret-key/1.0/
// to get a secret key generated for you, or just make something up.
-define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase.
-define('SECRET_SALT', 'put your unique phrase here'); // Change this to a unique phrase.
+define('SECRET_KEY', 'put your unique phrase here'); // Change these to unique phrases.
+define('SECRET_SALT', 'put your unique phrase here');
+define('LOGGED_IN_KEY', 'put your unique phrase here');
+define('LOGGED_IN_SALT', 'put your unique phrase here');
// double check $base
if( $base == 'BASE' )