CB User registration "Require unique Email"

13 years 3 months ago #152924 by skip2753
I'm running joomla 1.5.21 and CB 1.3.1 and I can't find the global setting or CMS feature that is causing CB to enforce unique email addresses. I want to be able to have users that share email. I ran into this issue this morning when I was running CB 1.2.3 so I upgraded to CB 1.3.1 thinking it would solve my problem but alas, no joy.

tia,
-skip

Please Log in to join the conversation.

13 years 3 months ago #152930 by nant

skip2753 wrote: I'm running joomla 1.5.21 and CB 1.3.1 and I can't find the global setting or CMS feature that is causing CB to enforce unique email addresses. I want to be able to have users that share email. I ran into this issue this morning when I was running CB 1.2.3 so I upgraded to CB 1.3.1 thinking it would solve my problem but alas, no joy.

tia,
-skip


This is a Joomla issue - it requires unique email addresses and usernames.

Please Log in to join the conversation.

13 years 3 months ago #152937 by skip2753

nant wrote:
This is a Joomla issue - it requires unique email addresses and usernames.


Thanks for the quick reply! So when the help text in the CB > Configuration > Registration Tab says:

"If "yes", users cannot share the same email address. This is a CMS global setting for the site, or a CMS feature. CB adapts automatically to this setting/feature."

Does that mean that while the version of Joomla/Mambo/other_CMS that I am using does not support shared (non-unique) email but there may be others that do? Or have I just not found the switch in Joomla 1.5.21 (I guess I'm now posting off topic big time!)

Thanks for your help!
-skip

Please Log in to join the conversation.

13 years 3 months ago #152944 by nant
CB works on Joomla 1.0 as well and Joomla 1.0 does not need to have unique email addresses.

That why the setting in CB is worded that way.

Please Log in to join the conversation.

13 years 3 months ago #152984 by alexchristie
Replied by alexchristie on topic Re: CB User registration "Require unique Email"
In their wisdom, the Joomla experts have decided that this is not something that people should be able to do.

What you want is possible, but it requires a "hack".

For Joomla 1.5, find the file: libraries/joomla/database/table/user.php

In this file, you will find the following code starting at line 182:

// 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;
}
/

Replace the above with the following code:

// 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;
*}
*/

I have done this on my site, it works fine.
The following user(s) said Thank You: heyai

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.199 seconds

Facebook Twitter LinkedIn