From 735080c7fcae8c2fa8e8d8bf9183dc3b64c9f685 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 6 Mar 2010 21:01:58 +0000 Subject: [PATCH] Add nag for missing authentication keys in network.php. See #11816 git-svn-id: https://develop.svn.wordpress.org/trunk@13614 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/network.php | 34 +++++++++++++++++++++++++++++++++- wp-admin/setup-config.php | 6 ++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/wp-admin/network.php b/wp-admin/network.php index e1a91d0a15..cf5deb9dc7 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -179,7 +179,38 @@ $base = ''; define( 'DOMAIN_CURRENT_SITE', '' ); define( 'PATH_CURRENT_SITE', '' ); define( 'SITE_ID_CURRENT_SITE', 1 ); -define( 'BLOG_ID_CURRENT_SITE', 1 ); +define( 'BLOG_ID_CURRENT_SITE', 1 ); + '', 'SECURE_AUTH_KEY' => '', 'LOGGED_IN_KEY' => '', 'NONCE_KEY' => '', 'AUTH_SALT' => '', 'SECURE_AUTH_SALT' => '', 'LOGGED_IN_SALT' => '', 'NONCE_SALT' => '' ); + foreach ( $keys_salts as $c => $v ) { + if ( defined( $c ) ) + unset( $keys_salts[ $c ] ); + } + if ( ! empty( $keys_salts ) ) { + $from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); + if ( is_wp_error( $from_api ) ) { + foreach ( $keys_salts as $c => $v ) { + $keys_salts[ $c ] = wp_generate_password( 64, true, true ); + } + } else { + $from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) ); + foreach ( $keys_salts as $c => $v ) { + $keys_salts[ $c ] = substr( array_shift( $from_api ), 28, 64 ); + } + } + $num_keys_salts = count( $keys_salts ); +?> +

wp-config.php file.', 'These unique authentication keys are also missing from your wp-config.php file.', $num_keys_salts ); ?>

+ + + +

Once you complete these steps, your network is enabled and configured. Return to Dashboard

$v ) + foreach ( $secret_keys as $k => $v ) { $secret_keys[$k] = substr( $v, 28, 64 ); + } } $key = 0;