From 903ae8a581fac1e6917fc3e31d2ad8fb91df80c3 Mon Sep 17 00:00:00 2001 From: ctrlaltca <> Date: Thu, 12 Jul 2012 11:21:01 +0000 Subject: standardize the use of unix eol; use svn properties to enforce native eol --- .../Web/UI/WebControls/TEmailAddressValidator.php | 192 ++++++++++----------- 1 file changed, 96 insertions(+), 96 deletions(-) (limited to 'framework/Web/UI/WebControls/TEmailAddressValidator.php') diff --git a/framework/Web/UI/WebControls/TEmailAddressValidator.php b/framework/Web/UI/WebControls/TEmailAddressValidator.php index a198ffc4..b0b51208 100644 --- a/framework/Web/UI/WebControls/TEmailAddressValidator.php +++ b/framework/Web/UI/WebControls/TEmailAddressValidator.php @@ -1,97 +1,97 @@ - - * @link http://www.pradosoft.com/ + + * @link http://www.pradosoft.com/ * @copyright Copyright © 2005-2012 PradoSoft - * @license http://www.pradosoft.com/license/ - * @version $Id$ - * @package System.Web.UI.WebControls - */ - -/** - * Using TRegularExpressionValidator class - */ -Prado::using('System.Web.UI.WebControls.TRegularExpressionValidator'); - -/** - * TEmailAddressValidator class - * - * TEmailAddressValidator validates whether the value of an associated - * input component is a valid email address. If {@link getCheckMXRecord CheckMXRecord} - * is true, it will check MX record for the email adress, provided - * checkdnsrr() is available in the installed PHP. - * - * @author Qiang Xue - * @version $Id$ - * @package System.Web.UI.WebControls - * @since 3.0 - */ -class TEmailAddressValidator extends TRegularExpressionValidator -{ - /** - * Regular expression used to validate the email address - */ - const EMAIL_REGEXP="\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; - - /** - * Gets the name of the javascript class responsible for performing validation for this control. - * This method overrides the parent implementation. - * @return string the javascript class name - */ - protected function getClientClassName() - { - return 'Prado.WebUI.TEmailAddressValidator'; - } - - /** - * @return string the regular expression that determines the pattern used to validate a field. - */ - public function getRegularExpression() - { - $regex=parent::getRegularExpression(); - return $regex===''?self::EMAIL_REGEXP:$regex; - } - - /** - * Returns an array of javascript validator options. - * @return array javascript validator options. - */ - public function evaluateIsValid() - { - $valid=parent::evaluateIsValid(); - if($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) - { - if(($value=$this->getValidationValue($this->getValidationTarget()))!=='') - { - if(($pos=strpos($value,'@'))!==false) - { - $domain=substr($value,$pos+1); - return $domain===''?false:checkdnsrr($domain,'MX'); - } - else - return false; - } - } - return $valid; - } - - /** - * @return boolean whether to check MX record for the email address being validated. Defaults to true. - */ - public function getCheckMXRecord() - { - return $this->getViewState('CheckMXRecord',true); - } - - /** - * @param boolean whether to check MX record for the email address being validated. - * Note, if {@link checkdnsrr} is not available, this check will not be performed. - */ - public function setCheckMXRecord($value) - { - $this->setViewState('CheckMXRecord',TPropertyValue::ensureBoolean($value),true); - } -} - + * @license http://www.pradosoft.com/license/ + * @version $Id$ + * @package System.Web.UI.WebControls + */ + +/** + * Using TRegularExpressionValidator class + */ +Prado::using('System.Web.UI.WebControls.TRegularExpressionValidator'); + +/** + * TEmailAddressValidator class + * + * TEmailAddressValidator validates whether the value of an associated + * input component is a valid email address. If {@link getCheckMXRecord CheckMXRecord} + * is true, it will check MX record for the email adress, provided + * checkdnsrr() is available in the installed PHP. + * + * @author Qiang Xue + * @version $Id$ + * @package System.Web.UI.WebControls + * @since 3.0 + */ +class TEmailAddressValidator extends TRegularExpressionValidator +{ + /** + * Regular expression used to validate the email address + */ + const EMAIL_REGEXP="\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; + + /** + * Gets the name of the javascript class responsible for performing validation for this control. + * This method overrides the parent implementation. + * @return string the javascript class name + */ + protected function getClientClassName() + { + return 'Prado.WebUI.TEmailAddressValidator'; + } + + /** + * @return string the regular expression that determines the pattern used to validate a field. + */ + public function getRegularExpression() + { + $regex=parent::getRegularExpression(); + return $regex===''?self::EMAIL_REGEXP:$regex; + } + + /** + * Returns an array of javascript validator options. + * @return array javascript validator options. + */ + public function evaluateIsValid() + { + $valid=parent::evaluateIsValid(); + if($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) + { + if(($value=$this->getValidationValue($this->getValidationTarget()))!=='') + { + if(($pos=strpos($value,'@'))!==false) + { + $domain=substr($value,$pos+1); + return $domain===''?false:checkdnsrr($domain,'MX'); + } + else + return false; + } + } + return $valid; + } + + /** + * @return boolean whether to check MX record for the email address being validated. Defaults to true. + */ + public function getCheckMXRecord() + { + return $this->getViewState('CheckMXRecord',true); + } + + /** + * @param boolean whether to check MX record for the email address being validated. + * Note, if {@link checkdnsrr} is not available, this check will not be performed. + */ + public function setCheckMXRecord($value) + { + $this->setViewState('CheckMXRecord',TPropertyValue::ensureBoolean($value),true); + } +} + -- cgit v1.2.3