Changeset 2366 for trunk/bb-includes/functions.bb-pluggable.php
- Timestamp:
- 08/17/2009 01:37:38 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/bb-includes/functions.bb-pluggable.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bb-includes/functions.bb-pluggable.php
r2318 r2366 369 369 endif; 370 370 371 function _bb_get_key( $key, $default_key = false ) { 372 if ( !$default_key ) { 373 global $bb_default_secret_key; 374 $default_key = $bb_default_secret_key; 375 } 376 377 if ( defined( $key ) && '' != constant( $key ) && $default_key != constant( $key ) ) { 371 function _bb_get_key( $key, $default_key = false ) 372 { 373 global $bb_default_secret_key; 374 375 if ( defined( $key ) && '' != constant( $key ) && $bb_default_secret_key != constant( $key ) ) { 378 376 return constant( $key ); 379 377 } 380 378 381 return $default_key; 382 } 383 384 function _bb_get_salt( $constants, $option = false ) { 379 return ''; 380 } 381 382 function _bb_get_salt( $constants, $option = false ) 383 { 385 384 if ( !is_array( $constants ) ) { 386 385 $constants = array( $constants ); … … 399 398 $salt = bb_get_option( $option ); 400 399 if ( empty( $salt ) ) { 401 $salt = bb_generate_password( );400 $salt = bb_generate_password( 64 ); 402 401 bb_update_option( $option, $salt ); 403 402 } … … 420 419 * @return string Salt value for the given scheme 421 420 */ 422 function bb_salt($scheme = 'auth') { 421 function bb_salt( $scheme = 'auth' ) 422 { 423 // Deprecated 423 424 $secret_key = _bb_get_key( 'BB_SECRET_KEY' ); 424 425 425 426 switch ($scheme) { 426 427 case 'auth': 427 $secret_key = _bb_get_key( 'BB_AUTH_KEY' , $secret_key);428 $secret_key = _bb_get_key( 'BB_AUTH_KEY' ); 428 429 $salt = _bb_get_salt( array( 'BB_AUTH_SALT', 'BB_SECRET_SALT' ) ); 429 430 break; 430 431 431 432 case 'secure_auth': 432 $secret_key = _bb_get_key( 'BB_SECURE_AUTH_KEY' , $secret_key);433 $secret_key = _bb_get_key( 'BB_SECURE_AUTH_KEY' ); 433 434 $salt = _bb_get_salt( 'BB_SECURE_AUTH_SALT' ); 434 435 break; 435 436 436 437 case 'logged_in': 437 $secret_key = _bb_get_key( 'BB_LOGGED_IN_KEY' , $secret_key);438 $secret_key = _bb_get_key( 'BB_LOGGED_IN_KEY' ); 438 439 $salt = _bb_get_salt( 'BB_LOGGED_IN_SALT' ); 439 440 break; 440 441 441 442 case 'nonce': 442 $secret_key = _bb_get_key( 'BB_NONCE_KEY' , $secret_key);443 $secret_key = _bb_get_key( 'BB_NONCE_KEY' ); 443 444 $salt = _bb_get_salt( 'BB_NONCE_SALT' ); 444 445 break;
Note: See TracChangeset
for help on using the changeset viewer.