From 56fee292c37e162c03fab9eeadd6a8b9ab85c251 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 4 Sep 2006 19:15:47 +0000 Subject: merge from 3.0 branch till 1387 --- framework/Security/TSecurityManager.php | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'framework/Security/TSecurityManager.php') diff --git a/framework/Security/TSecurityManager.php b/framework/Security/TSecurityManager.php index b0ea4e95..89f3711a 100644 --- a/framework/Security/TSecurityManager.php +++ b/framework/Security/TSecurityManager.php @@ -43,11 +43,9 @@ class TSecurityManager extends TModule { const STATE_VALIDATION_KEY='prado:securitymanager:validationkey'; const STATE_ENCRYPTION_KEY='prado:securitymanager:encryptionkey'; - const STATE_INIT_VECTOR='prado:securitymanager:initvector'; private $_validationKey=null; private $_encryptionKey=null; - private $_initVector=null; - private $_validation='SHA1'; + private $_validation=TSecurityManagerValidationMode::SHA1; private $_encryption='3DES'; /** @@ -127,7 +125,7 @@ class TSecurityManager extends TModule } /** - * @return string hashing algorithm used to generate HMAC. Defaults to 'SHA1'. + * @return TSecurityManagerValidationMode hashing algorithm used to generate HMAC. Defaults to TSecurityManagerValidationMode::SHA1. */ public function getValidation() { @@ -135,11 +133,11 @@ class TSecurityManager extends TModule } /** - * @param string hashing algorithm used to generate HMAC. Valid values include 'SHA1' and 'MD5'. + * @param TSecurityManagerValidationMode hashing algorithm used to generate HMAC. */ public function setValidation($value) { - $this->_validation=TPropertyValue::ensureEnum($value,'SHA1','MD5'); + $this->_validation=TPropertyValue::ensureEnum($value,'TSecurityManagerValidationMode'); } /** @@ -260,4 +258,25 @@ class TSecurityManager extends TModule } } + +/** + * TSecurityManagerValidationMode class. + * TSecurityManagerValidationMode defines the enumerable type for the possible validation modes + * that can be used by {@link TSecurityManager}. + * + * The following enumerable values are defined: + * - MD5: an MD5 hash is generated from the data and used for validation. + * - SHA1: an SHA1 hash is generated from the data and used for validation. + * + * @author Qiang Xue + * @version $Revision: $ $Date: $ + * @package System.Security + * @since 3.0.4 + */ +class TSecurityManagerValidationMode extends TEnumerable +{ + const MD5='MD5'; + const SHA1='SHA1'; +} + ?> \ No newline at end of file -- cgit v1.2.3