Source for file DBMS_FIELD_EMAILADDR.phpclass
Documentation is available at DBMS_FIELD_EMAILADDR.phpclass
* Class file DBMS_FIELD_EMAILADDR.phpclass
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2005 by LVUS
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* Class DBMS_FIELD_EMAILADDR
* @project Open CSP-Management
* @author Peter Krebs <p.krebs@lvus.at>
* @copyright (c) 2002-2005 by LVUS
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
// ###########################################################
// OBJECT (CONST) VAR DECLARATION
// ###########################################################
* @var string $className Label of the class
* @var string $noAddrErrMsg error message if not a valid email address
var $noAddrErrMsg =
"Ihre Eingabe ist keine gltige E-Mail Adresse";
* @var boolean $dnsCheckDomain
* @var string $noMxErrMsg error message if no mx server was found for the domain
var $noMxErrMsg =
"Es konnte kein Mailserver fr diese Adresse gefunden werden";
* source file of the class
* (without $GLOBALS['PROJECT']['PATH']
* @var string $classSrcFile
// ###########################################################
// OBJECT SETTINGS METHODS
// ###########################################################
* returns an array of field to bie shown in the edit form
* by using editTbl_echoForm
* the array is in the form:
* [FLDLAB] (complete html code with <td></td>)
* [FLDVAL] (complete html code with <td></td>)
* [FLDTIT] (title of the label column)
* NOTE as this is not implemented in the whole classTree at the moment ensure all parents use
* editTbl_echoForm() in theire editTblForm otherwise you'll get a mismatch of field order
* @version pk-06-07-17 HIDDEN added to array
* @version pk-06-08-15 FLDTIT added
$a_ret=
parent::editTbl_getFieldEditArr($debug);
$a_ret['VALCHECKS']['FLD_SYNTAXERRMSG']=
array(
'FLDLAB'=>
"Syntax Errormsg",
'FLDTIT'=>
"Fehlermeldung die angezeigt wird wenn die E-Mail Adresse syntaktisch falsch ist (z.B. kein @)"
$a_ret['VALCHECKS']['FLD_DODNSCHECK']=
array(
'FLDLAB'=>
"DNS-Domain-Check",
'FLDTIT'=>
"Prüfen ob es für die Domain einen MX-Eintrag gibt",
'FLDVAL'=>
"<input name=\"dnsCheckDomain\" type=\"checkbox\" value=\"1\"".
($this->dnsCheckDomain ?
" checked " :
"").
"> ja"
$a_ret['VALCHECKS']['FLD_DNSCHECKERRMSG']=
array(
'FLDLAB'=>
"DNS-Check Errormsg",
'FLDTIT'=>
"Fehlermeldung wenn kein DNS Eintrag gefunden wurde",
* save the filed definition form
function save($debug=
False) {
$this->dnsCheckDomain=
((isset
($_POST['dnsCheckDomain']) &&
intval($_POST['dnsCheckDomain'])) ?
True :
False );
* returns the field value if the two fields matches
* @param string $aValue the value
* @param array $err error array
* @param string $arrName name of the array to access fieldsarray gloabl ${$arrName}
* @version pk-05-02-11 included code to check email address from www.php.net/manual/en
function getValue($aValue,&$err,$arrName=
"DBVAL",$debug=
False) {
if ($debug) echo
"<hr><p><b>DBMS_FIELD_EMAILADDR::getValue($aValue,$err,$arrName,$debug)</b> (".
get_class($this).
" | ".
$this->myName.
")</p>";
if ($value=
parent::getValue($aValue,$err,$arrName,$debug)) {
if ($debug) print
("Checking: $value<br>");
if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$", strtolower($value))) {
print
("Format Test: PASSED<br>");
print
("Online host verification Test...<br><br>");
print
("MX Records for: $value<br>");
list
($alias, $domain) =
split("@", $value);
if ($debug) print
("Online host verification Test: PASSED<br><br>Email Status: VALID");
$err[$this->myName]['MSG']=
$value.
$this->dnsCheckDomain.
"<br />Online host verification Test: FAILED";
$a_data[$this->myName]=
$aValue;
} // end class DBMS_FIELD_EMAILADDR
Documentation generated on Thu, 08 Jan 2009 17:41:25 +0100 by phpDocumentor 1.4.0a2