Posted By

FazzyX on 10/14/09


Tagged

class php password


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

vali29
BrianCoyDesign


Password Class


 / Published in: PHP
 

Object hold md5 and plain password by username

  1. <?php
  2.  
  3. class Password {
  4.  
  5. private $username;
  6. private $md5Password;
  7. private $clearPassword;
  8.  
  9. /**
  10. * Constructor
  11. *
  12. * Sets up the object
  13. *
  14. * @param username, md5Password, clearPassword
  15. * @return [none] none
  16. */
  17. public function __construct($username, $md5Password, $clearPassword) {
  18. $this->Setusername($username);
  19. $this->Setmd5Password($md5Password);
  20. $this->SetclearPassword($clearPassword);
  21. }
  22.  
  23. // Getter
  24. public function Getusername() {
  25. return $this->username;
  26. }
  27.  
  28. public function Getmd5Password() {
  29. return $this->md5Password;
  30. }
  31.  
  32. public function GetclearPassword() {
  33. return $this->clearPassword;
  34. }
  35.  
  36. public function GetObjectVars() {
  37. return get_object_vars($this);
  38. }
  39.  
  40. // Setter
  41. public function Setusername($username) {
  42. $this->username = $username;
  43. }
  44.  
  45. public function Setmd5Password($md5Password) {
  46. $this->md5Password = $md5Password;
  47. }
  48.  
  49. public function SetclearPassword($clearPassword) {
  50. $this->clearPassword = $clearPassword;
  51. }
  52.  
  53. }
  54. ?>

Report this snippet  

You need to login to post a comment.