Index: branches/5.2.x/core/units/users/users_item.php =================================================================== diff -u -N -r14437 -r14447 --- branches/5.2.x/core/units/users/users_item.php (.../users_item.php) (revision 14437) +++ branches/5.2.x/core/units/users/users_item.php (.../users_item.php) (revision 14447) @@ -1,6 +1,6 @@ Application->ConfigValue('Email_As_Login') ) - { - $this->SetDBField('Login', $this->GetDBField('Email') ); - } - } - function SendEmailEvents() { switch ($this->GetDBField('Status')) { @@ -136,4 +124,20 @@ $this->SetDBField('LastName', $last_name); } + /** + * Generates new password for given user + * + * @param int $length + * @return string + * @access public + */ + public function generatePassword($length = 10) + { + $password = kUtil::generatePassword($length); + + $this->SetField('Password', $password); + $this->SetField('VerifyPassword', $password); + + return $password; + } } \ No newline at end of file