Commit f0422532 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

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
parent f1231507
......@@ -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]) }
@user.custom_values = @custom_values
if @user.save
Mailer.deliver_account_information(@user, params[:password]) if params[:send_information]
flash[:notice] = l(:notice_successful_create)
redirect_to :action => 'list'
end
......
......@@ -17,6 +17,14 @@
class Mailer < ActionMailer::Base
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)
set_language_if_valid(Setting.default_language)
......
<% 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 %>
<% 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| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<% end %>
\ No newline at end of file
<%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %>
<% end %>
......@@ -17,4 +17,6 @@ config.action_controller.perform_caching = true
# Disable delivery errors if you bad email addresses should just be ignored
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_new: New message
label_reply_plural: Replies
label_send_information: Send account information to the user
button_login: Вход
button_submit: Изпращане
......
......@@ -395,6 +395,7 @@ label_message_plural: Messages
label_message_last: Last message
label_message_new: New message
label_reply_plural: Replies
label_send_information: Send account information to the user
button_login: Einloggen
button_submit: OK
......
......@@ -395,6 +395,7 @@ label_message_plural: Messages
label_message_last: Last message
label_message_new: New message
label_reply_plural: Replies
label_send_information: Send account information to the user
button_login: Login
button_submit: Submit
......
......@@ -395,6 +395,7 @@ label_message_plural: Messages
label_message_last: Last message
label_message_new: New message
label_reply_plural: Replies
label_send_information: Send account information to the user
button_login: Conexión
button_submit: Someter
......
......@@ -395,6 +395,7 @@ label_message_plural: Messages
label_message_last: Dernier message
label_message_new: Nouveau message
label_reply_plural: Réponses
label_send_information: Envoyer les informations à l'utilisateur
button_login: Connexion
button_submit: Soumettre
......
......@@ -395,6 +395,7 @@ label_message_plural: Messages
label_message_last: Last message
label_message_new: New message
label_reply_plural: Replies
label_send_information: Send account information to the user
button_login: Login
button_submit: Invia
......
......@@ -396,6 +396,7 @@ label_message_plural: Messages
label_message_last: Last message
label_message_new: New message
label_reply_plural: Replies
label_send_information: Send account information to the user
button_login: ログイン
button_submit: 変更
......
......@@ -395,6 +395,7 @@ label_message_plural: Berichten
label_message_last: Laatste bericht
label_message_new: Nieuw bericht
label_reply_plural: Antwoorden
label_send_information: Send account information to the user
button_login: Inloggen
button_submit: Toevoegen
......
......@@ -395,6 +395,7 @@ label_message_plural: Messages
label_message_last: Last message
label_message_new: New message
label_reply_plural: Replies
label_send_information: Send account information to the user
button_login: Login
button_submit: Enviar
......
......@@ -395,6 +395,7 @@ label_message_plural: Messages
label_message_last: Last message
label_message_new: New message
label_reply_plural: Replies
label_send_information: Send account information to the user
button_login: Login
button_submit: Enviar
......
......@@ -398,6 +398,7 @@ label_message_plural: Messages
label_message_last: Last message
label_message_new: New message
label_reply_plural: Replies
label_send_information: Send account information to the user
button_login: 登录
button_submit: 提交
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment