mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-22 08:21:14 +00:00
Prevent admins from sending themselves their own password (#21436).
Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@14966 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
e6b7c73169
commit
389527296e
@ -143,7 +143,7 @@ class UsersController < ApplicationController
|
||||
|
||||
if was_activated
|
||||
Mailer.account_activated(@user).deliver
|
||||
elsif @user.active? && params[:send_information] && @user.password.present? && @user.auth_source_id.nil?
|
||||
elsif @user.active? && params[:send_information] && @user.password.present? && @user.auth_source_id.nil? && @user != User.current
|
||||
Mailer.account_information(@user, @user.password).deliver
|
||||
end
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<%= labelled_form_for @user do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<% if @user.active? && email_delivery_enabled? -%>
|
||||
<% if @user.active? && email_delivery_enabled? && @user != User.current -%>
|
||||
<p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
|
||||
<% end -%>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user