Index: branches/unlabeled/unlabeled-1.65.2/kernel/units/users/users_event_handler.php =================================================================== diff -u -r6487 -r6675 --- branches/unlabeled/unlabeled-1.65.2/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 6487) +++ branches/unlabeled/unlabeled-1.65.2/kernel/units/users/users_event_handler.php (.../users_event_handler.php) (revision 6675) @@ -357,7 +357,7 @@ $object =& $event->getObject(); $this->Application->SetVar('u_id', $object->GetID() ); - if($object->GetDBField('Status') == STATUS_ACTIVE) + if($object->GetDBField('Status') == STATUS_ACTIVE && !$this->Application->ConfigValue('User_Password_Auto')) { $email_as_login = $this->Application->ConfigValue('Email_As_Login'); list($login_field, $submit_field) = $email_as_login ? Array('Email', 'email') : Array('Login', 'login'); @@ -448,10 +448,16 @@ $cs_helper =& $this->Application->recallObject('CountryStatesHelper'); $cs_helper->CheckStateField($event, 'State', 'Country'); - parent::OnCreate($event); - $object =& $event->getObject( Array('skip_autoload' => true) ); + if ($this->Application->ConfigValue('User_Password_Auto')) { + $pass = makepassword4(rand(5,8)); + $object->SetField('Password', $pass); + $object->SetField('VerifyPassword', $pass); + $this->Application->SetVar('user_password',$pass); + } + parent::OnCreate($event); + $this->Application->SetVar('u_id', $object->getID() ); $this->setNextTemplate($event);