openidonly.patch

Jeff Mitchell, 2010-04-07 21:35

Download (4 KB)

View differences:

app/controllers/account_controller.rb
173 173
            register_automatically(user) do
174 174
              onthefly_creation_failed(user)
175 175
            end
176
          when '4'
177
            register_automatically(user) do
178
              onthefly_creation_failed(user)
179
          end
176 180
          else
177 181
            register_manually_by_administrator(user) do
178 182
              onthefly_creation_failed(user)
app/views/account/login.rhtml
2 2
<% form_tag({:action=> "login"}) do %>
3 3
<%= back_url_hidden_field_tag %>
4 4
<table>
5
<% if Setting.self_registration != '4' %>
5 6
<tr>
6 7
    <td align="right"><label for="username"><%=l(:field_login)%>:</label></td>
7 8
    <td align="left"><%= text_field_tag 'username', nil, :tabindex => '1' %></td>
......
10 11
    <td align="right"><label for="password"><%=l(:field_password)%>:</label></td>
11 12
    <td align="left"><%= password_field_tag 'password', nil, :tabindex => '2' %></td>
12 13
</tr>
14
<% end %>
13 15
<% if Setting.openid? %>
14 16
<tr>
15 17
  <td align="right"><label for="openid_url"><%=l(:field_identity_url)%></label></td>
......
26 28
</tr>
27 29
<tr>
28 30
    <td align="left">
29
        <% if Setting.lost_password? %>
31
        <% if Setting.lost_password? && Setting.self_registration != '4' %>
30 32
            <%= link_to l(:label_password_lost), :controller => 'account', :action => 'lost_password' %>
31 33
        <% end %>
32 34
    </td>
app/views/settings/_authentication.rhtml
8 8
<p><%= setting_select :self_registration, [[l(:label_disabled), "0"],
9 9
							                             [l(:label_registration_activation_by_email), "1"],
10 10
							                             [l(:label_registration_manual_activation), "2"],
11
							                             [l(:label_registration_automatic_activation), "3"]] %></p>
11
							                             [l(:label_registration_automatic_activation), "3"],
12
							                             [l(:label_registration_openid_only), "4"]] %></p>
12 13

  
13 14
<p><%= setting_text_field :password_min_length, :size => 6 %></p>
14 15

  
config/locales/en.yml
705 705
  label_registration_activation_by_email: account activation by email
706 706
  label_registration_manual_activation: manual account activation
707 707
  label_registration_automatic_activation: automatic account activation
708
  label_registration_openid_only: OpenID registration only
708 709
  label_display_per_page: "Per page: {{value}}"
709 710
  label_age: Age
710 711
  label_change_properties: Change properties
lib/redmine.rb
126 126

  
127 127
Redmine::MenuManager.map :account_menu do |menu|
128 128
  menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? }
129
  menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? }
129
  menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? && Setting.self_registration != '4' }
130 130
  menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? }
131 131
  menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? }
132 132
end