From 157872434dc659cecf9e26acbe8006b2f0bc4e5f Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Tue, 9 Feb 2010 13:41:35 -0800 Subject: Import hashed passwords from G2 (which will only work if they're PasswordHash passwords, not if they're G2 style md5 / salted md5). --- modules/g2_import/helpers/g2_import.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules') diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index d3ed92e8..faf08291 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -309,6 +309,10 @@ class g2_import_Core { // Just use the hashed password as an unpredictable // value here. The user will have to reset the password. $g2_user->getHashedPassword(), $g2_user->getEmail()); + if (class_exists("User_Model") && $user instanceof User_Model) { + // This will work if G2's password is a PasswordHash password as well. + $user->hashed_password = $g2_user->getHashedPassword(); + } $message = t("Created user: '%name'.", array("name" => $user->name)); } -- cgit v1.2.3 From c0a598417cc1f9a5534348ec5edb9c138293bc01 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Tue, 9 Feb 2010 13:54:14 -0800 Subject: Change access::can to access::required in g2 redirect, to please the controller auth code audit test. --- modules/g2_import/controllers/g2.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/g2_import/controllers/g2.php b/modules/g2_import/controllers/g2.php index 347da649..1d97653a 100644 --- a/modules/g2_import/controllers/g2.php +++ b/modules/g2_import/controllers/g2.php @@ -61,9 +61,10 @@ class G2_Controller extends Controller { } $item = ORM::factory("item", $g2_map->g3_id); - if (!$item->loaded() || !access::can("view", $item)) { + if (!$item->loaded()) { throw new Kohana_404_Exception(); } + access::required("view", $item); // Redirect the user to the new url -- cgit v1.2.3