Patch #21436 ยป 0001-Prevent-admins-from-sending-themselves-their-own-pas.patch
| app/controllers/users_controller.rb | ||
|---|---|---|
|
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
|
||
| app/views/users/_general.html.erb | ||
|---|---|---|
|
<%= 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>
|
||