I am tring to override Joomlas function to not allow duplicate email addresses. I know the security issues surrounding this but its I will have to have users with the same email address.
My users are mainly older people and often share a household email address.
I have found where it checks this in the JTableUser class in the check method at line 236
// Check for existing email
$query->clear()
->select($this->_db->quoteName('id'))
->from($this->_db->quoteName('#__users'))
->where($this->_db->quoteName('email') . ' = ' . $this->_db->quote($this->email))
->where($this->_db->quoteName('id') . ' != ' . (int) $this->id);
$this->_db->setQuery($query);
$xid = (int) $this->_db->loadResult();
if ($xid && $xid != (int) $this->id)
{
$this->setError(JText::_('JLIB_DATABASE_ERROR_EMAIL_INUSE'));
return false;
}
Is there a way to override this class at a component level?
Thanks
Lee