Account information can now be sent to the user when creating an account.
ActionMailer logger set to nil for production environment to disable email contents output in production.log git-svn-id: http://redmine.rubyforge.org/svn/trunk@546 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f12315075f
commit
f04225321c
|
@ -61,6 +61,7 @@ class UsersController < ApplicationController
|
||||||
@custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
|
@custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) }
|
||||||
@user.custom_values = @custom_values
|
@user.custom_values = @custom_values
|
||||||
if @user.save
|
if @user.save
|
||||||
|
Mailer.deliver_account_information(@user, params[:password]) if params[:send_information]
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
redirect_to :action => 'list'
|
redirect_to :action => 'list'
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,6 +18,14 @@
|
||||||
class Mailer < ActionMailer::Base
|
class Mailer < ActionMailer::Base
|
||||||
helper IssuesHelper
|
helper IssuesHelper
|
||||||
|
|
||||||
|
def account_information(user, password)
|
||||||
|
set_language_if_valid user.language
|
||||||
|
recipients user.mail
|
||||||
|
from Setting.mail_from
|
||||||
|
subject l(:mail_subject_register)
|
||||||
|
body :user => user, :password => password
|
||||||
|
end
|
||||||
|
|
||||||
def issue_add(issue)
|
def issue_add(issue)
|
||||||
set_language_if_valid(Setting.default_language)
|
set_language_if_valid(Setting.default_language)
|
||||||
# Sends to all project members
|
# Sends to all project members
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<% if @user.auth_source %>You can use your "<%= @user.auth_source.name %>" account to log into Redmine.
|
||||||
|
<% else %>Your Redmine account information:
|
||||||
|
* Login: <%= @user.login %>
|
||||||
|
* Password: <%= @password %>
|
||||||
|
<% end %>
|
||||||
|
Log in: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'login' %>
|
||||||
|
<% unless @user.auth_source %>
|
||||||
|
You can change your password here: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %>
|
||||||
|
<% end %>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<% if @user.auth_source %>Vous pouvez utiliser votre compte "<%= @user.auth_source.name %>" pour vous connecter à Redmine.
|
||||||
|
<% else %>Paramètres de connexion de votre compte Redmine:
|
||||||
|
* Identifiant: <%= @user.login %>
|
||||||
|
* Mot de passe: <%= @password %>
|
||||||
|
<% end %>
|
||||||
|
Pour se connecter à l'application: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'account', :action => 'login' %>
|
||||||
|
<% unless @user.auth_source %>
|
||||||
|
Vous pouvez changer votre mot de passe à l'adresse: <%= url_for :only_path => false, :host => Setting.host_name, :controller => 'my', :action => 'account' %>
|
||||||
|
<% end %>
|
|
@ -3,4 +3,5 @@
|
||||||
<% labelled_tabular_form_for :user, @user, :url => { :action => "add" } do |f| %>
|
<% labelled_tabular_form_for :user, @user, :url => { :action => "add" } do |f| %>
|
||||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||||
<%= submit_tag l(:button_create) %>
|
<%= submit_tag l(:button_create) %>
|
||||||
|
<%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %>
|
||||||
<% end %>
|
<% end %>
|
|
@ -18,3 +18,5 @@ config.action_controller.perform_caching = true
|
||||||
# Disable delivery errors if you bad email addresses should just be ignored
|
# Disable delivery errors if you bad email addresses should just be ignored
|
||||||
config.action_mailer.raise_delivery_errors = false
|
config.action_mailer.raise_delivery_errors = false
|
||||||
|
|
||||||
|
# No email in production log
|
||||||
|
config.action_mailer.logger = nil
|
||||||
|
|
|
@ -395,6 +395,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Last message
|
label_message_last: Last message
|
||||||
label_message_new: New message
|
label_message_new: New message
|
||||||
label_reply_plural: Replies
|
label_reply_plural: Replies
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: Вход
|
button_login: Вход
|
||||||
button_submit: Изпращане
|
button_submit: Изпращане
|
||||||
|
|
|
@ -395,6 +395,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Last message
|
label_message_last: Last message
|
||||||
label_message_new: New message
|
label_message_new: New message
|
||||||
label_reply_plural: Replies
|
label_reply_plural: Replies
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: Einloggen
|
button_login: Einloggen
|
||||||
button_submit: OK
|
button_submit: OK
|
||||||
|
|
|
@ -395,6 +395,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Last message
|
label_message_last: Last message
|
||||||
label_message_new: New message
|
label_message_new: New message
|
||||||
label_reply_plural: Replies
|
label_reply_plural: Replies
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: Login
|
button_login: Login
|
||||||
button_submit: Submit
|
button_submit: Submit
|
||||||
|
|
|
@ -395,6 +395,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Last message
|
label_message_last: Last message
|
||||||
label_message_new: New message
|
label_message_new: New message
|
||||||
label_reply_plural: Replies
|
label_reply_plural: Replies
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: Conexión
|
button_login: Conexión
|
||||||
button_submit: Someter
|
button_submit: Someter
|
||||||
|
|
|
@ -395,6 +395,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Dernier message
|
label_message_last: Dernier message
|
||||||
label_message_new: Nouveau message
|
label_message_new: Nouveau message
|
||||||
label_reply_plural: Réponses
|
label_reply_plural: Réponses
|
||||||
|
label_send_information: Envoyer les informations à l'utilisateur
|
||||||
|
|
||||||
button_login: Connexion
|
button_login: Connexion
|
||||||
button_submit: Soumettre
|
button_submit: Soumettre
|
||||||
|
|
|
@ -395,6 +395,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Last message
|
label_message_last: Last message
|
||||||
label_message_new: New message
|
label_message_new: New message
|
||||||
label_reply_plural: Replies
|
label_reply_plural: Replies
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: Login
|
button_login: Login
|
||||||
button_submit: Invia
|
button_submit: Invia
|
||||||
|
|
|
@ -396,6 +396,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Last message
|
label_message_last: Last message
|
||||||
label_message_new: New message
|
label_message_new: New message
|
||||||
label_reply_plural: Replies
|
label_reply_plural: Replies
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: ログイン
|
button_login: ログイン
|
||||||
button_submit: 変更
|
button_submit: 変更
|
||||||
|
|
|
@ -395,6 +395,7 @@ label_message_plural: Berichten
|
||||||
label_message_last: Laatste bericht
|
label_message_last: Laatste bericht
|
||||||
label_message_new: Nieuw bericht
|
label_message_new: Nieuw bericht
|
||||||
label_reply_plural: Antwoorden
|
label_reply_plural: Antwoorden
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: Inloggen
|
button_login: Inloggen
|
||||||
button_submit: Toevoegen
|
button_submit: Toevoegen
|
||||||
|
|
|
@ -395,6 +395,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Last message
|
label_message_last: Last message
|
||||||
label_message_new: New message
|
label_message_new: New message
|
||||||
label_reply_plural: Replies
|
label_reply_plural: Replies
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: Login
|
button_login: Login
|
||||||
button_submit: Enviar
|
button_submit: Enviar
|
||||||
|
|
|
@ -395,6 +395,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Last message
|
label_message_last: Last message
|
||||||
label_message_new: New message
|
label_message_new: New message
|
||||||
label_reply_plural: Replies
|
label_reply_plural: Replies
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: Login
|
button_login: Login
|
||||||
button_submit: Enviar
|
button_submit: Enviar
|
||||||
|
|
|
@ -398,6 +398,7 @@ label_message_plural: Messages
|
||||||
label_message_last: Last message
|
label_message_last: Last message
|
||||||
label_message_new: New message
|
label_message_new: New message
|
||||||
label_reply_plural: Replies
|
label_reply_plural: Replies
|
||||||
|
label_send_information: Send account information to the user
|
||||||
|
|
||||||
button_login: 登录
|
button_login: 登录
|
||||||
button_submit: 提交
|
button_submit: 提交
|
||||||
|
|
Loading…
Reference in New Issue