Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function AuthUser( $username, $password )
- {
- $username = mysql_escape_string( $username );
- $password = mysql_escape_string( $password );
- $query = mysql_query( "SELECT user_pass FROM {$this->prefix}users WHERE user_login = '$username'" );
- if( !$query )
- die( mysql_error() );
- if( mysql_num_rows( $query ) >= 1 )
- {
- $wp_hasher = new PasswordHash(8, TRUE);
- $hash = mysql_result( $query, 0, "user_pass" );
- if( strlen( $hash ) <= 32 )
- {
- if( $hash == md5( $password ) )
- {
- $hash = $wp_hasher->HashPassword( $password );
- }
- }
- return $wp_hasher->CheckPassword( $password, $hash );
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement