Advertisement
Guest User

Untitled

a guest
May 9th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1.         function AuthUser( $username, $password )
  2.         {
  3.             $username = mysql_escape_string( $username );
  4.             $password = mysql_escape_string( $password );
  5.            
  6.             $query = mysql_query( "SELECT user_pass FROM {$this->prefix}users WHERE user_login = '$username'" );
  7.            
  8.             if( !$query )
  9.                 die( mysql_error() );
  10.  
  11.             if( mysql_num_rows( $query ) >= 1 )
  12.             {
  13.                 $wp_hasher = new PasswordHash(8, TRUE);
  14.                
  15.                 $hash = mysql_result( $query, 0, "user_pass" );
  16.                
  17.                 if( strlen( $hash ) <= 32 )
  18.                 {
  19.                     if( $hash == md5( $password ) )
  20.                     {
  21.                         $hash = $wp_hasher->HashPassword( $password );
  22.                     }
  23.                 }
  24.                
  25.                 return $wp_hasher->CheckPassword( $password, $hash );
  26.             }
  27.                
  28.             return false;
  29.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement