Update of /cvsroot/phpslash/phpslash-dev/include/modules/auth
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2977
Modified Files:
slashAuth.class
Log Message:
added psl_passwd() with comments. essentially, it allows to create standard psl passwords or a password with an optional challenge string.
Index: slashAuth.class
===================================================================
RCS file: /cvsroot/phpslash/phpslash-dev/include/modules/auth/slashAuth.class,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** slashAuth.class 18 Oct 2004 17:06:39 -0000 1.5
--- slashAuth.class 29 Oct 2004 17:35:09 -0000 1.6
***************
*** 863,867 ****
}
!
}
?>
--- 863,889 ----
}
! /**
! * PSL password
! *
! * Arranges password in std PSL format
! *
! * @param $username
! * @param $password
! * @param $my_challenge optional challenge to use. If this option is given, then a password in the form "md5(md5(username:password):my_challenge)" will be returned (needed for CR and other types of authentication. Not for normal plain text passwords sent over the wire (i.e., not CR).
! *
! */
! function psl_passwd ($username,$password,$my_challenge="")
! {
! if ( empty($my_challenge) )
! {
! /* We only need a simple password: */
! $pw = md5("$username:$password");
! } else {
! /* Challenged was passed, so we return an encrypted string using this */
! $md5_pw = md5("$username:$password");
! $pw = md5("$md5_pw:$my_challenge");
! }
! return $pw;
! }
}
?>
|