Commit 7c1a62522b51550e16f749895e7772bd1f2cbcfc

Authored by Karpikau Andrei
1 parent 450a5ae0

check private page

... ... @@ -10,8 +10,8 @@ module Kanjai
10 10 #expires_in 10.minutes, :public => true
11 11 if @page_data
12 12 if @page_data.page.private_flag == true
13   - if class_exists?('UserSession')
14   - unless UserSession.current_user
  13 + if defined?(warden).to_s == 'method'
  14 + if warden.user.nil?
15 15 render :template => 'kanjai/shared/401', status: 401, layout: false and return
16 16 end
17 17 end
... ... @@ -19,8 +19,8 @@ module Kanjai
19 19 #look - exist template or not for page
20 20 if @page_data.page.page_template
21 21 use_cache = true
22   - if class_exists?('UserSession')
23   - if UserSession.current_user
  22 + if defined?(warden).to_s == 'method'
  23 + if warden.user.present?
24 24 use_cache = false
25 25 end
26 26 end
... ...
1 1 module Kanjai
2   - VERSION = "0.0.107"
  2 + VERSION = "0.0.108"
3 3 end
... ...