Guest User

Untitled

a guest
Jul 28th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <?php
  2.  
  3. @mysql_connect( "localhost", "fku", "fku" ) or die( "Couldn't connect!" );
  4. @mysql_select_db( "fku" ) or die( "Couldn't select DB!" );
  5.  
  6.  
  7.  
  8. if ( isset($_GET["user"] ) && isset($_GET["pass"] ) )
  9. {
  10. $Username = $_GET["user"];
  11. $Password = $_GET["pass"];
  12.  
  13. if ( Is_User_Member($Username, $Password) )
  14. {
  15. $groupSQL = mysql_query( "SELECT `usergroupid` FROM `user` WHERE `username` = '$Username'" );
  16. $dumpTable = mysql_fetch_assoc( $groupSQL );
  17. $groups = $dumpTable[ 'usergroupid' ];
  18.  
  19. if( $groups == 6 )
  20. echo "Admin";
  21. else if( $groups == 7 )
  22. echo "Moderators";
  23. else if( $groups == 2 )
  24. echo "Registered";
  25. else if( $groups == 5 )
  26. echo "Super Moderators";
  27. else if( $groups == 1 )
  28. echo "UnRegistered";
  29. else if( $groups == 3 )
  30. echo "Awaiting Email";
  31. else if( $groups == 9 )
  32. echo "Premium";
  33. else if( $groups == 10 )
  34. echo "Graphics";
  35. else if( $groups == 8 )
  36. Die("");
  37. else
  38. echo "Unknown User Group ID";
  39.  
  40.  
  41. }
  42. }
  43.  
  44. function Is_User_Member( $username, $password )
  45. {
  46. if ( $username !== NULL && $password !== NULL )
  47. {
  48. $query = sprintf("SELECT `password`,`salt` FROM `user` WHERE `username`='%s'", $username);
  49. $result = mysql_query($query);
  50.  
  51. while ( $array = mysql_fetch_assoc($result) )
  52. {
  53. $vBpass = $array[ 'password' ];
  54. $vBsalt = $array[ 'salt' ];
  55. }
  56.  
  57. $hashedPass = md5(md5($password) . $vBsalt);
  58.  
  59. if ( $hashedPass == $vBpass )
  60. return true;
  61. else
  62. return false;
  63. }
  64. }
  65.  
  66. ?>
Add Comment
Please, Sign In to add comment