From 9441ab0ca8e8c4a51bf6716dbdaae0aea4f3fa21 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 3 Apr 2017 10:48:59 +0000 Subject: Send email even if password is not changed (#7577). git-svn-id: http://svn.redmine.org/redmine/trunk@16453 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/users_controller.rb | 2 +- app/views/mailer/account_information.html.erb | 2 ++ app/views/mailer/account_information.text.erb | 2 +- app/views/users/_general.html.erb | 2 +- app/views/users/new.html.erb | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 60600a252..7dcaa7962 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -140,7 +140,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? && @user != User.current + elsif @user.active? && params[:send_information] && @user != User.current Mailer.account_information(@user, @user.password).deliver end diff --git a/app/views/mailer/account_information.html.erb b/app/views/mailer/account_information.html.erb index 4d4066d65..d010431ab 100644 --- a/app/views/mailer/account_information.html.erb +++ b/app/views/mailer/account_information.html.erb @@ -4,7 +4,9 @@

<%= l(:mail_body_account_information) %>:

<% end %> diff --git a/app/views/mailer/account_information.text.erb b/app/views/mailer/account_information.text.erb index 0a02566d9..f2f37d9c3 100644 --- a/app/views/mailer/account_information.text.erb +++ b/app/views/mailer/account_information.text.erb @@ -1,6 +1,6 @@ <% if @user.auth_source %><%= l(:mail_body_account_information_external, @user.auth_source.name) %> <% else %><%= l(:mail_body_account_information) %>: * <%= l(:field_login) %>: <%= @user.login %> -* <%= l(:field_password) %>: <%= @password %> +<% if @password %>* <%= l(:field_password) %>: <%= @password %><% end %> <% end %> <%= l(:label_login) %>: <%= @login_url %> diff --git a/app/views/users/_general.html.erb b/app/views/users/_general.html.erb index fddea54bb..c9398577c 100644 --- a/app/views/users/_general.html.erb +++ b/app/views/users/_general.html.erb @@ -1,7 +1,7 @@ <%= labelled_form_for @user, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <% if @user.active? && email_delivery_enabled? && @user != User.current -%> -

+

<% end -%>

<%= submit_tag l(:button_save) %>

<% end %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index e9eb102f8..088f272e4 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -3,7 +3,7 @@ <%= labelled_form_for @user, :html => {:multipart => true} do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <% if email_delivery_enabled? %> -

+

<% end %>

<%= submit_tag l(:button_create) %> -- cgit v1.2.3