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 +4 -4
- data/app/controllers/phcscriptcdnpro/application_controller.rb +0 -23
- data/app/controllers/phcscriptcdnpro/script/authors_controller.rb +5 -8
- data/app/controllers/phcscriptcdnpro/script/extensions_controller.rb +5 -8
- data/app/controllers/phcscriptcdnpro/script/licences_controller.rb +5 -8
- data/app/controllers/phcscriptcdnpro/script/listings_controller.rb +5 -8
- data/app/controllers/phcscriptcdnpro/script/urls_controller.rb +5 -8
- data/app/controllers/phcscriptcdnpro/script/versions_controller.rb +5 -8
- data/db/migrate/20160821183652_create_phcscriptcdnpro_script_listings.rb +1 -3
- data/db/migrate/20160821183714_create_phcscriptcdnpro_script_authors.rb +1 -3
- data/db/migrate/20160821183735_create_phcscriptcdnpro_script_extensions.rb +1 -3
- data/db/migrate/20160821183805_create_phcscriptcdnpro_script_licences.rb +1 -3
- data/db/migrate/20160821183830_create_phcscriptcdnpro_script_urls.rb +1 -3
- data/db/migrate/20160821183946_create_phcscriptcdnpro_script_versions.rb +1 -3
- data/db/migrate/20170517064049_create_phcscriptcdnpro_listing_versions.rb +1 -0
- data/db/migrate/20170517064114_create_phcscriptcdnpro_scriptversion_versions.rb +1 -0
- data/db/migrate/20170517064150_create_phcscriptcdnpro_url_versions.rb +1 -0
- data/db/migrate/20170517064208_create_phcscriptcdnpro_author_versions.rb +1 -0
- data/db/migrate/20170517064427_create_phcscriptcdnpro_licence_versions.rb +1 -0
- data/lib/phcscriptcdnpro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95d7c8400569c0013941ed7c49c11dfa6ea78920
|
4
|
+
data.tar.gz: 2417f0166616ceae75a6462b20f73e69a7dbea7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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.
|
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.
|
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 :
|
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.
|
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.
|
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 :
|
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.
|
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.
|
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 :
|
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.
|
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.
|
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 :
|
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.
|
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.
|
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 :
|
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.
|
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.
|
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 :
|
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
|
@@ -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 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
|