Patch #11057 » 0001-Confirm-admin-flag-change-on-a-separate-tab.patch
| app/controllers/users_controller.rb | ||
|---|---|---|
|
respond_to do |format|
|
||
|
format.html {
|
||
|
flash[:notice] = l(:notice_successful_update)
|
||
|
redirect_to :back
|
||
|
redirect_to :controller => 'users', :action => 'edit', :tab => params[:tab]
|
||
|
}
|
||
|
format.api { head :ok }
|
||
|
end
|
||
| app/helpers/users_helper.rb | ||
|---|---|---|
|
def user_settings_tabs
|
||
|
tabs = [{:name => 'general', :partial => 'users/general', :label => :label_general},
|
||
|
{:name => 'memberships', :partial => 'users/memberships', :label => :label_project_plural}
|
||
|
]
|
||
|
{:name => 'memberships', :partial => 'users/memberships', :label => :label_project_plural},
|
||
|
{:name => 'admin', :partial => 'users/admin', :label => :label_administration}]
|
||
|
if Group.all.any?
|
||
|
tabs.insert 1, {:name => 'groups', :partial => 'users/groups', :label => :label_group_plural}
|
||
|
end
|
||
| app/views/users/_admin.html.erb | ||
|---|---|---|
|
<% disabled = (@user == User.current) %>
|
||
|
<% form_for(:user, :url => { :action => 'update' }, :html => {:method => :put}) do %>
|
||
|
<%= hidden_field_tag 'tab', 'admin', :id => nil %>
|
||
|
<div class="warning">
|
||
|
<%=l :text_administrator_flag_warning %>
|
||
|
</div>
|
||
|
<fieldset class="box tabular">
|
||
|
<legend><%=l(:label_administration)%></legend>
|
||
|
<p>
|
||
|
<%= hidden_field_tag 'user[admin]', '0', :id => nil %>
|
||
|
<%= label_tag 'user[admin]', l(:field_admin) %>
|
||
|
<%= check_box_tag 'user[admin]', '1', @user.admin?, :disabled => disabled %>
|
||
|
</p>
|
||
|
</fieldset>
|
||
|
<%= submit_tag(l(:button_save)) unless disabled %>
|
||
|
<% end %>
|
||
| app/views/users/_form.html.erb | ||
|---|---|---|
|
<p><%= custom_field_tag_with_label :user, value %></p>
|
||
|
<% end %>
|
||
|
<p><%= f.check_box :admin, :disabled => (@user == User.current) %></p>
|
||
|
<%= call_hook(:view_users_form, :user => @user, :form => f) %>
|
||
|
</fieldset>
|
||
| config/locales/en.yml | ||
|---|---|---|
|
text_scm_command_version: Version
|
||
|
text_scm_config: You can configure your scm commands in config/configuration.yml. Please restart the application after editing it.
|
||
|
text_scm_command_not_available: Scm command is not available. Please check settings on the administration panel.
|
||
|
text_administrator_flag_warning: "Administrator flag grants a user permissions to access and change every aspect of your Redmine instance. Please mean it when you change it. As a precaution, you cannot revoke administrator flag from yourself."
|
||
|
default_role_manager: Manager
|
||
|
default_role_developer: Developer
|
||
- « Previous
- 1
- 2
- Next »