caboose-cms 0.5.176 → 0.5.177

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODY1NTkwODZhZWFhNDJlMDJkYWE1OGY5NTA4NDViMGM4NWU3OGJkZQ==
4
+ ODg4ZjY4YzRiMmJiMGE1MmVlMThjZThhZjhhNjEyNWY4OTMxMWM5Nw==
5
5
  data.tar.gz: !binary |-
6
- YzE0M2EwOTJhYjdhYmZjZWM4NTYyZjdkMWJmMWNjYjdkYzNiMTc2ZQ==
6
+ ZTYyYTJjYzE4M2M3ZDhhYjA2NTg3OGNjZDU2ZTUxODMyYjgxZjYxYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzVhYWExY2M0YzIxZDA0YWYyYzdjM2VmZGQ1ZjEzNmM4MjJkMTU1NGFlMDIz
10
- ZDcwOWY2NzA5MWJlYzg2NDA3YjhhMTM2MTg1MjU1ODBiOWE0MmMxOWUyODgx
11
- ZTM5ZDBlNzRjMmRkNDI2ODY0NmY3NzhkZDNmNWNhYzM3OWE0YzQ=
9
+ ODkyMDJjZGM1N2EzZmE1ZjE4MGE0ZWIxMGIzNmY2YWFlMTliZWYxMzZlNmRh
10
+ YjNjNmIwOTk5MmQ5NWVjNDc3MmQ0YTc5NzA5MzdjYTYwYjlmNmVmYmFiZDRl
11
+ ZDcwMTVkMWIzNTZlODc4YjEzY2ZjMGNmOGM4ZWNhNmI1YmYzOWI=
12
12
  data.tar.gz: !binary |-
13
- MmU2M2JmMzI1OWZjYjFhYWU5NTY4NmEyNjEwNDZkZjcwNTA0OTg2MWFkYWVl
14
- YmI5ZDdjZGE2YzRjZmVhMjAyZTAyMTkwOWE2M2UyNmRhM2JkY2IzNTY4ZmJj
15
- YzM4MjdiYTdhYTM2YmQ0ZTk5ZmExZWIyZjg2Y2E5ZThjM2QzMjE=
13
+ NzM2YTNjMWEzNTYwM2Q2YjY0YmI1MjkyOTRkNzM1MGIzZDRkNDhiY2ZmYmQx
14
+ NTkwYjdkODhjMTQyYmJhNDVhZWIxMGViMzFkOGY0YzlhY2VlZmMxODY1NWI5
15
+ NWFkNDA0YjYxMjQ1N2E0ZDc2ZGVjZjM1NDZmMjU0NDM4YjQ3YjU=
@@ -14,8 +14,8 @@ module Caboose
14
14
  # Find the page with an exact URI match
15
15
  page = Page.page_with_uri(request.host_with_port, request.fullpath, false)
16
16
 
17
- # Make sure we're not under construction
18
- d = Caboose::Domain.where(:domain => request.host_with_port).first
17
+ # Make sure we're not under construction or on a forwarded domain
18
+ d = Caboose::Domain.where(:domain => request.host_with_port).first
19
19
  if d.nil?
20
20
  Caboose.log("Could not find domain for #{request.host_with_port}\nAdd this domain to the caboose site.")
21
21
  elsif d.under_construction == true
@@ -25,6 +25,17 @@ module Caboose
25
25
  render :file => 'caboose/application/under_construction', :layout => false
26
26
  end
27
27
  return
28
+ # See if we're on a forwarding domain
29
+ elsif !d.primary && d.forward_to_primary
30
+ pd = d.site.primary_domain
31
+ if pd
32
+ url = "#{request.protocol}#{pd.domain}"
33
+ if request.fullpath && request.fullpath.strip.length > 0 && request.fullpath.strip != '/'
34
+ url << request.fullpath
35
+ end
36
+ redirect_to url
37
+ return
38
+ end
28
39
  else
29
40
  #Caboose.log(request.inspect)
30
41
  end
@@ -3,6 +3,6 @@ class Caboose::Domain < ActiveRecord::Base
3
3
  self.table_name = "domains"
4
4
 
5
5
  belongs_to :site, :class_name => 'Caboose::Site'
6
- attr_accessible :id, :site_id, :domain, :primary, :under_construction
6
+ attr_accessible :id, :site_id, :domain, :primary, :under_construction, :forward_to_primary
7
7
 
8
8
  end
@@ -269,7 +269,8 @@ class Caboose::Schema < Caboose::Utilities::Schema
269
269
  [ :site_id , :integer ],
270
270
  [ :domain , :string ],
271
271
  [ :primary , :boolean, { :default => false }],
272
- [ :under_construction , :boolean, { :default => false }]
272
+ [ :under_construction , :boolean, { :default => false }],
273
+ [ :forward_to_primary , :boolean, { :default => false }]
273
274
  ],
274
275
  Caboose::GiftCard => [
275
276
  [ :site_id , :integer ],
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.5.176'
2
+ VERSION = '0.5.177'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.176
4
+ version: 0.5.177
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry