Advertisement
Guest User

Untitled

a guest
Feb 4th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. <?php
  2.  
  3. ########################################
  4. # @Author Xenous(Lucas)
  5. # @Regards to Limez,XenoGFX &
  6. # @others who supported me during dev
  7. ########################################
  8. //define ("XenCMS", true);
  9. if (!defined("XenCMS")) {
  10.  
  11. die('404 Page not found');
  12. }
  13.  
  14. # Security Class #
  15.  
  16. class xSecurity {
  17.  
  18. # Hash for crypting passwords, please don't change it after opening your hotel otherwise you will have to delete alot of users accounts. #
  19.  
  20. public function xCrypt($pass) {
  21.  
  22. global $config;
  23. if($config['user']['hashType'] == 'sha1') {
  24.  
  25. return sha1($pass);
  26. }
  27. else if($config['user']['hashType'] == 'md5') {
  28. return md5($pass);
  29. }
  30. else if($config['user']['hashType'] == 'pCrypt') {
  31. return sha1(md5($pass));
  32. }
  33. else if($config['user']['hashType'] == 'xCrypt') {
  34.  
  35. return sha1(md5($pass . $config['user']['hash']));
  36. }
  37. else if ($config['user']['hashType'] == 'shaHash') {
  38.  
  39. return sha1($pass . $config['user']['hash']);
  40. }
  41. else if($config['user']['hashType'] == 'md5Hash') {
  42.  
  43. return md5($pass . $config['user']['hash']);
  44. }
  45. }
  46. public function xSecure($string) {
  47.  
  48. # Securing using every method I know, just to make sure a skid can't sqli you and ruin your hotel :) #
  49.  
  50. return mysql_real_escape_string(strip_tags(stripslashes(htmlspecialchars(htmlentities($string)))));
  51. }
  52. public function xEscape($string) {
  53.  
  54. return mysql_real_escape_string($string);
  55. }
  56. }
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement