ishapi 0.1.8.284 → 0.1.8.285

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
  SHA256:
3
- metadata.gz: c411df0109381820514d8f44a8103db30655c37d7d05127e4d21964f11ea3a6e
4
- data.tar.gz: 400b2dbad6623b0d540ab1f028aa3bbdc9cc8c7275932b1d93fde792118aae84
3
+ metadata.gz: 76230270153711c6dff30ead344469cd8df42e084832e931351a291879ea3557
4
+ data.tar.gz: 361989859dd3015a7d93de1348301e4038b5709adac5736c22820e7d413fdaa4
5
5
  SHA512:
6
- metadata.gz: 7991ffd5133d13295ef165a51de877a251e58f2a8f10f4a7dada7daa9a5ac0c8fc2d0efeb67c065765f4c551175fc58a579d424b51fe4a1ad05afa8ee52ff4a9
7
- data.tar.gz: 13f137ba7124972fa7644ea94ef4b036c90e40d06aa753628992ca430189f0a7829378c09af03f018f1b0587410e223b1a5eeebec27b7535b38f3be96000ac1e
6
+ metadata.gz: 60e0f42fa6405907798a1cd4d24633059768206fd26203101099cf3b1e8bba2f9bc089a318f7b2112fbfbe1432a88563a0e80126b1e17f97b9243d73d414dd1e
7
+ data.tar.gz: ccd7a99f503e51818998b2629bd7bd8f02b365db37a942550c9129bdf2c92e4b8bd8d9ebd54e085a3331f5fb292f57b1576f33cf785d141609a54e221d3e3487
@@ -60,6 +60,9 @@ class ::Ishapi::ApplicationController < ActionController::Base
60
60
 
61
61
  end
62
62
 
63
+ ##
64
+ ## private
65
+ ##
63
66
  private
64
67
 
65
68
  ## This returns an empty profile if not logged in
@@ -0,0 +1,29 @@
1
+ require_dependency "ishapi/application_controller"
2
+
3
+ module ::Ishapi
4
+ class EmailUnsubscribesController < ApplicationController
5
+
6
+ layout false
7
+
8
+ def create
9
+ authorize! :open_permission, ::Ishapi
10
+ @lead = Lead.find params[:lead_id]
11
+
12
+ if( !params[:token] ||
13
+ @lead.unsubscribe_token != params[:token] )
14
+ render code: 400, message: "We're sorry, but something went wrong. Please try again later."
15
+ return
16
+ end
17
+
18
+ @unsubscribe = ::Ish::EmailUnsubscribe.find_or_create_by({
19
+ lead_id: params[:lead_id],
20
+ template_id: params[:template_id],
21
+ campaign_id: params[:campaign_id],
22
+ })
23
+ @unsubscribe.update_attributes({
24
+ unsubscribed_at: Time.now,
25
+ })
26
+ end
27
+ end
28
+
29
+ end
@@ -7,7 +7,7 @@ module Ishapi
7
7
  before_action :check_jwt
8
8
 
9
9
  def index
10
- @galleries = Gallery.all
10
+ @galleries = Gallery.all.public
11
11
  authorize! :index, Gallery
12
12
  if params[:domain]
13
13
  @site = Site.find_by( :domain => params[:domain], :lang => 'en' )
@@ -17,8 +17,8 @@ module Ishapi
17
17
  end
18
18
 
19
19
  def show
20
- @gallery = ::Gallery.unscoped.where( slug: params[:slug] ).first
21
- @gallery ||= ::Gallery.unscoped.where( id: params[:slug] ).first
20
+ @gallery = ::Gallery.unscoped.where( slug: params[:slug] ).first
21
+ @gallery ||= ::Gallery.unscoped.where( id: params[:slug] ).first
22
22
  authorize! :show, @gallery
23
23
 
24
24
  @photos = @gallery.photos.order_by( ordering: :asc )
@@ -0,0 +1,23 @@
1
+ require_dependency "ishapi/application_controller"
2
+
3
+ module Ishapi
4
+ class LeadActionsController < ApplicationController
5
+
6
+ def create
7
+ if !params[:lead_id]
8
+ render json: { status: :ok }
9
+ return
10
+ end
11
+ tmpl = Office::LeadActionTemplate.find( params[:tmpl_id] )
12
+ puts! tmpl, 'tmpl'
13
+ lead_action = Office::LeadAction.find_or_create_by({
14
+ lead_id: params[:lead_id],
15
+ tmpl_id: params[:tmpl_id],
16
+ })
17
+ lead_action.params = params.to_json
18
+ lead_action.save
19
+ render json: { status: :ok, message: 'saved' }
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,27 @@
1
+ require_dependency "ishapi/application_controller"
2
+
3
+ module Ishapi
4
+ class ObfuscatedRedirectsController < ApplicationController
5
+
6
+ def show
7
+ @obf = Office::ObfuscatedRedirect.find params[:id]
8
+ puts! @obf, '@obf'
9
+ authorize! :show, @obf
10
+
11
+ visit_time = Time.now
12
+ @obf.update_attributes({
13
+ visited_at: visit_time,
14
+ visits: @obf.visits + [ visit_time ],
15
+ })
16
+
17
+ if Rails.application.config.debug
18
+ render and return
19
+ end
20
+
21
+ redirect_to @obf.to
22
+
23
+ end
24
+
25
+ end
26
+ end
27
+
@@ -9,7 +9,7 @@ module Ishapi
9
9
 
10
10
  def index
11
11
  authorize! :index, Video
12
- @videos = Video.all
12
+ @videos = Video.all.public
13
13
  @videos = @videos.page( params[:videos_page] ).per( 10 )
14
14
  end
15
15
 
@@ -7,7 +7,7 @@ class Ishapi::Ability
7
7
  ##
8
8
  ## super user
9
9
  ##
10
- if %w| piousbox@gmail.com |.include?( user_profile.email )
10
+ if %w| piousbox@gmail.com |.include?( user_profile&.email )
11
11
  can [ :manage ], :all
12
12
  end
13
13
 
@@ -18,9 +18,9 @@ class Ishapi::Ability
18
18
 
19
19
  can [ :my_index ], Gallery
20
20
  can [ :show ], Gallery do |gallery|
21
- gallery.user_profile == user_profile || # my own
22
- (!gallery.is_trash && gallery.is_public ) || # public
23
- (!gallery.is_trash && gallery.shared_profiles.include?( user_profile ) ) # shared with me
21
+ ( gallery.user_profile == user_profile ) || # my own
22
+ (!gallery.is_trash && gallery.is_public ) || # public
23
+ (!gallery.is_trash && gallery.shared_profiles.include?( user_profile ) ) # shared with me
24
24
  end
25
25
 
26
26
  can [ :do_purchase ], ::Gameui
@@ -29,7 +29,7 @@ class Ishapi::Ability
29
29
  end
30
30
 
31
31
  can [ :destroy ], Newsitem do |n|
32
- n.map.creator_profile.id == user_profile.id
32
+ n.map.creator_profile.id.to_s == user_profile.id.to_s
33
33
  end
34
34
 
35
35
  can [ :create, :unlock ], ::Ish::Payment
@@ -58,10 +58,16 @@ class Ishapi::Ability
58
58
  p.user.id.to_s == user.id.to_s
59
59
  end
60
60
 
61
+
62
+ ##
63
+ ## E
64
+ ##
65
+ can [ :create ], Ish::EmailUnsubscribe
66
+
61
67
  #
62
68
  # G
63
69
  #
64
- can [ :index ], Gallery
70
+ # can [ :index ], Gallery
65
71
  can [ :show ], Gallery do |gallery|
66
72
  gallery.is_public && !gallery.is_trash
67
73
  end
@@ -85,8 +91,12 @@ class Ishapi::Ability
85
91
  #
86
92
  # O
87
93
  #
94
+
95
+ can [ :show ], ::Office::ObfuscatedRedirect
96
+
88
97
  can [ :view_chain ], ::Iro::OptionPriceItem
89
98
 
99
+
90
100
  #
91
101
  # P
92
102
  #
@@ -111,7 +121,7 @@ class Ishapi::Ability
111
121
  #
112
122
  # V
113
123
  #
114
- can [ :index, :my_index ], Video
124
+ # can [ :index, :my_index ], Video
115
125
  can [ :show ], Video do |video|
116
126
  video.is_public
117
127
  end
@@ -0,0 +1,2 @@
1
+
2
+ Thanks! You have been unsubscribed.
@@ -0,0 +1,4 @@
1
+
2
+ = link_to @obf.to, @obf.to
3
+ %br
4
+ = @obf.inspect
data/config/routes.rb CHANGED
@@ -1,10 +1,11 @@
1
1
 
2
2
  Ishapi::Engine.routes.draw do
3
3
 
4
- root :to => 'application#home'
5
- post 'home', :to => 'application#home'
4
+ root to: 'application#home'
5
+ post 'home', to: 'application#home'
6
+
7
+ ## E
6
8
 
7
- # E
8
9
  post 'email_messages', to: 'email_messages#receive'
9
10
  get 'email_messages/:id', to: 'email_messages#show', as: :email_message
10
11
 
@@ -13,7 +14,10 @@ Ishapi::Engine.routes.draw do
13
14
  delete 'email_conversations', to: 'email_conversations#delete'
14
15
  post 'email_conversations/rmtag/:emailtag', to: 'email_conversations#rmtag'
15
16
 
16
- # G
17
+ get 'email_unsubscribes', to: 'email_unsubscribes#create'
18
+
19
+ ## G
20
+
17
21
  get 'galleries', :to => 'galleries#index'
18
22
  post 'galleries', :to => 'galleries#index'
19
23
  get 'galleries/view/:slug', :to => 'galleries#show'
@@ -28,9 +32,12 @@ Ishapi::Engine.routes.draw do
28
32
  get 'leadsets', to: 'leadsets#index'
29
33
  delete 'leadsets', to: 'leadsets#destroy'
30
34
 
35
+ get 'lead_actions', to: 'lead_actions#create', as: :lead_actions
31
36
  get 'locations/show/:slug', to: 'locations#show'
32
37
  resources :locations
33
38
 
39
+ ## M
40
+
34
41
  get 'maps', to: 'maps#index'
35
42
  get 'maps/view/:slug', to: 'maps#show'
36
43
  get 'markers/view/:slug', to: 'maps#show_marker'
@@ -47,6 +54,8 @@ Ishapi::Engine.routes.draw do
47
54
 
48
55
  ## O
49
56
 
57
+ get '/obf/:id', to: 'obfuscated_redirects#show', as: :obf
58
+
50
59
  # resources :option_price_items
51
60
  get 'option_price_items/view-by/symbol/:symbol', to: 'option_price_items#view_by_symbol', :constraints => { :symbol => /[^\/]+/ } ## the symbol is detailed eg 'GME_011924P30'
52
61
  get 'option_price_items/index1', to: 'option_price_items#index', defaults: { kind: 'kind-1' }
@@ -74,7 +83,7 @@ Ishapi::Engine.routes.draw do
74
83
  get 'exception', to: 'application#exception'
75
84
 
76
85
  post 'users/fb_sign_in', to: 'users#fb_sign_in'
77
- get 'users/me', to: 'users#account'
86
+ get 'users/me', to: 'users#account', as: :users_dashboard
78
87
  post 'users/profile', to: 'users#show' ## @TODO: change, this makes no sense
79
88
  post 'users/profile/update', to: 'user_profiles#update'
80
89
  get 'users/profile', to: 'users#show' # @TODO: only for testing! accessToken must be hidden
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ishapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.284
4
+ version: 0.1.8.285
5
5
  platform: ruby
6
6
  authors:
7
7
  - piousbox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-16 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -212,9 +212,11 @@ files:
212
212
  - app/controllers/ishapi/email_contexts_controller.rb
213
213
  - app/controllers/ishapi/email_conversations_controller.rb
214
214
  - app/controllers/ishapi/email_messages_controller.rb
215
+ - app/controllers/ishapi/email_unsubscribes_controller.rb
215
216
  - app/controllers/ishapi/galleries_controller.rb
216
217
  - app/controllers/ishapi/gameui_controller.rb
217
218
  - app/controllers/ishapi/invoices_controller.rb
219
+ - app/controllers/ishapi/lead_actions_controller.rb
218
220
  - app/controllers/ishapi/leads_controller.rb
219
221
  - app/controllers/ishapi/leadsets_controller.rb
220
222
  - app/controllers/ishapi/locations_controller.rb
@@ -223,6 +225,7 @@ files:
223
225
  - app/controllers/ishapi/my/reports_controller.rb
224
226
  - app/controllers/ishapi/my/videos_controller.rb
225
227
  - app/controllers/ishapi/newsitems_controller.rb
228
+ - app/controllers/ishapi/obfuscated_redirects_controller.rb
226
229
  - app/controllers/ishapi/option_price_items_controller.rb
227
230
  - app/controllers/ishapi/order_items_controller.rb
228
231
  - app/controllers/ishapi/orders_controller.rb
@@ -248,6 +251,7 @@ files:
248
251
  - app/views/ishapi/application_mailer/forwarder_notify.html.erb
249
252
  - app/views/ishapi/email_contexts/summary.csv.erb
250
253
  - app/views/ishapi/email_messages/show.haml
254
+ - app/views/ishapi/email_unsubscribes/create.haml
251
255
  - app/views/ishapi/galleries/_index.jbuilder
252
256
  - app/views/ishapi/galleries/_show.jbuilder
253
257
  - app/views/ishapi/galleries/index.jbuilder
@@ -274,6 +278,7 @@ files:
274
278
  - app/views/ishapi/newsitems/_show.haml
275
279
  - app/views/ishapi/newsitems/_show.haml-trash
276
280
  - app/views/ishapi/newsitems/index.jbuilder
281
+ - app/views/ishapi/obfuscated_redirects/show.haml
277
282
  - app/views/ishapi/option_price_items/index.jbuilder
278
283
  - app/views/ishapi/option_price_items/view.jbuilder
279
284
  - app/views/ishapi/orders/_item.jbuilder