##// END OF EJS Templates
Prevent admins from sending themselves their own password (#21436)....
Jean-Philippe Lang -
r14584:389527296e02
parent child
Show More
@@ -143,7 +143,7 class UsersController < ApplicationController
143
143
144 if was_activated
144 if was_activated
145 Mailer.account_activated(@user).deliver
145 Mailer.account_activated(@user).deliver
146 elsif @user.active? && params[:send_information] && @user.password.present? && @user.auth_source_id.nil?
146 elsif @user.active? && params[:send_information] && @user.password.present? && @user.auth_source_id.nil? && @user != User.current
147 Mailer.account_information(@user, @user.password).deliver
147 Mailer.account_information(@user, @user.password).deliver
148 end
148 end
149
149
@@ -1,6 +1,6
1 <%= labelled_form_for @user do |f| %>
1 <%= labelled_form_for @user do |f| %>
2 <%= render :partial => 'form', :locals => { :f => f } %>
2 <%= render :partial => 'form', :locals => { :f => f } %>
3 <% if @user.active? && email_delivery_enabled? -%>
3 <% if @user.active? && email_delivery_enabled? && @user != User.current -%>
4 <p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
4 <p><label><%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %></label></p>
5 <% end -%>
5 <% end -%>
6 <p><%= submit_tag l(:button_save) %></p>
6 <p><%= submit_tag l(:button_save) %></p>
General Comments 0
You need to be logged in to leave comments. Login now