phcscriptcdnpro 28.0.0 → 29.0.0

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: c5071f55442461797ae657a0a5ffcb5d60d7457c
4
- data.tar.gz: c118484fca8da0dfd70a7b8f3ff64d463b272e44
3
+ metadata.gz: 95d7c8400569c0013941ed7c49c11dfa6ea78920
4
+ data.tar.gz: 2417f0166616ceae75a6462b20f73e69a7dbea7d
5
5
  SHA512:
6
- metadata.gz: 29bb1512268a6558cd84a5d5c01aaae6a935880ba272cac1ec7331a655181a8bd32413b7ffb127e6ae84734a951b70eb1922511285cc6aa626855668aa0c02fe
7
- data.tar.gz: 852ffbf4781840995c2094fd1d9b6e12d21a5cc3a383c82507f418885abbe341126b6c005059ee141487434ebac78eb54693b991028c589b26f94c025e94f2aa
6
+ metadata.gz: 7e19bc3a21d7af833f6c08fdf26b6e0e7c905fa8bd8fb53acd4fc6ee0bd2cef7726e265237487fc25a8816d76455df3c78a57638f5cbb6e1fdbf62881b25a872
7
+ data.tar.gz: abb44b5065b7d9cad2f2b81942e301e564b0a69d569580f06da341189d4373ff0aa2c8eeb4bbf5b80eb4c1cc111516a0f3f2ea407c2237ace3f1473806c03215
@@ -9,29 +9,6 @@ module Phcscriptcdnpro
9
9
  helper Phcnotifi::Engine.helpers
10
10
  helper Phcaccountspro::Engine.helpers
11
11
 
12
- # AuthRocket Definitions
13
- def require_user
14
- unless current_user
15
- params.permit!
16
- session[:last_url] = request.get? ? url_for(params) : url_for
17
- redirect_to new_login_url
18
- end
19
- end
20
-
21
- def current_user
22
- @_current_user ||= AuthRocket::Session.from_token(session[:ar_token]).try(:user)
23
- end
24
- helper_method :current_user
25
-
26
- def new_login_url
27
- ENV['AUTHROCKET_LOGIN_URL']
28
- end
29
- helper_method :new_login_url
30
-
31
- def authrocket_membership_info
32
- AuthRocket::Membership.all(user_id: current_user.id).first
33
- end
34
-
35
12
  # Papertrail Whodunnit Username
36
13
  def user_for_paper_trail
37
14
  # Default is: current_user rescue nil
@@ -4,8 +4,7 @@ module Phcscriptcdnpro
4
4
  class Script::AuthorsController < ApplicationController
5
5
 
6
6
  # Security & Action Filters
7
- before_action :require_user
8
- before_action :authrocket_membership_info
7
+ before_action :authenticate_user!
9
8
  before_action :set_paper_trail_whodunnit
10
9
  before_action :set_script_author, only: [:show, :edit, :update, :destroy]
11
10
 
@@ -23,6 +22,8 @@ module Phcscriptcdnpro
23
22
  # NEW - Script Author
24
23
  def new
25
24
  @script_author = Script::Author.new
25
+ @script_author.user_id = current_user.id
26
+ @script_author.org_id = current_user.org_id
26
27
  end
27
28
 
28
29
  # EDIT - Script Author
@@ -33,9 +34,7 @@ module Phcscriptcdnpro
33
34
  def create
34
35
  @script_author = Script::Author.new(script_author_params)
35
36
  @script_author.user_id = current_user.id
36
- @script_author.user_name = current_user.username
37
- @script_author.membership_id = authrocket_membership_info.id
38
- @script_author.oganization_id = authrocket_membership_info.org_id
37
+ @script_author.org_id = current_user.org_id
39
38
  if @script_author.save
40
39
  redirect_to script_authors_url, notice: 'Author was successfully created.'
41
40
  else
@@ -46,9 +45,7 @@ module Phcscriptcdnpro
46
45
  # PATCH/PUT - Script Author
47
46
  def update
48
47
  @script_author.user_id = current_user.id
49
- @script_author.user_name = current_user.username
50
- @script_author.membership_id = authrocket_membership_info.id
51
- @script_author.oganization_id = authrocket_membership_info.org_id
48
+ @script_author.org_id = current_user.org_id
52
49
  if @script_author.update(script_author_params)
53
50
  redirect_to script_authors_url, notice: 'Author was successfully updated.'
54
51
  else
@@ -4,8 +4,7 @@ module Phcscriptcdnpro
4
4
  class Script::ExtensionsController < ApplicationController
5
5
 
6
6
  # Security & Action Filters
7
- before_action :require_user
8
- before_action :authrocket_membership_info
7
+ before_action :authenticate_user!
9
8
  before_action :set_paper_trail_whodunnit
10
9
  before_action :set_script_extension, only: [:show, :edit, :update, :destroy]
11
10
 
@@ -23,6 +22,8 @@ module Phcscriptcdnpro
23
22
  # NEW - Script Extension
24
23
  def new
25
24
  @script_extension = Script::Extension.new
25
+ @script_extension.user_id = current_user.id
26
+ @script_extension.org_id = current_user.org_id
26
27
  end
27
28
 
28
29
  # EDIT - Script Extension
@@ -33,9 +34,7 @@ module Phcscriptcdnpro
33
34
  def create
34
35
  @script_extension = Script::Extension.new(script_extension_params)
35
36
  @script_extension.user_id = current_user.id
36
- @script_extension.user_name = current_user.username
37
- @script_extension.membership_id = authrocket_membership_info.id
38
- @script_extension.oganization_id = authrocket_membership_info.org_id
37
+ @script_extension.org_id = current_user.org_id
39
38
  if @script_extension.save
40
39
  redirect_to script_extensions_url, notice: 'Extension was successfully created.'
41
40
  else
@@ -46,9 +45,7 @@ module Phcscriptcdnpro
46
45
  # PATCH/PUT - Script Extension
47
46
  def update
48
47
  @script_extension.user_id = current_user.id
49
- @script_extension.user_name = current_user.username
50
- @script_extension.membership_id = authrocket_membership_info.id
51
- @script_extension.oganization_id = authrocket_membership_info.org_id
48
+ @script_extension.org_id = current_user.org_id
52
49
  if @script_extension.update(script_extension_params)
53
50
  redirect_to script_extensions_url, notice: 'Extension was successfully updated.'
54
51
  else
@@ -4,8 +4,7 @@ module Phcscriptcdnpro
4
4
  class Script::LicencesController < ApplicationController
5
5
 
6
6
  # Security & Action Filters
7
- before_action :require_user
8
- before_action :authrocket_membership_info
7
+ before_action :authenticate_user!
9
8
  before_action :set_paper_trail_whodunnit
10
9
  before_action :set_script_licence, only: [:show, :edit, :update, :destroy]
11
10
 
@@ -23,6 +22,8 @@ module Phcscriptcdnpro
23
22
  # NEW - Script Licences
24
23
  def new
25
24
  @script_licence = Script::Licence.new
25
+ @script_licence.user_id = current_user.id
26
+ @script_licence.org_id = current_user.org_id
26
27
  end
27
28
 
28
29
  # EDIT - Script Licences
@@ -33,9 +34,7 @@ module Phcscriptcdnpro
33
34
  def create
34
35
  @script_licence = Script::Licence.new(script_licence_params)
35
36
  @script_licence.user_id = current_user.id
36
- @script_licence.user_name = current_user.username
37
- @script_licence.membership_id = authrocket_membership_info.id
38
- @script_licence.oganization_id = authrocket_membership_info.org_id
37
+ @script_licence.org_id = current_user.org_id
39
38
  if @script_licence.save
40
39
  redirect_to script_licences_url, notice: 'Licence was successfully created.'
41
40
  else
@@ -46,9 +45,7 @@ module Phcscriptcdnpro
46
45
  # PATCH/PUT - Script Licences
47
46
  def update
48
47
  @script_licence.user_id = current_user.id
49
- @script_licence.user_name = current_user.username
50
- @script_licence.membership_id = authrocket_membership_info.id
51
- @script_licence.oganization_id = authrocket_membership_info.org_id
48
+ @script_licence.org_id = current_user.org_id
52
49
  if @script_licence.update(script_licence_params)
53
50
  redirect_to script_licences_url, notice: 'Licence was successfully updated.'
54
51
  else
@@ -4,8 +4,7 @@ module Phcscriptcdnpro
4
4
  class Script::ListingsController < ApplicationController
5
5
 
6
6
  # Security & Action Filters
7
- before_action :require_user
8
- before_action :authrocket_membership_info
7
+ before_action :authenticate_user!
9
8
  before_action :set_paper_trail_whodunnit
10
9
  before_action :set_script_listing, only: [:show, :edit, :update, :destroy]
11
10
 
@@ -23,6 +22,8 @@ module Phcscriptcdnpro
23
22
  # NEW - Script Listings
24
23
  def new
25
24
  @script_listing = Script::Listing.new
25
+ @script_listing.user_id = current_user.id
26
+ @script_listing.org_id = current_user.org_id
26
27
  end
27
28
 
28
29
  # EDIT - Script Listings
@@ -33,9 +34,7 @@ module Phcscriptcdnpro
33
34
  def create
34
35
  @script_listing = Script::Listing.new(script_listing_params)
35
36
  @script_listing.user_id = current_user.id
36
- @script_listing.user_name = current_user.username
37
- @script_listing.membership_id = authrocket_membership_info.id
38
- @script_listing.oganization_id = authrocket_membership_info.org_id
37
+ @script_listing.org_id = current_user.org_id
39
38
  if @script_listing.save
40
39
  redirect_to script_listings_path, notice: 'Listing was successfully created.'
41
40
  else
@@ -46,9 +45,7 @@ module Phcscriptcdnpro
46
45
  # PATCH/PUT - Script Listings
47
46
  def update
48
47
  @script_listing.user_id = current_user.id
49
- @script_listing.user_name = current_user.username
50
- @script_listing.membership_id = authrocket_membership_info.id
51
- @script_listing.oganization_id = authrocket_membership_info.org_id
48
+ @script_listing.org_id = current_user.org_id
52
49
  if @script_listing.update(script_listing_params)
53
50
  redirect_to script_listings_path, notice: 'Listing was successfully updated.'
54
51
  else
@@ -4,8 +4,7 @@ module Phcscriptcdnpro
4
4
  class Script::UrlsController < ApplicationController
5
5
 
6
6
  # Security & Action Filters
7
- before_action :require_user
8
- before_action :authrocket_membership_info
7
+ before_action :authenticate_user!
9
8
  before_action :set_paper_trail_whodunnit
10
9
  before_action :set_script_url, only: [:show, :edit, :update, :destroy]
11
10
 
@@ -25,6 +24,8 @@ module Phcscriptcdnpro
25
24
  def new
26
25
  script_listing = Script::Listing.find(params[:listing_id])
27
26
  @script_url = script_listing.urls.build
27
+ @script_url.user_id = current_user.id
28
+ @script_url.org_id = current_user.org_id
28
29
  end
29
30
 
30
31
  # EDIT - Script Athors
@@ -38,9 +39,7 @@ module Phcscriptcdnpro
38
39
  @script_listing = Script::Listing.find(params[:listing_id])
39
40
  @script_url = @script_listing.urls.create(script_url_params)
40
41
  @script_url.user_id = current_user.id
41
- @script_url.user_name = current_user.username
42
- @script_url.membership_id = authrocket_membership_info.id
43
- @script_url.oganization_id = authrocket_membership_info.org_id
42
+ @script_url.org_id = current_user.org_id
44
43
  if @script_url.save
45
44
  redirect_to script_listing_urls_path, notice: 'Author was successfully created.'
46
45
  else
@@ -51,9 +50,7 @@ module Phcscriptcdnpro
51
50
  # PATCH/PUT - Script Athors
52
51
  def update
53
52
  @script_url.user_id = current_user.id
54
- @script_url.user_name = current_user.username
55
- @script_url.membership_id = authrocket_membership_info.id
56
- @script_url.oganization_id = authrocket_membership_info.org_id
53
+ @script_url.org_id = current_user.org_id
57
54
  if @script_url.update(script_url_params)
58
55
  redirect_to script_listing_urls_path, notice: 'Author was successfully updated.'
59
56
  else
@@ -4,8 +4,7 @@ module Phcscriptcdnpro
4
4
  class Script::VersionsController < ApplicationController
5
5
 
6
6
  # Security & Action Filters
7
- before_action :require_user
8
- before_action :authrocket_membership_info
7
+ before_action :authenticate_user!
9
8
  before_action :set_paper_trail_whodunnit
10
9
  before_action :set_script_version, only: [:show, :edit, :update, :destroy]
11
10
 
@@ -23,6 +22,8 @@ module Phcscriptcdnpro
23
22
  # NEW - Script Versions
24
23
  def new
25
24
  @script_version = Script::Version.new
25
+ @script_version.user_id = current_user.id
26
+ @script_version.org_id = current_user.org_id
26
27
  end
27
28
 
28
29
  # EDIT - Script Versions
@@ -33,9 +34,7 @@ module Phcscriptcdnpro
33
34
  def create
34
35
  @script_version = Script::Version.new(script_version_params)
35
36
  @script_version.user_id = current_user.id
36
- @script_version.user_name = current_user.username
37
- @script_version.membership_id = authrocket_membership_info.id
38
- @script_version.oganization_id = authrocket_membership_info.org_id
37
+ @script_version.org_id = current_user.org_id
39
38
  if @script_version.save
40
39
  redirect_to script_versions_url, notice: 'Version was successfully created.'
41
40
  else
@@ -46,9 +45,7 @@ module Phcscriptcdnpro
46
45
  # PATCH/PUT - Script Versions
47
46
  def update
48
47
  @script_version.user_id = current_user.id
49
- @script_version.user_name = current_user.username
50
- @script_version.membership_id = authrocket_membership_info.id
51
- @script_version.oganization_id = authrocket_membership_info.org_id
48
+ @script_version.org_id = current_user.org_id
52
49
  if @script_version.update(script_version_params)
53
50
  redirect_to script_versions_url, notice: 'Version was successfully updated.'
54
51
  else
@@ -21,9 +21,7 @@ class CreatePhcscriptcdnproScriptListings < ActiveRecord::Migration[5.1]
21
21
  t.string :slug
22
22
 
23
23
  t.string :user_id
24
- t.string :user_name
25
- t.string :membership_id
26
- t.string :oganization_id
24
+ t.string :org_id
27
25
 
28
26
  t.references :version
29
27
  t.references :licence
@@ -13,9 +13,7 @@ class CreatePhcscriptcdnproScriptAuthors < ActiveRecord::Migration[5.1]
13
13
  t.string :slug
14
14
 
15
15
  t.string :user_id
16
- t.string :user_name
17
- t.string :membership_id
18
- t.string :oganization_id
16
+ t.string :org_id
19
17
 
20
18
  t.timestamps
21
19
 
@@ -10,9 +10,7 @@ class CreatePhcscriptcdnproScriptExtensions < ActiveRecord::Migration[5.1]
10
10
  t.string :slug
11
11
 
12
12
  t.string :user_id
13
- t.string :user_name
14
- t.string :membership_id
15
- t.string :oganization_id
13
+ t.string :org_id
16
14
 
17
15
  t.timestamps
18
16
 
@@ -17,9 +17,7 @@ class CreatePhcscriptcdnproScriptLicences < ActiveRecord::Migration[5.1]
17
17
  t.string :slug
18
18
 
19
19
  t.string :user_id
20
- t.string :user_name
21
- t.string :membership_id
22
- t.string :oganization_id
20
+ t.string :org_id
23
21
 
24
22
  t.timestamps
25
23
 
@@ -14,9 +14,7 @@ class CreatePhcscriptcdnproScriptUrls < ActiveRecord::Migration[5.1]
14
14
  t.string :slug
15
15
 
16
16
  t.string :user_id
17
- t.string :user_name
18
- t.string :membership_id
19
- t.string :oganization_id
17
+ t.string :org_id
20
18
 
21
19
  t.timestamps
22
20
 
@@ -8,9 +8,7 @@ class CreatePhcscriptcdnproScriptVersions < ActiveRecord::Migration[5.1]
8
8
  t.string :slug
9
9
 
10
10
  t.string :user_id
11
- t.string :user_name
12
- t.string :membership_id
13
- t.string :oganization_id
11
+ t.string :org_id
14
12
 
15
13
  t.timestamps
16
14
 
@@ -10,6 +10,7 @@ class CreatePhcscriptcdnproListingVersions < ActiveRecord::Migration[5.1]
10
10
  t.text :object, limit: TEXT_BYTES
11
11
  t.datetime :created_at
12
12
  end
13
+
13
14
  add_index :phcscriptcdnpro_listing_versions, %i(item_type item_id), :name => 'scriptcdnpro_listing_versions'
14
15
 
15
16
  end
@@ -10,6 +10,7 @@ class CreatePhcscriptcdnproScriptversionVersions < ActiveRecord::Migration[5.1]
10
10
  t.text :object, limit: TEXT_BYTES
11
11
  t.datetime :created_at
12
12
  end
13
+
13
14
  add_index :phcscriptcdnpro_scriptversion_versions, %i(item_type item_id), :name => 'scriptcdnpro_scriptversion_versions'
14
15
 
15
16
  end
@@ -10,6 +10,7 @@ class CreatePhcscriptcdnproUrlVersions < ActiveRecord::Migration[5.1]
10
10
  t.text :object, limit: TEXT_BYTES
11
11
  t.datetime :created_at
12
12
  end
13
+
13
14
  add_index :phcscriptcdnpro_url_versions, %i(item_type item_id), :name => 'scriptcdnpro_url_versions'
14
15
 
15
16
  end
@@ -10,6 +10,7 @@ class CreatePhcscriptcdnproAuthorVersions < ActiveRecord::Migration[5.1]
10
10
  t.text :object, limit: TEXT_BYTES
11
11
  t.datetime :created_at
12
12
  end
13
+
13
14
  add_index :phcscriptcdnpro_author_versions, %i(item_type item_id), :name => 'scriptcdnpro_author_versions'
14
15
 
15
16
  end
@@ -10,6 +10,7 @@ class CreatePhcscriptcdnproLicenceVersions < ActiveRecord::Migration[5.1]
10
10
  t.text :object, limit: TEXT_BYTES
11
11
  t.datetime :created_at
12
12
  end
13
+
13
14
  add_index :phcscriptcdnpro_licence_versions, %i(item_type item_id), :name => 'scriptcdnpro_licence_versions'
14
15
 
15
16
  end
@@ -1,3 +1,3 @@
1
1
  module Phcscriptcdnpro
2
- VERSION = "28.0.0"
2
+ VERSION = "29.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phcscriptcdnpro
3
3
  version: !ruby/object:Gem::Version
4
- version: 28.0.0
4
+ version: 29.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BradPotts