[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: userPassword?
Hi:
Sure, have a look at this:
#let '$entry' be the result of a ldapsearch (Note you must bind
as an appropiate user so that you can request such
#attribute)
#we get the userPassword
$pass = $entry->get_value('userPassword');
#split the password
$pass =~/^{crypt}(.*)/;
$trim = $1;
#let '$passwd' be the password typed by the user, cypher it
$Result = crypt($passwd, $trim);
$comparePasswd = "{crypt}".$Result;
#real comparison
if("$comparePasswd" eq "$pass"){
return 1;
}
Sorry about my poor english
Good luck
Mehdi Jabal Ameli wrote:
hi,
Can I check user password in Perl script?
(dn->userPassword=="mypass")
Mehdi Jabalameli
jabalameli@ce.sharif.edu <mailto:jabalameli@ce.sharif.edu>
ce.sharif.edu/~jabalameli
--
########################################################################
Raul Caballero Ortega
Tfno: 91-6248787 Grupo de Sistemas Unix
Fax: 91-6249430 Sistemas Centrales
E-mail: rcortega@di.uc3m.es Servicio de Informática
Universidad Carlos III de Madrid
########################################################################
- References:
- userPassword?
- From: "Mehdi Jabal Ameli" <jabalameli@ce.sharif.edu>