Fix desktop nil theme bug and approval for new user

This commit is contained in:
Manson Wang 2013-12-04 13:43:00 +08:00
parent fda0abdd25
commit 4b169cf2e0
2 changed files with 13 additions and 0 deletions

View File

@ -168,7 +168,15 @@ class Admin::UsersNewInterfaceController < OrbitMemberController
# } # }
# @user.rebuild_sub_roles_from_attribute_values!(attribute_values) # @user.rebuild_sub_roles_from_attribute_values!(attribute_values)
# binding.pry # binding.pry
@user.confirmation_token = nil
@user.confirmed_at = Time.now
@user.approved = true
if !flash.now[:error] && @user.save if !flash.now[:error] && @user.save
desk = @user.desktop
desk.theme = DesktopTheme.first.id.to_s
desk.wallpaper = nil
desk.save!
flash[:notice] = t('create.success.user') flash[:notice] = t('create.success.user')
redirect_to :action => :index redirect_to :action => :index
else else

View File

@ -9,6 +9,11 @@ class DesktopController< ApplicationController
def index def index
@desktop = current_user.desktop @desktop = current_user.desktop
if(@desktop.theme.nil?)
@desktop.theme = DesktopTheme.first.id.to_s
@desktop.wallpaper = nil
@desktop.save!
end
@currentusername = current_user.name @currentusername = current_user.name
@currentname = current_user.first_name + current_user.last_name @currentname = current_user.first_name + current_user.last_name
@title = "Desktop - " + @currentusername @title = "Desktop - " + @currentusername