summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/users_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 584d08c..ea8ed69 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -22,6 +22,12 @@ class UsersController < ApplicationController
def create
@user = @parent.users.build(params[:user])
if @user.save
+ if VoicemailAccount.where(:name => "user_#{@user.user_name}").count == 0
+ @user.voicemail_accounts.create(:name => "user_#{@user.user_name}", :active => true )
+ else
+ @user.voicemail_accounts.create(:active => true)
+ end
+
if @parent.class == Tenant
@parent.tenant_memberships.create(:user => @user)
if @parent.user_groups.exists?(:name => 'Users')