Changeset 1345

Show
Ignore:
Timestamp:
07/02/08 16:58:00 (2 months ago)
Author:
donncha
Message:

Added LOGGED_IN KEY and SALT, fixes #670

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/index-install.php

    r1302 r1345  
    340340                        case "define('SECRET_K": 
    341341                        case "define('SECRET_S": 
     342                        case "define('LOGGED_I": 
    342343                                fwrite($handle, str_replace('put your unique phrase here', md5( mt_rand() ) . md5( mt_rand() ), $line)); 
    343344                                break; 
  • trunk/wp-admin/includes/mu.php

    r1343 r1345  
    632632        if( !is_site_admin() ) 
    633633                return; 
    634         if( !defined( 'SECRET_KEY' ) || !defined( 'SECRET_SALT' ) ) { 
    635                 $salt1 = wp_generate_password() . wp_generate_password(); 
    636                 $salt2 = wp_generate_password() . wp_generate_password(); 
    637                 $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 ); 
    638                 $msg .= "<blockquote>define('SECRET_KEY', '$salt1');<br />define('SECRET_SALT', '$salt2');</blockquote>"; 
     634        $secret_keys = array( 'SECRET_KEY', 'SECRET_SALT', 'LOGGED_IN_KEY', 'LOGGED_IN_SALT' ); 
     635        $out = ''; 
     636        foreach( $secret_keys as $key ) { 
     637                if( !defined( $key ) ) 
     638                        $out .= "define( '$key', '" . wp_generate_password() . wp_generate_password() . "' );<br />"; 
     639        } 
     640        if( $out != '' ) { 
     641                $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 ); 
     642                $msg .= "<blockquote>$out</blockquote>"; 
    639643 
    640644                echo "<div id='update-nag'>$msg</div>"; 
  • trunk/wp-config-sample.php

    r1328 r1345  
    1414// so make it long and complicated.  You can visit http://api.wordpress.org/secret-key/1.0/ 
    1515// to get a secret key generated for you, or just make something up. 
    16 define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase. 
    17 define('SECRET_SALT', 'put your unique phrase here'); // Change this to a unique phrase. 
     16define('SECRET_KEY', 'put your unique phrase here'); // Change these to unique phrases. 
     17define('SECRET_SALT', 'put your unique phrase here'); 
     18define('LOGGED_IN_KEY', 'put your unique phrase here'); 
     19define('LOGGED_IN_SALT', 'put your unique phrase here'); 
    1820 
    1921// double check $base