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:
Jean-Philippe Lang 2007-05-27 10:57:13 +00:00
parent f12315075f
commit f04225321c
17 changed files with 43 additions and 2 deletions

View File

@ -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

View File

@ -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)

View File

@ -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 %>

View File

@ -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 %>

View File

@ -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 %>
<%= check_box_tag 'send_information', 1, true %> <%= l(:label_send_information) %>
<% end %>

View File

@ -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

View File

@ -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: Изпращане

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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: 変更

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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: 提交