Эх сурвалжийг харах

Fixed to use Lithium's new Password class

Michael Francis 14 жил өмнө
parent
commit
1f6b832a67

+ 2 - 1
config/bootstrap/auth.php

@@ -7,6 +7,7 @@ use lithium\core\Libraries;
 use lithium\action\Dispatcher;
 use lithium\net\http\Router;
 use lithium\action\Response;
+use lithium\security\Password;
 
 
 Session::config(array(
@@ -37,7 +38,7 @@ Auth::config(array(
 			        	
 			        	//The password to query is the password from the request
 			        	//hashed with the users stored salt
-			        	$data['password'] = String::hashPassword($data['password'], $salt->salt); 
+			        	$data['password'] = Password::hash($data['password'], $salt->salt); 
 	        	}
 	        	return $data;
 	        })

+ 2 - 1
models/User.php

@@ -6,6 +6,7 @@ use \MongoDate;
 use \lithium\util\String;
 use \lithium\util\Validator;
 use \App\Libraries\openID\LightOpenID;
+use \lithium\security\Password;
 
 class User extends \lithium\data\Model {
 	//To bypass mongo bug
@@ -332,7 +333,7 @@ class User extends \lithium\data\Model {
 		if(!empty($entity->newpass) || !$entity->exists())
 		{
 			//Generate Salt for the user.
-			$salt = String::genSalt('bf', 6);
+			$salt = Password::salt('bf', 6);
 
 			//Hash their password.
 			$data['password'] = String::hashPassword($entity->newpass, $salt);