s...@ull.at
unread,Aug 7, 2014, 9:57:03 AM8/7/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ullrigh...@googlegroups.com
Author: klemens
Date: 2014-08-07 15:57:02 +0200 (Thu, 07 Aug 2014)
New Revision: 4134
Modified:
trunk/plugins/ullCorePlugin/lib/form/widget/ullMetaWidgetPassword.class.php
Log:
Refactored ullMetaWidgetPasswort to set the new password directly in the object.
Modified: trunk/plugins/ullCorePlugin/lib/form/widget/ullMetaWidgetPassword.class.php
===================================================================
--- trunk/plugins/ullCorePlugin/lib/form/widget/ullMetaWidgetPassword.class.php 2014-08-05 07:40:31 UTC (rev 4133)
+++ trunk/plugins/ullCorePlugin/lib/form/widget/ullMetaWidgetPassword.class.php 2014-08-07 13:57:02 UTC (rev 4134)
@@ -38,6 +38,7 @@
public static function listenToUpdateObjectEvent(sfEvent $event, $values)
{
+
// ******** = pseudo password - means no password change
if (isset($values['password']) && $values['password'] == '********')
{
@@ -59,10 +60,19 @@
{
require_once sfConfig::get('sf_plugins_dir') .
'/ullCorePlugin/lib/vendor/PasswordHash.php';
-
- $values['password'] = create_hash($values['password']);
- return $values;
+ $plain = $values['password'];
+ $encrypted = create_hash($plain);
+ $object = $event->getSubject()->getObject();
+
+ if ($object instanceof UllUser)
+ {
+ $object->password = $encrypted;
+
+ unset($values['password']);
+
+ return $values;
+ }
}
return $values;