In joomla registration, email is required field. In some case, we want user have right to enter email or not, we have no config field to choose. It 's the reason why we have to change some code of joomla.
If you want user can register with no required email field, there are 2 step:
1. go to library/joomla/database/table/user.php
Go to line 155 and delete:
if ((trim($this->email) == "") || ! JMailHelper::isEmailAddress($this->email) ) {
$this->setError( JText::_( 'WARNREG_MAIL' ) );
return false;
}
Go to line 182 and delete:
// check for existing email
$query = 'SELECT id'
. ' FROM #__users '
. ' WHERE email = '. $this->_db->Quote($this->email)
. ' AND id != '. (int) $this->id
;
$this->_db->setQuery( $query );
$xid = intval( $this->_db->loadResult() );
if ($xid && $xid != intval( $this->id )) {
$this->setError( JText::_( 'WARNREG_EMAIL_INUSE' ) );
return false;
}
2. Go to database by phpadmin or whatever
- Check the email field in jos_users that can insert null field
- delete the unique key of email field
Everything 's done. Hope that help!
Responses
0 Respones to "Hack joomla core - Registration without email"
Post a Comment