[ic] [counter] - "key" for email verification

Russ Mann interchange-users@interchange.redhat.com
Mon Apr 1 11:49:01 2002


Hello,

Several other systems use MD5 generated keys for this purpose, and the
beauty of these is that you don't need to check for duplicates.

-R

-----Original Message-----
From: interchange-users-admin@interchange.redhat.com
[mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of
Kevin Walsh
Sent: Thursday, March 28, 2002 7:17 PM
To: interchange-users@interchange.redhat.com
Subject: RE: [ic] [counter]


>
> I've been reading up on the [counter] tag on the IC resource site.
>
> I need a form to auto generate a random 3 digit numerical code and insert
it
> into a database table.  I'd like the numbers to be very speratic such as
> "784" and the next one might be "239", etc.
>
> More info on my appliation:
>
> New customers will receive this "key" in their email to verify they
entered
> a valid email address.  The last step of the signup process will ask them
> for this key.
>
> Can someone provide an example using this tag?  I don't see anything in
the
> archives relating to this topic.. thanks.
>
The [counter] tag won't generate random numbers for you.

You could create a UserTag like this:

    UserTag generate_key Order length
    UserTag generate_key Routine <<EOR
    sub {
        my $length = shift || 1;
        my $out;

        $out .= int(rand(10)) for (1 .. $length);
        $out;
    }
    EOR

...and call it like this: [generate-key length=3]

Once you have the number, you can put it into the database table
in any way you see fit.

--
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/
_______________________________________________
interchange-users mailing list
interchange-users@interchange.redhat.com
http://interchange.redhat.com/mailman/listinfo/interchange-users