forked from stopfstedt/redmine_http_auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed autoregistration and enabled manual login
Continued fixing minor issues brought up on issue AdamLantos#18. - Self-Registration form is working (although it is not used by my installations) - Logout now returns to login screen allowing the user to change identity - Locked users cannot log in
- Loading branch information
Showing
3 changed files
with
29 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,18 @@ | ||
<h2><%=l(:label_autoregister)%></h2> | ||
|
||
<% form_tag({:action => 'register'}, :class => "tabular") do %> | ||
<%= labelled_form_for @user, :url => { :action => "register" } do |f| %> | ||
<%= error_messages_for 'user' %> | ||
|
||
<div class="box"> | ||
<!--[form:user]--> | ||
<p><label for="user_login"><%=l(:field_login)%> <span class="required">*</span></label> | ||
<%= text_field 'user', 'login', :size => 25, :disabled => (readonly_attribute? 'login') %></p> | ||
<div class="box tabular"> | ||
<p><%= f.text_field :login, :size => 25, :required => true %></p> | ||
<p><%= f.text_field :firstname, :required => true %></p> | ||
<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> | ||
|
||
<p><label for="user_firstname"><%=l(:field_firstname)%> <span class="required">*</span></label> | ||
<%= text_field 'user', 'firstname', :disabled => (readonly_attribute? 'firstname') %></p> | ||
|
||
<p><label for="user_lastname"><%=l(:field_lastname)%> <span class="required">*</span></label> | ||
<%= text_field 'user', 'lastname', :disabled => (readonly_attribute? 'lastname') %></p> | ||
|
||
<p><label for="user_mail"><%=l(:field_mail)%> <span class="required">*</span></label> | ||
<%= text_field 'user', 'mail', :disabled => (readonly_attribute? 'mail') %></p> | ||
|
||
<p><label for="user_language"><%=l(:field_language)%></label> | ||
<%= select("user", "language", lang_options_for_select) %></p> | ||
|
||
<!--[eoform:user]--> | ||
</div> | ||
|
||
<%= submit_tag l(:button_submit) %> | ||
<% end %> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module RedmineHttpAuth | ||
module AccountControllerPatch | ||
def self.included(base) | ||
base.class_eval do | ||
# We're substituting the original function since redirect_to can only be called once and we need to change the target page | ||
def logout | ||
logout_user | ||
if Setting.plugin_redmine_http_auth['enable'] == "true" | ||
redirect_to signin_url | ||
else | ||
redirect_to home_url | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
91337a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I have tried to install your plugin in latest Redmine stable release (2.5.1), but when restarting the server I keep getting the following error:
ActionController::RoutingError (No route matches {:controller=>"httpauth-login"}):
lib/redmine/menu_manager.rb:150:in
render_single_menu_node' lib/redmine/menu_manager.rb:102:in
render_menu_node'lib/redmine/menu_manager.rb:91:in
block in render_menu' lib/redmine/menu_manager.rb:168:in
block in menu_items_for'lib/redmine/menu_manager.rb:165:in
each' lib/redmine/menu_manager.rb:165:in
menu_items_for'lib/redmine/menu_manager.rb:90:in
render_menu' app/views/layouts/base.html.erb:23:in
_app_views_layouts_base_html_erb__3645520945912230717_23871320'I have no knowledge about the Rails or Ruby, could anyone please point me in the right direction for solving this problem?
Best regards
Jan Mach
91337a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi everybody,
I managed to solve the problem I was having, so I decided to paste my solution here (in case someone else is also using it, it seems suspiciously dead to me):