Modified: trunk/app/controllers/sessions_controller.rb (3737 => 3738)
--- trunk/app/controllers/sessions_controller.rb 2013-10-01 10:22:28 UTC (rev 3737)
+++ trunk/app/controllers/sessions_controller.rb 2013-10-01 10:45:10 UTC (rev 3738)
@@ -66,7 +66,15 @@
registration_info = OpenID::SReg::Response.from_success_response(response).data
name = registration_info["fullname"]
+
+ given_name = session["given_name"].strip
+ family_name = session["family_name"].strip
+
unless name
+ name = "#{given_name} #{family_name}".strip
+ end
+
+ unless name && !name.empty?
flash[:notice] ||= ""
flash[:notice] << "Please enter your name to be displayed to other users of the site.<br/>"
name = "OpenID User"
@@ -86,6 +94,7 @@
#end
@user = User.new(:openid_url => response.identity_url, :name => name, #:email => email_to_use
+ :given_name => given_name, :family_name => family_name,
:activated_at => Time.now, :last_seen_at => Time.now)
@user.save
@@ -128,6 +137,9 @@
def open_id_authentication
openid_url = params[:openid_url]
+
+ session["given_name"] = params[:given_name]
+ session["family_name"] = params[:family_name]
begin
if request.post?
Modified: trunk/app/views/users/new.rhtml (3737 => 3738)
--- trunk/app/views/users/new.rhtml 2013-10-01 10:22:28 UTC (rev 3737)
+++ trunk/app/views/users/new.rhtml 2013-10-01 10:45:10 UTC (rev 3738)
@@ -184,6 +184,16 @@
<p><b>Don't have an OpenID? Get one FREE from <%= link_to 'myOpenID', "https://www.myopenid.com/" %> or <%= link_to 'other providers', "http://openiddirectory.com/openid-providers-c-1.html" %>.</b></p>
+ <p>
+ <strong>Given name</strong>
+ <br />
+ <%= text_field_tag :given_name, nil, :size => 32 %>
+ </p>
+ <p>
+ <strong>Family name</strong>
+ <br />
+ <%= text_field_tag :family_name, nil, :size => 32 %>
+ </p>
<p>
<strong>OpenID</strong><br/>
<%= text_field_tag 'openid_url', nil, :size => 35 %>