Added a system setting for allowing OpenID logins and registrations
* Defaults to off * Is set in the Administration panel under Authentication #699 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2449 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -46,10 +46,10 @@ class AccountController < ApplicationController
|
||||
self.logged_user = nil
|
||||
else
|
||||
# Authenticate user
|
||||
unless using_open_id?
|
||||
password_authentication
|
||||
else
|
||||
if using_open_id? && Setting.openid?
|
||||
open_id_authenticate(params[:openid_url])
|
||||
else
|
||||
password_authentication
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,10 +10,12 @@
|
||||
<td align="right"><label for="password"><%=l(:field_password)%>:</label></td>
|
||||
<td align="left"><%= password_field_tag 'password', nil, :size => 40 %></td>
|
||||
</tr>
|
||||
<% if Setting.openid? %>
|
||||
<tr>
|
||||
<td align="right"><label for="openid_url"><%=l(:field_identity_url)%></label></td>
|
||||
<td align="left"><%= text_field_tag "openid_url" %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td align="left">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url %></h2>
|
||||
<h2><%=l(:label_register)%><%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2>
|
||||
|
||||
<% form_tag({:action => 'register'}, :class => "tabular") do %>
|
||||
<%= error_messages_for 'user' %>
|
||||
@@ -29,8 +29,10 @@
|
||||
<p><label for="user_language"><%=l(:field_language)%></label>
|
||||
<%= select("user", "language", lang_options_for_select) %></p>
|
||||
|
||||
<% if Setting.openid? %>
|
||||
<p><label for="user_identity_url"><%=l(:field_identity_url)%></label>
|
||||
<%= text_field 'user', 'identity_url' %></p>
|
||||
<% end %>
|
||||
|
||||
<% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :user, value %></p>
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
|
||||
<p><label><%= l(:label_password_lost) %></label>
|
||||
<%= check_box_tag 'settings[lost_password]', 1, Setting.lost_password? %><%= hidden_field_tag 'settings[lost_password]', 0 %></p>
|
||||
|
||||
<p><label><%= l(:setting_openid) %></label>
|
||||
<%= check_box_tag 'settings[openid]', 1, Setting.openid? %><%= hidden_field_tag 'settings[openid]', 0 %></p>
|
||||
</div>
|
||||
|
||||
<div style="float:right;">
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<p><%= f.text_field :lastname, :required => true %></p>
|
||||
<p><%= f.text_field :mail, :required => true %></p>
|
||||
<p><%= f.select :language, lang_options_for_select %></p>
|
||||
<% if Setting.openid? %>
|
||||
<p><%= f.text_field :identity_url %></p>
|
||||
<% end %>
|
||||
|
||||
<% @user.custom_field_values.each do |value| %>
|
||||
<p><%= custom_field_tag_with_label :user, value %></p>
|
||||
|
||||
Reference in New Issue
Block a user