bb_break_password

The BuddyPress bb break password function.

Description

bb_break_password( $user_id ); 

Parameters (1)

0. $user_id
The user id.

Usage

  1. if ( !function_exists( 'bb_break_password' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php'; 
  3.  
  4. // The user id. 
  5. $user_id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bb_break_password($user_id); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php  
  1. function bb_break_password( $user_id ) { 
  2. global $bbdb; 
  3. $user_id = (int) $user_id; 
  4. if ( !$user = bb_get_user( $user_id ) ) 
  5. return false; 
  6. $secret = substr(bb_hash( 'bb_break_password' ), 0, 13); 
  7. if ( false === strpos( $user->user_pass, '---' ) ) 
  8. return $bbdb->query( $bbdb->prepare( 
  9. "UPDATE $bbdb->users SET user_pass = CONCAT(user_pass, '---', %s) WHERE ID = %d",  
  10. $secret, $user_id 
  11. ) ); 
  12. else 
  13. return true;