Integration of Ray' modifications

This commit is contained in:
chris2tof committed 2011-11-17 20:02:58 +08:00
1 parent c4810274ec
commit 861237d65b
39 files changed
+804 -175

No files matched your search

@@ -1,6 +1,6 @@
class Admin::UserAttributesController < ApplicationController
layout "admin"
layout "member"
before_filter :authenticate_user!
def index
@@ -1,6 +1,6 @@
class Admin::UserInfoModelsController < ApplicationController
layout "admin"
layout "member"
before_filter :authenticate_user!
before_filter :is_admin?
before_filter :set_attribute, :only => [:index, :show, :new, :edit]
@@ -1,6 +1,6 @@
class Admin::UserRoleModelsController < ApplicationController
layout "admin"
layout "member"
before_filter :authenticate_user!
before_filter :is_admin?
before_filter :set_attribute, :only => [:index, :show, :new, :edit]
@@ -1,6 +1,6 @@
class Panel::UsersController < ApplicationController
class Admin::UsersController < ApplicationController
layout "panel"
layout "member"
before_filter :authenticate_user!
def index
@@ -28,7 +28,7 @@ class Panel::UsersController < ApplicationController
user_role.save
user_role.attribute_values.each(&:save)
end
flash[:notice] = t('panel.create_success_user')
flash[:notice] = t('admin.create_success_user')
redirect_to :action => :index
else
render :action => :new
@@ -48,10 +48,10 @@ class Panel::UsersController < ApplicationController
@user.avatar = params[:file] if params[:file]
if @user.id.to_s.eql?(session['warden.user.user.key'][1].to_s) && @user.admin != params[:user][:admin].to_i.to_b
flash.now[:error] = t('panel.cant_revoke_self_admin')
flash.now[:error] = t('admin.cant_revoke_self_admin')
end
if !flash[:error] && @user.update_attributes(params[:user])
flash[:notice] = t('panel.update_success_user')
flash[:notice] = t('admin.update_success_user')
redirect_to :action => :index
else
get_info_role_models
@@ -61,7 +61,7 @@ class Panel::UsersController < ApplicationController
def destroy
if params[:id].eql?(session['warden.user.user.key'][1].to_s)
flash[:error] = t('panel.cant_delete_self')
flash[:error] = t('admin.cant_delete_self')
else
@user = User.find(params[:id])
@user.destroy