[ic] Email and Unique Account settings
Davor Ocelic
docelic at spinlocksolutions.com
Mon Nov 26 08:49:23 EST 2007
On Sun, Nov 25, 2007 at 06:19:09PM -0600, EEUL Support wrote:
> I have gone though several dozen old messages using the search feature
> and I am still at a loss figuring out how the eliminate people creating
> duplicate accounts via checking for a unique email address.
>
> Can someone give me a simple set of instructions for modifying
> new_account.html or another area of IC to check the email address
> against UserDB.
Hi Brian,
Here's what I do. It's a bit more elaborate and there are more ways
to go about it, but in my setup:
1) I modify form profile to require that already_registered variable is
false (already_registered=false).
2) I have a function that does a query on the database looking for
email, and if it finds it, it sets already_registered to 1 (so that
the form validation will fail), and it sets email error to the
appropriate message.
Something like this:
In the profile I add:
&perl $Tag->check_rgdata;
already_registered=false
And then check_rgdata usertag, among other things, does this:
$sql = "select email from userdb where email = '$email'";
$Tag->query({ sql => $sql, hashref => 'check_rgdata_results_fnc' });
$ptrfnc = $Vend::Interpolate::Tmp->{check_rgdata_results_fnc};
if ($ptrfnc and @$ptrfnc) {
$Tag->error({
name => 'email',
overwrite => 1,
set => "Already registered email"
});
$CGI->{already_registered} = 1;
return 0;
}
return 1;
Cya,
-doc
More information about the interchange-users
mailing list