I am trying to prevent people from signing up using the same email. I have used the above method to use email as the login, but it allows me to signup again using the same email. Actually it udates the information in the db when I use the same email. I would like for an error to be thrown when someone tries this. I thought this function in mysql.inc.php

function check_uniq_login($login, $email='', $pass='', $check_type=0)

called in signup.php would keep someone from using the same email. But again it just overwrites the info in the db. Does anyone have an idea about how to test for unique emails in amember?

Hi all,
I used Miso's modifications and they're working wonderfully (thank you). The only issue is that the user is logged out of their session (since their login was changed). For usability's sake, does anyone know how to restart the session after their username (email) was changed? Thanks much - I can contribute if someone can get me started.

I went with this solution. I found it to work well without having to worry about issues with using the email as their login. I left the system alone but added this code.

plugins/db/mysql/mysql.inc.php

PHP:

//new function to lookup their login name
//this way if they login with email or login it will return the login name
//so we can leave auth alone
function get_login_from_email($email) {
$q = $this->query($s = "SELECT login
FROM {$this->config['prefix']}members
WHERE login='$email' or email='$email'
");
list($login) = mysql_fetch_row($q);
return $login;
}