Update of /cvsroot/phplib/php-lib/php/auth
In directory usw-pr-cvs1:/tmp/cvs-serv27946
Modified Files:
auth4.inc
Log Message:
Add password_encode function that appears in auth/sql/auth.inc
Index: auth4.inc
===================================================================
RCS file: /cvsroot/phplib/php-lib/php/auth/auth4.inc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** auth4.inc 2001/08/12 04:58:36 1.2
--- auth4.inc 2001/08/29 10:20:16 1.3
***************
*** 256,259 ****
--- 256,285 ----
}
+ ## encode password
+ function password_encode($password, $method, $salt = "") {
+ switch($method) {
+ case "md5":
+ return md5($password);
+ break;
+
+ case "crypt":
+ if ($salt)
+ return crypt($password, $salt);
+ else
+ return crypt($password);
+ break;
+
+ case "base64":
+ return base64_encode($password);
+ break;
+
+ default:
+ return $password;
+ break;
+ }
+
+ return $password;
+ }
+
########################################################################
##
|