commit 66d984f5f72069c6d57dd17467d5043cecf79924 Author: Jeff Mitchell Date: Tue Apr 6 17:00:10 2010 -0400 Add OpenID-only registration option diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index b1500d4..b7b14c0 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -173,6 +173,10 @@ class AccountController < ApplicationController 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) diff --git a/app/views/account/login.rhtml b/app/views/account/login.rhtml index 6edfb44..b65aed5 100644 --- a/app/views/account/login.rhtml +++ b/app/views/account/login.rhtml @@ -2,6 +2,7 @@ <% form_tag({:action=> "login"}) do %> <%= back_url_hidden_field_tag %> +<% if Setting.self_registration != '4' %> @@ -10,6 +11,7 @@ +<% end %> <% if Setting.openid? %> @@ -26,7 +28,7 @@ diff --git a/app/views/settings/_authentication.rhtml b/app/views/settings/_authentication.rhtml index eb51ee9..c2ea1c5 100644 --- a/app/views/settings/_authentication.rhtml +++ b/app/views/settings/_authentication.rhtml @@ -8,7 +8,8 @@

<%= 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"]] %>

+ [l(:label_registration_automatic_activation), "3"], + [l(:label_registration_openid_only), "4"]] %>

<%= setting_text_field :password_min_length, :size => 6 %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 2ee57bc..d4841b8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -705,6 +705,7 @@ en: 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 diff --git a/lib/redmine.rb b/lib/redmine.rb index 0cf0cc4..6ca0679 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -126,7 +126,7 @@ end 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
<%= text_field_tag 'username', nil, :tabindex => '1' %> <%= password_field_tag 'password', nil, :tabindex => '2' %>
- <% if Setting.lost_password? %> + <% if Setting.lost_password? && Setting.self_registration != '4' %> <%= link_to l(:label_password_lost), :controller => 'account', :action => 'lost_password' %> <% end %>