note 39952 added to function.crypt
| From: | cas1650 at spam-sucks dot nebrwesleyan dot edu | Date: | Mon, 16 Feb 2004 22:37:06 +0000 |
| Subject: | note 39952 added to function.crypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65236@lists.php.net to get a copy of this message | ||
LDAP stores passwords with a method header in curly brackets before it, so your passwords might look
like this in the database:
{crypt}$1$salt$password
Instead of passing the entire result from LDAP to the crypt() function, crypt() expects the entire
result minus the {crypt} (or {MD5} or whatever) header. So:
$goal = substr($goal, strpos($goal, '$'));
if ($goal == crypt($user_password, $goal)) {
print "Password accepted!";
}
does the right thing.
----
Manual Page -- http://www.php.net/manual/en/function.crypt.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39952
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39952&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39952&report=yes
Search -- http://master.php.net/manage/user-notes.php