[PARTIAL SOLVED] Re: Auth user with postgresql

Giuseppe Tofoni gt0057 at gmail.com
Tue Feb 21 16:45:20 UTC 2012


Hi,

In PHP I used    crypt($pass, CRYPT_STD_DES) and I tried with the
following statement

postgres_query    "SELECT user FROM usertable WHERE user=$user AND
pwd=crypt($pass, substr(pwd, 1, 2))";

but do not work,  some ideas?

Best regards

Giuseppe


2012/2/21 ktm at rice.edu <ktm at rice.edu>:
> On Tue, Feb 21, 2012 at 12:38:15AM +0100, Giuseppe Tofoni wrote:
>> Hi
>> Unfortunately the problem is partially solved.
>>
>> postgres_query   "SELECT user FROM usertable "WHERE user=$user AND
>> pwd=crypt($pass, pwd)";
>>
>> The crypt function in postgresql works correctly only with the
>> password created by the htpasswd program, but do not work with
>> passwords created by PHP.
>>
>> Best regards, and many thanks.
>>
>
> You need to determine what "crypt" is being used in your PHP:
>
> http://php.net/manual/en/function.crypt.php
>
> Once you have that information, you should be able to figure out
> what you will need to do.
>
> Cheers,
> Ken
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list