Search for duplicate email address at sign up time

Wish to see a specific feature/change in future releases? Feel free to post it here, and if it gets enough "likes", we'd definitely include it in future releases!
Post Reply
User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Search for duplicate email address at sign up time

Post by shasta59 » 2013-06-05 21:10

I have encountered an issue where two members used the same email address. It was a common one for both of them. But they both needed their own account.

The problem occurred when one requested to reset their password. They used the email address. The system sent the email out but it presented an issue when the link was clicked it returned an error.

"Invalid username or password. No matching user associated with that email address."

I have resolved this by coding to check to see if the email address is a duplicate, the same way the user name is checked to insure it is not a duplicate. If it is a duplicate email address the person attempting to sign up is advised the email address is already in use. They are told to use another email address. They can then contact the administrator to have it checked etc.

This may be something to put in a future version. Email address duplication checking.

I have also added coding to check the ip address they are making the request from for a password change. Since I record all ip addresses of anyone who signs in it checks this in a table to see if it matches the same geographic region of previous login's by this person making the request. (The program looks up and adds to the table the geographic region they are accessing from.)

If it does not match the same geographic region they are sent a message to state they will be personally contacted by the admin to verify due to inconsistencies in their request. A bit paranoid but it is what the client wanted as he could not see any reason for anyone outside the 'home base area' to be asking for a reset request.

Alan
Calgary, Alberta, Canada - Using Appgini 5.50 -

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Search for duplicate email address at sign up time

Post by a.gneady » 2013-06-20 16:03

I've added unique email check during registration/profile update to my checklist for the next release .. thanks for the suggestion!
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
shasta59
AppGini Super Hero
AppGini Super Hero
Posts: 231
Joined: 2013-01-08 19:40
Location: Calgary, Alberta, Canada

Re: Search for duplicate email address at sign up time

Post by shasta59 » 2015-02-16 02:58

Ahmed

I cannot find the code to check for duplicate email addresses in 5.31. It also does not appear to do that when a new member signs up. They can have more than one person using the same email address. This does cause some issues. Can you advise why it may not be working now? I was able to create two new members with the same email address.
Re: Search for duplicate email address at sign up time
Post by a.gneady » 20 Jun 2013, 09:03

I've added unique email check during registration/profile update to my checklist for the next release .. thanks for the suggestion!
Calgary, Alberta, Canada - Using Appgini 5.50 -

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Search for duplicate email address at sign up time

Post by a.gneady » 2015-02-17 04:46

That check hasn't been implemented yet :/ Sorry for that. It'll be included in the next fix.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Search for duplicate email address at sign up time

Post by a.gneady » 2015-02-17 04:50

For now, you could open the generated membership_signup.php file in a text editor, find this code block:

Code: Select all

		if(!$email){
			echo error_message($Translation['email invalid']);
			exit;
		}
Add the following check below it:

Code: Select all

		if(sqlValue("select count(1) from membership_users where lcase(email)='$email'")){
			echo error_message('This email is already registered.');
			exit;
		}
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

sathukorala
AppGini Super Hero
AppGini Super Hero
Posts: 121
Joined: 2020-02-16 16:29

Re: Search for duplicate email address at sign up time

Post by sathukorala » 2021-04-09 11:48

a.gneady wrote:
2015-02-17 04:50
For now, you could open the generated membership_signup.php file in a text editor, find this code block:

Code: Select all

		if(!$email){
			echo error_message($Translation['email invalid']);
			exit;
		}
Add the following check below it:

Code: Select all

		if(sqlValue("select count(1) from membership_users where lcase(email)='$email'")){
			echo error_message('This email is already registered.');
			exit;
		}
Ahmed this method is not working anymore.
Can you implement it properly or show us a dir=fferent way, please?

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: Search for duplicate email address at sign up time

Post by a.gneady » 2021-04-13 13:23

Hmm ... I can't see why it won't work :roll:
There has been no change in the structure of the membership_users table in the new release. But you could try a more explicit check like this:

Code: Select all

if(sqlValue("select count(1) from membership_users where lcase(email)='$email'") > 0) {
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Post Reply