caboose-cms 0.8.68 → 0.8.69

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: f3be7648fb20dea0f63181aa3fc29816743639b3
4
- data.tar.gz: 378b44904c3a735619e44c5a150ed12ff50e4c4b
3
+ metadata.gz: 1cfc02f075a8168b8cc2a37b8d77a05dc992577e
4
+ data.tar.gz: b826855fa8d846491736f1587f3fc61350376f75
5
5
  SHA512:
6
- metadata.gz: f7e3584b65a103265aeeee1d52353053dd3d5277d552b3bc9e16a63be3e5ec03c4be2338c6d2db8787a71d246b8c8f9555784b4cb1e8390ec522518dd02b6933
7
- data.tar.gz: 03a0db1c20df423d62d674fd7c3d16f49ecff43d14b55f9267850be35c2dd91ee3f067ff1447eef5f5c99616b7438b13c7dabb3627ed264ab4d1e35ba2bf51af
6
+ metadata.gz: 448a241fe8ae7635c6bc63369316ccee561c7b6b4138d445f7408312557090e7753fde0fa4a59ddc163f5a6f4be3a6bb6c594a67cda69c568147b3853eacaf38
7
+ data.tar.gz: 81d78ea2b5d8eebab3d02ed76b5cbc4f3028abf71375a9f9a22e32e8521514b255954f46ebca68f03d701bb6f23913df2433db2948519222d5211b6420fa4982
@@ -4,14 +4,15 @@ module Caboose
4
4
 
5
5
  def authenticate(username, password, site = nil, request = nil)
6
6
  resp = StdClass.new
7
+ username = username.downcase if username
7
8
  pass = Digest::SHA1.hexdigest(Caboose::salt + password)
8
9
 
9
10
  user = nil
10
11
  if username == 'superadmin'
11
- user = User.where(:username => username).first
12
+ user = User.where("lower(username) = ?", username).first
12
13
  else
13
- user = User.where(:username => username, :site_id => site.id).first
14
- user = User.where(:email => username, :site_id => site.id).first if user.nil?
14
+ user = User.where("site_id = ? and lower(username) = ?" , site.id, username).first
15
+ user = User.where("site_id = ? and lower(email) = ?" , site.id, username).first if user.nil?
15
16
  end
16
17
 
17
18
  ll = LoginLog.new
@@ -72,6 +72,8 @@ module Caboose
72
72
  FINANCIAL_STATUS_CAPTURED = 'captured'
73
73
  FINANCIAL_STATUS_REFUNDED = 'refunded'
74
74
  FINANCIAL_STATUS_VOIDED = 'voided'
75
+ FINANCIAL_STATUS_WAIVED = 'waived'
76
+ FINANCIAL_STATUS_OVERDUE = 'overdue'
75
77
  FINANCIAL_STATUS_PAID_BY_CHECK = 'paid by check'
76
78
  FINANCIAL_STATUS_PAID_BY_OTHER_MEANS = 'paid by other means'
77
79
 
@@ -27,27 +27,21 @@ module Caboose
27
27
  :hide_prices ,
28
28
  :user_subscription_id ,
29
29
  :date_starts ,
30
- :date_ends
30
+ :date_ends
31
+
32
+ STATUS_PENDING = 'pending'
33
+ STATUS_SHIPPED = 'shipped'
31
34
 
32
35
  #
33
36
  # Scopes
34
- #
35
-
37
+ #
36
38
  scope :pending, where('status = ?', 'pending')
37
39
  scope :fulfilled, where('status = ?', 'shipped')
38
40
  scope :unfulfilled, where('status != ?', 'shipped')
39
- #
40
- # Validations
41
- #
42
-
43
- validates :status, :inclusion => {
44
- :in => ['pending', 'shipped'],
45
- :message => "%{value} is not a valid status. Must be either 'pending' or 'shipped'"
46
- }
47
41
 
48
- validates :quantity, :numericality => { :greater_than_or_equal_to => 0 }
42
+ #validates :quantity, :numericality => { :greater_than_or_equal_to => 0 }
43
+ #validate :quantity_in_stock
49
44
 
50
- validate :quantity_in_stock
51
45
  def quantity_in_stock
52
46
  errors.add(:base, "There #{self.variant.quantity_in_stock > 1 ? 'are' : 'is'} only #{self.variant.quantity_in_stock} left in stock.") if self.variant.quantity_in_stock - self.quantity < 0
53
47
  end
@@ -864,7 +864,7 @@ class Caboose::Schema < Caboose::Utilities::Schema
864
864
  [ :payment_profile_id , :string ],
865
865
  [ :locked , :boolean , { :default => false }],
866
866
  [ :authnet_customer_profile_id , :string ],
867
- [ :authnet_payment_profile_id , :string ],
867
+ [ :authnet_payment_profile_id , :string ],
868
868
  [ :valid_authnet_payment_id , :boolean , { :default => false }],
869
869
  [ :stripe_customer_id , :string ],
870
870
  [ :card_last4 , :string ],
@@ -9,12 +9,15 @@
9
9
  <%
10
10
  tabs = {
11
11
  'General' => "/admin/users/#{@edituser.id}",
12
- 'Payment Method' => "/admin/users/#{@edituser.id}/payment-method",
13
12
  'Login Logs' => "/admin/login-logs?user_id=#{@edituser.id}",
14
13
  'Password' => "/admin/users/#{@edituser.id}/password",
15
14
  'Roles' => "/admin/users/#{@edituser.id}/roles",
16
15
  'Delete' => "/admin/users/#{@edituser.id}/delete"
17
16
  }
17
+ if @site.use_store
18
+ arr = tabs.to_a.insert(1, ['Payment Method', "/admin/users/#{@edituser.id}/payment-method"])
19
+ tabs = Hash[arr]
20
+ end
18
21
  tabs = Caboose.plugin_hook('admin_user_tabs', tabs, @edituser, @site)
19
22
  %>
20
23
  <% tabs.each do |text, href| %>
@@ -23,4 +26,4 @@ tabs = Caboose.plugin_hook('admin_user_tabs', tabs, @edituser, @site)
23
26
  <% end %>
24
27
  <li class='back'><input type='button' value='< Back' onclick="window.location='/admin/users';" /></li>
25
28
  </ul>
26
- <div id='content2'>
29
+ <div id='content2'>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.8.68'
2
+ VERSION = '0.8.69'
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.8.68
4
+ version: 0.8.69
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry