caboose-cms 0.7.60 → 0.7.61
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dd0c8df55ed44f2cf96ae3a6bcf5f0880bcf0e1
|
4
|
+
data.tar.gz: 5e9eefed13aadc1df28ad230b9a76477140a0b46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8be4e56bcd72b88986b62097994deab1036f395080a264de958c30846918520b2ceb53fec6054908ef663a76ebb4bc840cd9e59f533c609a0fbfe0d029f6b776
|
7
|
+
data.tar.gz: 485e9fdc38ad15974a12bba7ce5bbe7859365d1793a653240282b466477ad005fe2e13b6b5c815ddc088b81b10f99f292799543acf0f9cac2ee92579fbd0b59a
|
@@ -16,16 +16,19 @@ module Caboose
|
|
16
16
|
@use_page_cache = !request.fullpath.starts_with?('/admin')
|
17
17
|
|
18
18
|
# Get the site we're working with
|
19
|
-
@domain = Domain.where(:domain => request.host_with_port).first
|
20
|
-
@site = @domain ? @domain.site : nil
|
19
|
+
@domain = Domain.where(:domain => request.host_with_port).first
|
20
|
+
@site = @domain ? @domain.site : nil
|
21
|
+
if @domain.nil? || @site.nil?
|
22
|
+
Caboose.log("Error: No site configured for #{request.host_with_port}")
|
23
|
+
end
|
21
24
|
|
22
25
|
# Set the site in any mailers
|
23
26
|
CabooseMailer.site = @site
|
24
27
|
|
25
28
|
# Make sure someone is logged in
|
26
|
-
if !logged_in?
|
27
|
-
elo = User.
|
28
|
-
login_user(elo)
|
29
|
+
if !logged_in? && @site
|
30
|
+
elo = User.logged_out_user(@site.id)
|
31
|
+
login_user(elo) if elo
|
29
32
|
end
|
30
33
|
|
31
34
|
session['use_redirect_urls'] = true if session['use_redirect_urls'].nil?
|
@@ -138,8 +141,8 @@ module Caboose
|
|
138
141
|
# Returns whether or not a user is logged in
|
139
142
|
def logged_in?
|
140
143
|
validate_token
|
141
|
-
validate_cookie
|
142
|
-
return true if !session["app_user"].nil? && session["app_user"] != false && session["app_user"].id != -1 && session["app_user"].id != User
|
144
|
+
validate_cookie
|
145
|
+
return true if !session["app_user"].nil? && session["app_user"] != false && session["app_user"].id != -1 && session["app_user"].id != User.logged_out_user_id(@site.id)
|
143
146
|
return false
|
144
147
|
end
|
145
148
|
|
@@ -157,11 +160,13 @@ module Caboose
|
|
157
160
|
end
|
158
161
|
|
159
162
|
# Checks to see if a remember me cookie value is present.
|
160
|
-
def validate_cookie
|
161
|
-
if cookies[:caboose_user_id]
|
162
|
-
user = User.
|
163
|
-
|
164
|
-
|
163
|
+
def validate_cookie
|
164
|
+
if cookies[:caboose_user_id]
|
165
|
+
user = User.where(:id => cookies[:caboose_user_id]).first
|
166
|
+
if user
|
167
|
+
login_user(user)
|
168
|
+
return true
|
169
|
+
end
|
165
170
|
end
|
166
171
|
return false
|
167
172
|
end
|
data/app/models/caboose/block.rb
CHANGED
@@ -117,6 +117,7 @@ class Caboose::Block < ActiveRecord::Base
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def render(block, options)
|
120
|
+
#Caboose.log("block.full_name = #{block.full_name}")
|
120
121
|
#Caboose.log("block.render\nself.id = #{self.id}\nblock = #{block}\nblock.full_name = #{block.full_name}\noptions.class = #{options.class}\noptions = #{options}")
|
121
122
|
if block && block.is_a?(String)
|
122
123
|
#Caboose.log("Block #{block} is a string, finding block object... self.id = #{self.id}")
|
@@ -232,7 +233,7 @@ class Caboose::Block < ActiveRecord::Base
|
|
232
233
|
"../../app/views/caboose/blocks/#{block.block_type.field_type}",
|
233
234
|
"caboose/blocks/#{full_name}",
|
234
235
|
"caboose/blocks/#{block.block_type.name}",
|
235
|
-
"caboose/blocks/#{block.block_type.field_type}"
|
236
|
+
"caboose/blocks/#{block.block_type.field_type}"
|
236
237
|
]
|
237
238
|
#Caboose.log(arr)
|
238
239
|
str = self.render_helper(view, options2, block, full_name, arr, 0)
|
@@ -246,7 +247,7 @@ class Caboose::Block < ActiveRecord::Base
|
|
246
247
|
begin
|
247
248
|
str = view.render(:partial => arr[i], :locals => options)
|
248
249
|
#Caboose.log("Level #{i+1} for #{full_name}: Found partial #{arr[i]}")
|
249
|
-
rescue ActionView::MissingTemplate => ex
|
250
|
+
rescue ActionView::MissingTemplate => ex
|
250
251
|
#Caboose.log("Level #{i+1} for #{full_name}: #{ex.message}")
|
251
252
|
str = render_helper(view, options, block, full_name, arr, i+1)
|
252
253
|
rescue Exception => ex
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.61
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|