Joomla Custom Server Side Va
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Validate Data | |
*/ | |
function validate($form, $data,$group=null){ | |
$status=true; | |
if(!$this->EmailValidate($data['email'])){ | |
$status=false; | |
} | |
if($status){ | |
return $data; | |
}else{ | |
return false; | |
} | |
} | |
/** | |
* Validate Invidation Email | |
*/ | |
function EmailValidate($email){ | |
$db=JFactory::getDBO(); | |
$db->setQuery('SELECT * FROM #__users WHERE `email`='.$db->quote($email)); | |
$db->query(); | |
$num_rows = $db->getNumRows(); | |
if($num_rows>0){ | |
$this->setError("$email this email is already registered with us"); | |
return false; | |
}else{ | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment