|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| __construct ($options=array()) | |
| getOptions () | |
| setOptions (array $options=array()) | |
| setMessage ($messageString, $messageKey=null) | |
| getHostnameValidator () | |
| setHostnameValidator (Zend_Validate_Hostname $hostnameValidator=null, $allow=Zend_Validate_Hostname::ALLOW_DNS) | |
| validateMxSupported () | |
| getValidateMx () | |
| setValidateMx ($mx) | |
| getDeepMxCheck () | |
| setDeepMxCheck ($deep) | |
| getDomainCheck () | |
| setDomainCheck ($domain=true) | |
| isValid ($value) | |
Data Fields | |
| const | INVALID = 'emailAddressInvalid' |
| const | INVALID_FORMAT = 'emailAddressInvalidFormat' |
| const | INVALID_HOSTNAME = 'emailAddressInvalidHostname' |
| const | INVALID_MX_RECORD = 'emailAddressInvalidMxRecord' |
| const | INVALID_SEGMENT = 'emailAddressInvalidSegment' |
| const | DOT_ATOM = 'emailAddressDotAtom' |
| const | QUOTED_STRING = 'emailAddressQuotedString' |
| const | INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart' |
| const | LENGTH_EXCEEDED = 'emailAddressLengthExceeded' |
Protected Attributes | |
| $_messageTemplates | |
| $_invalidIp | |
| $_messageVariables | |
| $_hostname | |
| $_localPart | |
| $_options | |
Definition at line 38 of file EmailAddress.php.
| __construct | ( | $ | options = array() | ) |
Instantiates hostname validator for local use
The following option keys are supported: 'hostname' => A hostname validator, see Zend_Validate_Hostname 'allow' => Options for the hostname validator, see Zend_Validate_Hostname::ALLOW_* 'mx' => If MX check should be enabled, boolean 'deep' => If a deep MX check should be done, boolean
| array | Zend_Config | $options | OPTIONAL |
Definition at line 130 of file EmailAddress.php.

| getDeepMxCheck | ( | ) |
| getDomainCheck | ( | ) |
Returns the set hostname validator
Definition at line 227 of file EmailAddress.php.
| getOptions | ( | ) |
| getValidateMx | ( | ) |
| isValid | ( | $ | value | ) |
Defined by Zend_Validate_Interface
Returns true if and only if $value is a valid email address according to RFC2822
RFC2822 http://www.columbia.edu/kermit/ascii.html US-ASCII characters string $value boolean
Implements Zend_Validate_Interface.
Definition at line 518 of file EmailAddress.php.

| setDeepMxCheck | ( | $ | deep | ) |
Set whether we check MX record should be a deep validation
| boolean | $deep | Set deep to true to perform a deep validation process for MX records |
Definition at line 305 of file EmailAddress.php.

| setDomainCheck | ( | $ | domain = true | ) |
Sets if the domain should also be checked or only the local part of the email address
| boolean | $domain |
Definition at line 328 of file EmailAddress.php.

| setHostnameValidator | ( | Zend_Validate_Hostname $ | hostnameValidator = null, |
| $ | allow = Zend_Validate_Hostname::ALLOW_DNS |
||
| ) |
| Zend_Validate_Hostname | $hostnameValidator | OPTIONAL |
| int | $allow | OPTIONAL |
Definition at line 237 of file EmailAddress.php.

| setMessage | ( | $ | messageString, |
| $ | messageKey = null |
||
| ) |
Sets the validation failure message template for a particular key Adds the ability to set messages to the attached hostname validator
| string | $messageString | |
| string | $messageKey | OPTIONAL |
| Zend_Validate_Exception |
Reimplemented from Zend_Validate_Abstract.
Definition at line 206 of file EmailAddress.php.
| setOptions | ( | array $ | options = array() | ) |
Set options for the email validator
| array | $options |
Definition at line 168 of file EmailAddress.php.


| setValidateMx | ( | $ | mx | ) |
Set whether we check for a valid MX record via DNS
This only applies when DNS hostnames are validated
| boolean | $mx | Set allowed to true to validate for MX records, and false to not validate them |
Definition at line 278 of file EmailAddress.php.


Whether MX checking via getmxrr is supported or not
This currently only works on UNIX systems
Definition at line 255 of file EmailAddress.php.

$_hostname [protected] |
Definition at line 100 of file EmailAddress.php.
$_invalidIp [protected] |
array( '0' => '0.0.0.0/8', '10' => '10.0.0.0/8', '127' => '127.0.0.0/8', '128' => '128.0.0.0/16', '169' => '169.254.0.0/16', '172' => '172.16.0.0/12', '191' => '191.255.0.0/16', '192' => array( '192.0.0.0/24', '192.0.2.0/24', '192.88.99.0/24', '192.168.0.0/16' ), '198' => '198.18.0.0/15', '223' => '223.255.255.0/24', '224' => '224.0.0.0/4', '240' => '240.0.0.0/4' )
Definition at line 69 of file EmailAddress.php.
$_localPart [protected] |
Definition at line 105 of file EmailAddress.php.
$_messageTemplates [protected] |
array( self::INVALID => "Invalid type given, value should be a string", self::INVALID_FORMAT => "'%value%' is no valid email address in the basic format local-part@hostname", self::INVALID_HOSTNAME => "'%hostname%' is no valid hostname for email address '%value%'", self::INVALID_MX_RECORD => "'%hostname%' does not appear to have a valid MX record for the email address '%value%'", self::INVALID_SEGMENT => "'%hostname%' is not in a routable network segment. The email address '%value%' should not be resolved from public network.", self::DOT_ATOM => "'%localPart%' can not be matched against dot-atom format", self::QUOTED_STRING => "'%localPart%' can not be matched against quoted-string format", self::INVALID_LOCAL_PART => "'%localPart%' is no valid local part for email address '%value%'", self::LENGTH_EXCEEDED => "'%value%' exceeds the allowed length", )
Reimplemented from Zend_Validate_Abstract.
Definition at line 53 of file EmailAddress.php.
$_messageVariables [protected] |
array( 'hostname' => '_hostname', 'localPart' => '_localPart' )
Reimplemented from Zend_Validate_Abstract.
Definition at line 92 of file EmailAddress.php.
$_options [protected] |
array( 'mx' => false, 'deep' => false, 'domain' => true, 'allow' => Zend_Validate_Hostname::ALLOW_DNS, 'hostname' => null )
Internal options array
Definition at line 110 of file EmailAddress.php.
| const DOT_ATOM = 'emailAddressDotAtom' |
Definition at line 45 of file EmailAddress.php.
| const INVALID = 'emailAddressInvalid' |
Definition at line 40 of file EmailAddress.php.
| const INVALID_FORMAT = 'emailAddressInvalidFormat' |
Definition at line 41 of file EmailAddress.php.
| const INVALID_HOSTNAME = 'emailAddressInvalidHostname' |
Definition at line 42 of file EmailAddress.php.
| const INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart' |
Definition at line 47 of file EmailAddress.php.
| const INVALID_MX_RECORD = 'emailAddressInvalidMxRecord' |
Definition at line 43 of file EmailAddress.php.
| const INVALID_SEGMENT = 'emailAddressInvalidSegment' |
Definition at line 44 of file EmailAddress.php.
| const LENGTH_EXCEEDED = 'emailAddressLengthExceeded' |
Definition at line 48 of file EmailAddress.php.
| const QUOTED_STRING = 'emailAddressQuotedString' |
Definition at line 46 of file EmailAddress.php.