Project

General

Profile

Patch #5267 ยป openidonly.patch

Jeff Mitchell, 2010-04-07 21:35

View differences:

app/controllers/account_controller.rb
register_automatically(user) do
onthefly_creation_failed(user)
end
when '4'
register_automatically(user) do
onthefly_creation_failed(user)
end
else
register_manually_by_administrator(user) do
onthefly_creation_failed(user)
app/views/account/login.rhtml
<% form_tag({:action=> "login"}) do %>
<%= back_url_hidden_field_tag %>
<table>
<% if Setting.self_registration != '4' %>
<tr>
<td align="right"><label for="username"><%=l(:field_login)%>:</label></td>
<td align="left"><%= text_field_tag 'username', nil, :tabindex => '1' %></td>
......
<td align="right"><label for="password"><%=l(:field_password)%>:</label></td>
<td align="left"><%= password_field_tag 'password', nil, :tabindex => '2' %></td>
</tr>
<% end %>
<% if Setting.openid? %>
<tr>
<td align="right"><label for="openid_url"><%=l(:field_identity_url)%></label></td>
......
</tr>
<tr>
<td align="left">
<% if Setting.lost_password? %>
<% if Setting.lost_password? && Setting.self_registration != '4' %>
<%= link_to l(:label_password_lost), :controller => 'account', :action => 'lost_password' %>
<% end %>
</td>
app/views/settings/_authentication.rhtml
<p><%= setting_select :self_registration, [[l(:label_disabled), "0"],
[l(:label_registration_activation_by_email), "1"],
[l(:label_registration_manual_activation), "2"],
[l(:label_registration_automatic_activation), "3"]] %></p>
[l(:label_registration_automatic_activation), "3"],
[l(:label_registration_openid_only), "4"]] %></p>
<p><%= setting_text_field :password_min_length, :size => 6 %></p>
config/locales/en.yml
label_registration_activation_by_email: account activation by email
label_registration_manual_activation: manual account activation
label_registration_automatic_activation: automatic account activation
label_registration_openid_only: OpenID registration only
label_display_per_page: "Per page: {{value}}"
label_age: Age
label_change_properties: Change properties
lib/redmine.rb
Redmine::MenuManager.map :account_menu do |menu|
menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? }
menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? }
menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? && Setting.self_registration != '4' }
menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? }
menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? }
end
    (1-1/1)