Source for file CryptUsernamePasswordAuthNTokens.class.php

Documentation is available at CryptUsernamePasswordAuthNTokens.class.php

  1. <?php
  2. /**
  3. * @package harmoni.osid_v2.agentmanagement.authn_methods
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: CryptUsernamePasswordAuthNTokens.class.php,v 1.5 2005/04/07 19:42:13 adamfranco Exp $
  9. */
  10.  
  11. require_once(dirname(__FILE__)."/UsernamePasswordAuthNTokens.class.php");
  12.  
  13. /**
  14. * This UserNamePasswordAuthNTokens class encrypts the password passed to it using
  15. * the database's PHP's crypt() function.
  16. *
  17. * @package harmoni.osid_v2.agentmanagement.authn_methods
  18. *
  19. * @copyright Copyright &copy; 2005, Middlebury College
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  21. *
  22. * @version $Id: CryptUsernamePasswordAuthNTokens.class.php,v 1.5 2005/04/07 19:42:13 adamfranco Exp $
  23. */
  24. class CryptUsernamePasswordAuthNTokens
  25. extends UsernamePasswordAuthNTokens
  26. {
  27.  
  28. /**
  29. * Initialize this object for a set of authentication tokens. Set the
  30. * password to the encrypted version.
  31. *
  32. * @param mixed $tokens
  33. * @return void
  34. * @access public
  35. * @since 3/1/05
  36. */
  37. function initializeForTokens ( $tokens ) {
  38. ArgumentValidator::validate($tokens, ArrayValidatorRule::getRule());
  39. ArgumentValidator::validate($tokens['username'], StringValidatorRule::getRule());
  40. ArgumentValidator::validate($tokens['password'], StringValidatorRule::getRule());
  41. $this->_tokens = $tokens;
  42. $this->_identifier = $tokens['username'];
  43. $this->_tokens['password'] = crypt($tokens['password'],
  44. $this->_configuration->getProperty('crypt_salt'));
  45. }
  46. }
  47.  
  48. ?>

Documentation generated on Wed, 19 Sep 2007 10:22:28 -0400 by phpDocumentor 1.3.0RC3