From 1944b5acc02aeea842a4d7b751356436cc47cf8f Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 21 Aug 2014 21:58:41 -0500 Subject: [PATCH] Fixing bug where password would not be hashed in database if user updated password This affected admin and user interfaces --- indefero/src/IDF/Form/Admin/UserUpdate.php | 1 + indefero/src/IDF/Form/UserAccount.php | 1 + 2 files changed, 2 insertions(+) diff --git a/indefero/src/IDF/Form/Admin/UserUpdate.php b/indefero/src/IDF/Form/Admin/UserUpdate.php index fa2da76..5fd5f7e 100644 --- a/indefero/src/IDF/Form/Admin/UserUpdate.php +++ b/indefero/src/IDF/Form/Admin/UserUpdate.php @@ -315,6 +315,7 @@ class IDF_Form_Admin_UserUpdate extends Pluf_Form if ($password1 != $password2) { throw new Pluf_Form_Invalid(__('The passwords do not match. Please give them again.')); } + $this->cleaned_data["password"] = base64_encode(sha1($this->cleaned_data['password'], true)); } return $this->cleaned_data; } diff --git a/indefero/src/IDF/Form/UserAccount.php b/indefero/src/IDF/Form/UserAccount.php index 4ce075a..66408ee 100644 --- a/indefero/src/IDF/Form/UserAccount.php +++ b/indefero/src/IDF/Form/UserAccount.php @@ -479,6 +479,7 @@ class IDF_Form_UserAccount extends Pluf_Form if ($password1 != $password2) { throw new Pluf_Form_Invalid(__('The passwords do not match. Please give them again.')); } + $this->cleaned_data["password"] = base64_encode(sha1($this->cleaned_data['password'], true)); } return $this->cleaned_data;