Sha256: ff82fdbaf9f67b8c107cb319ffdd7b5d5fc19ff0d5dd6209311bbad14ad4ce6f

Contents?: true

Size: 366 Bytes

Versions: 5

Compression:

Stored size: 366 Bytes

Contents

class EricWeixin::Cms::BaseController < EricWeixin::ApplicationController
  before_filter :need_login
  around_filter :round

  def round
    yield
  end

  def current_user
    return nil if session[:employee_id].blank?
    ::Personal::Employee.find(session[:employee_id])
  end

  def need_login
    redirect_to '/cms' if current_user.blank?
    return
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
eric_weixin-0.4.2 app/controllers/eric_weixin/cms/base_controller.rb
eric_weixin-0.4.1 app/controllers/eric_weixin/cms/base_controller.rb
eric_weixin-0.4.0 app/controllers/eric_weixin/cms/base_controller.rb
eric_weixin-0.3.3 app/controllers/eric_weixin/cms/base_controller.rb
eric_weixin-0.3.2 app/controllers/eric_weixin/cms/base_controller.rb