I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

openid_account_controller_patch.rb.patch

Ruben Silva, 18 Apr 2012 10:05

Download (1.12 KB)

View differences:

lib/openid_account_controller_patch.rb.new 2012-04-18 11:03:12.081288885 +0100
72 72

  
73 73
            authenticate_with_open_id(openid_url, :required => options, :return_to => signin_url) do |result, identity_url, registration|
74 74
                if result.successful?
75
                    user = User.find_or_initialize_by_identity_url(identity_url)
75
                    user = User.find_or_initialize_by_identity_url(identity_url)                                       
76
                   if user.new_record? and registration[OPENID_AX_EMAIL]
77
                       userByEmail = User.find_by_mail(registration[OPENID_AX_EMAIL].first)                                    
78
                       if userByEmail
79
                           user = userByEmail
80
                           user.identity_url = identity_url
81
                           user.save()
82
                       end
83
                   end 
84

  
76 85
                    if user.new_record?
77 86
                        redirect_to(home_url) && return unless Setting.self_registration?
Terms of use | Privacy policy