bb_fix_password

The BuddyPress bb fix password function.

Description

bb_fix_password( $user_id ); 

Parameters (1)

0. $user_id
The user id.

Usage

  1. if ( !function_exists( 'bb_fix_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_fix_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_fix_password( $user_id ) { 
  2. global $bbdb; 
  3. $user_id = (int) $user_id; 
  4. if ( !$user = bb_get_user( $user_id ) ) 
  5. return false; 
  6. if ( false === strpos( $user->user_pass, '---' ) ) 
  7. return true; 
  8. else 
  9. return $bbdb->query( $bbdb->prepare( 
  10. "UPDATE $bbdb->users SET user_pass = SUBSTRING_INDEX(user_pass, '---', 1) WHERE ID = %d",  
  11. $user_id 
  12. ) );