Skip to content

Instantly share code, notes, and snippets.

@biswarupadhikari
Created October 23, 2013 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biswarupadhikari/7127138 to your computer and use it in GitHub Desktop.
Save biswarupadhikari/7127138 to your computer and use it in GitHub Desktop.
Joomla Custom Server Side Va
/**
* 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