Re: How to use DB functions while doing a create?

[prev] [thread] [next] [Date index for 2005/01/11]

From: Sean Davis
Subject: Re: How to use DB functions while doing a create?
Date: 11:05 on 11 Jan 2005
Daniel,

Another way to accomplish something similar would be to use crypt (see 
perldoc -f crypt) on the entry prior to storage.  Crypt is only 
one-way, so to check a password against it, you need to crypt the 
password you are checking and then compare both the crypted password 
from the database (there is no inflate for crypt) and the crypted entry 
from the user.  If they match, then you have authentication.  An 
advantage of using crypt is that it is not database dependent and is 
also available at the "system" level (i.e., it is somewhat standard).

Sean

On Jan 11, 2005, at 5:14 AM, <Daniel.Brunkhorst@xxxxxxxx.xx> wrote:

>
> Dear list,
>
> MySQL provides a function called "password" to store passwords 
> encrypted
> in the DB. I was wondering how I could use that while using Class::DBI
> and its create method.
>
> Here's what I do now:
> my $dbh = MyClass->db_Main();
> $dbh->do( "INSERT INTO users VALUES ( $id, $name, password( '$pwd' ) "
> );
>
> Is there a way to better integrate this with Class::DBI?
>
> Thanks,
> Daniel.

Re: How to use DB functions while doing a create?
Sean Davis 11:05 on 11 Jan 2005

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52