Add code in register method. Example bellow use 72 as default group. You can find the number in the URL if you log into the redmine web UI with an admin account, and go to Administration->Groups.
After changes you must restart redmine daemon, e.g. httpd.
# User self-registration
def register
(redirect_to(home_url); return) unless
Setting.self_registration? || session[:auth_source_registration]
if request.get?
session[:auth_source_registration] = nil
@user = User.new(:language =>
current_language.to_s)
else
user_params = params[:user] || {}
@user = User.new
@user.safe_attributes = user_params
@user.pref.attributes = params[:pref] if
params[:pref]
@user.admin = false
@user.register
if session[:auth_source_registration]
@user.activate
@user.login =
session[:auth_source_registration][:login]
@user.auth_source_id =
session[:auth_source_registration][:auth_source_id]
if @user.save
session[:auth_source_registration] =
nil
self.logged_user = @user
#my def group
group = Group.find(72)
group.users << @user
#my def group
flash[:notice] =
l(:notice_account_activated)
redirect_to my_account_path
end
else
@user.login = params[:user][:login]