Index: branches/5.2.x/core/units/users/users_event_handler.php =================================================================== diff -u -N -r14572 -r14585 --- branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 14572) +++ branches/5.2.x/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 14585) @@ -1,6 +1,6 @@ afterItemChanged($event); $object =& $event->getObject(); @@ -897,6 +899,13 @@ $object->SetDBField('PwRequestTime_date', NULL); $object->SetDBField('PwRequestTime_time', NULL); } + + $changed_fields = array_keys( $object->GetChangedFields() ); + + if ( $changed_fields && !in_array('Modified', $changed_fields) ) { + $object->SetDBField('Modified_date', adodb_mktime()); + $object->SetDBField('Modified_time', adodb_mktime()); + } } /** @@ -1215,6 +1224,8 @@ */ function OnAfterItemUpdate(&$event) { + parent::OnAfterItemUpdate($event); + $this->afterItemChanged($event); $object =& $event->getObject(); @@ -1274,6 +1285,8 @@ */ function OnAfterCopyToLive(&$event) { + parent::OnAfterCopyToLive($event); + $temp_id = $event->getEventParam('temp_id'); $email_passwords = $this->Application->RecallVar('email_passwords'); @@ -1374,12 +1387,15 @@ $first_country = $this->Application->ConfigValue('User_Default_Registration_Country'); } - if ($first_country) { // update user country dropdown sql $fields['Country']['options_sql'] = preg_replace('/ORDER BY (.*)/', 'ORDER BY IF (CountryStateId = '.$first_country.', 1, 0) DESC, \\1', $fields['Country']['options_sql']); } + $max_username = $this->Application->ConfigValue('MaxUserName'); + $fields['Login']['min_len'] = $this->Application->ConfigValue('Min_UserName'); + $fields['Login']['max_len'] = $max_username ? $max_username : 255; + // 2. set default user registration group $fields['PrimaryGroupId']['default'] = $this->Application->ConfigValue('User_NewGroup');