[ic] Email and Unique Account settings

Brian J. Miller brian at endpoint.com
Tue Nov 27 14:19:36 EST 2007


Davor Ocelic wrote:
> 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
> 

This works but can also be accomplished with a custom order check, so if
you don't need the tag as a regular in page UserTag it is "cleaner" to
make it an order check routine. Custom order checks are documented here:

http://www.icdevgroup.org/interchange-doc-5.2.0/ictemplates.html#User%20defined%20check%20routines

Or I can provide some additional notes I wrote.

Brian J. Miller
End Point Corp.
brian at endpoint.com

> 
> 
> 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
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users



More information about the interchange-users mailing list