Index: branches/5.2.x/core/units/users/users_event_handler.php =================================================================== diff -u -N -r15586 -r15590 --- branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 15586) +++ branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 15590) @@ -1,6 +1,6 @@ Array('self' => 'view'), // because setting to logged in user only - 'OnUpdateRootPassword' => Array('self' => true), 'OnUpdatePassword' => Array('self' => true), 'OnSaveSelected' => Array ('self' => 'view'), 'OnGeneratePassword' => Array ('self' => 'view'), @@ -1157,16 +1156,6 @@ * Allows to change root password * * @param kEvent $event - */ - function OnUpdateRootPassword($event) - { - $this->OnUpdatePassword($event); - } - - /** - * Allows to change root password - * - * @param kEvent $event * @return void * @access protected */ @@ -1197,21 +1186,11 @@ $object = $event->getObject(Array ('skip_autoload' => true)); /* @var $object UsersItem */ - // put salt to user's config - $field_options = $object->GetFieldOptions('RootPassword'); - $field_options['salt'] = 'b38'; - // this is internal hack to allow root/root passwords for dev if ( $this->Application->isDebugMode() && $field_values['RootPassword'] == 'root' ) { - $field_options['min_length'] = 4; + $object->SetFieldOption('RootPassword', 'min_length', 4); } - $object->SetFieldOptions('RootPassword', $field_options); - - $verify_options = $object->GetFieldOptions('VerifyRootPassword'); - $verify_options['salt'] = 'b38'; - $object->SetFieldOptions('VerifyRootPassword', $verify_options); - $this->RemoveRequiredFields($object); $object->SetDBField('RootPassword', $this->Application->ConfigValue('RootPass')); $object->SetFieldsFromHash($field_values, $this->getRequestProtectedFields($field_values)); @@ -1922,9 +1901,8 @@ /* @var $password_formatter kPasswordFormatter */ $new_root_password = kUtil::generatePassword(); - $new_root_password_encrypted = $password_formatter->EncryptPassword($new_root_password, 'b38'); - $this->Application->SetConfigValue('RootPass', $new_root_password_encrypted); + $this->Application->SetConfigValue('RootPass', $password_formatter->hashPassword($new_root_password)); $this->Application->EmailEventAdmin('ROOT.RESET.PASSWORD', null, Array ('password' => $new_root_password)); $event->SetRedirectParam('reset', 1);