Created
March 29, 2011 22:31
-
-
Save edavis10/893492 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb | |
index 12e7707..8326310 100644 | |
--- a/app/models/mail_handler.rb | |
+++ b/app/models/mail_handler.rb | |
@@ -339,8 +339,16 @@ class MailHandler < ActionMailer::Base | |
user.lastname = '-' if user.lastname.blank? | |
user.login = user.mail | |
- user.password = ActiveSupport::SecureRandom.hex(5) | |
+ password = ActiveSupport::SecureRandom.hex(5) | |
+ user.password = password | |
user.language = Setting.default_language | |
+ if user.save | |
+ Mailer.deliver_account_information(user, password) | |
+ return user | |
+ else | |
+ return nil | |
+ end | |
+ | |
user.save ? user : nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment