mirror of
https://github.com/redmine/redmine.git
synced 2026-06-17 22:20:58 +02:00
Option to generate a random password on user creation/update.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11456 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -80,6 +80,7 @@ class UsersController < ApplicationController
|
||||
|
||||
def new
|
||||
@user = User.new(:language => Setting.default_language, :mail_notification => Setting.default_notification_option)
|
||||
@user.safe_attributes = params[:user]
|
||||
@auth_sources = AuthSource.all
|
||||
end
|
||||
|
||||
@@ -96,13 +97,14 @@ class UsersController < ApplicationController
|
||||
@user.pref.save
|
||||
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
|
||||
|
||||
Mailer.account_information(@user, params[:user][:password]).deliver if params[:send_information]
|
||||
Mailer.account_information(@user, @user.password).deliver if params[:send_information]
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
flash[:notice] = l(:notice_user_successful_create, :id => view_context.link_to(@user.login, user_path(@user)))
|
||||
if params[:continue]
|
||||
redirect_to new_user_path
|
||||
attrs = params[:user].slice(:generate_password)
|
||||
redirect_to new_user_path(:user => attrs)
|
||||
else
|
||||
redirect_to edit_user_path(@user)
|
||||
end
|
||||
@@ -145,8 +147,8 @@ class UsersController < ApplicationController
|
||||
|
||||
if was_activated
|
||||
Mailer.account_activated(@user).deliver
|
||||
elsif @user.active? && params[:send_information] && !params[:user][:password].blank? && @user.auth_source_id.nil?
|
||||
Mailer.account_information(@user, params[:user][:password]).deliver
|
||||
elsif @user.active? && params[:send_information] && @user.password.present? && @user.auth_source_id.nil?
|
||||
Mailer.account_information(@user, @user.password).deliver
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
|
||||
Reference in New Issue
Block a user