phcpresspro 25.0.0 → 27.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/phcpresspro/api/v1/categories_controller.rb +1 -1
- data/app/controllers/phcpresspro/api/v1/posts_controller.rb +2 -2
- data/app/controllers/phcpresspro/application_controller.rb +0 -24
- data/app/controllers/phcpresspro/article/posts_controller.rb +7 -10
- data/app/controllers/phcpresspro/modules/categories_controller.rb +7 -10
- data/app/controllers/phcpresspro/modules/connections_controller.rb +7 -10
- data/app/views/layouts/phcpresspro/components/backend/footer/_footer.html.erb +1 -1
- data/app/views/layouts/phcpresspro/components/frontend/footer/_footer_copyright.html.erb +1 -1
- data/config/initializers/devise.rb +287 -0
- data/config/locales/devise.en.yml +64 -0
- data/db/migrate/20160716182936_create_phcpresspro_modules_categories.rb +1 -3
- data/db/migrate/20160718204718_create_phcpresspro_article_posts.rb +1 -3
- data/db/migrate/20160719221205_create_phcpresspro_modules_connections.rb +1 -3
- data/lib/phcpresspro/engine.rb +4 -1
- data/lib/phcpresspro/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec22ee30300940e3f0414fcd1e2e0d9306197898
|
4
|
+
data.tar.gz: 565838858a043bc9cb41e2fab83029813da52fb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7160bfa644b2552cc6033b047fd5abbc23740bd4be2143cc353b7c4bf81a84284b754aee0d7563a2fa2570bcec6c244ed62fc8dd3ffb586a2f6d44eb1dffbe61
|
7
|
+
data.tar.gz: ce0421103ca08b3a8b97e463e8ee7464884c507b93643d47b78df6254c9d2c969f407b3e7ff7faee058c9a4480a8a9e743fc5c242fb770a39f58666e7ca92247
|
@@ -8,12 +8,12 @@ module Phcpresspro
|
|
8
8
|
|
9
9
|
# Article Category API
|
10
10
|
def index
|
11
|
-
@article_posts = Article::Post.where(pststatus: 'published').order('created_at ASC')
|
11
|
+
@article_posts = Article::Post.where(org_id: current_user.org_id, pststatus: 'published').order('created_at ASC')
|
12
12
|
end
|
13
13
|
|
14
14
|
# Article Show
|
15
15
|
def show
|
16
|
-
@article_post = Article::Post.where(pststatus: 'published').find(params[:id])
|
16
|
+
@article_post = Article::Post.where(org_id: current_user.org_id, pststatus: 'published').find(params[:id])
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
@@ -9,32 +9,8 @@ module Phcpresspro
|
|
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
|
-
# Default is: current_user rescue nil
|
38
14
|
current_user ? current_user.username : 'Public user'
|
39
15
|
end
|
40
16
|
|
@@ -4,14 +4,13 @@ module Phcpresspro
|
|
4
4
|
class Article::PostsController < 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_article_post, only: [:show, :edit, :update, :destroy]
|
11
10
|
|
12
11
|
# Article Index
|
13
12
|
def index
|
14
|
-
@article_posts = Article::Post.where(
|
13
|
+
@article_posts = Article::Post.where(org_id: current_user.org_id)
|
15
14
|
end
|
16
15
|
|
17
16
|
# Article Show
|
@@ -23,6 +22,8 @@ module Phcpresspro
|
|
23
22
|
# Article New
|
24
23
|
def new
|
25
24
|
@article_post = Article::Post.new
|
25
|
+
@article_post.user_id = current_user.id
|
26
|
+
@article_post.org_id = current_user.org_id
|
26
27
|
end
|
27
28
|
|
28
29
|
# Article Edit
|
@@ -33,9 +34,7 @@ module Phcpresspro
|
|
33
34
|
def create
|
34
35
|
@article_post = Article::Post.new(article_post_params)
|
35
36
|
@article_post.user_id = current_user.id
|
36
|
-
@article_post.
|
37
|
-
@article_post.membership_id = authrocket_membership_info.id
|
38
|
-
@article_post.oganization_id = authrocket_membership_info.org_id
|
37
|
+
@article_post.org_id = current_user.org_id
|
39
38
|
if @article_post.save
|
40
39
|
@article_post.connections.build
|
41
40
|
redirect_to article_posts_url, notice: 'Post was successfully created.'
|
@@ -47,9 +46,7 @@ module Phcpresspro
|
|
47
46
|
# PATCH/PUT
|
48
47
|
def update
|
49
48
|
@article_post.user_id = current_user.id
|
50
|
-
@article_post.
|
51
|
-
@article_post.membership_id = authrocket_membership_info.id
|
52
|
-
@article_post.oganization_id = authrocket_membership_info.org_id
|
49
|
+
@article_post.org_id = current_user.org_id
|
53
50
|
if @article_post.update(article_post_params)
|
54
51
|
@article_post.connections.build
|
55
52
|
redirect_to article_posts_url, notice: 'Post was successfully updated.'
|
@@ -73,7 +70,7 @@ module Phcpresspro
|
|
73
70
|
|
74
71
|
# Params Whitelist
|
75
72
|
def article_post_params
|
76
|
-
params.require(:article_post).permit(:psttitle, :psttext, :pststatus, :pstimage, :remove_pstimage, :slug, :user_id, :
|
73
|
+
params.require(:article_post).permit(:psttitle, :psttext, :pststatus, :pstimage, :remove_pstimage, :slug, :user_id, :org_id, category_ids: [])
|
77
74
|
end
|
78
75
|
|
79
76
|
end
|
@@ -4,14 +4,13 @@ module Phcpresspro
|
|
4
4
|
class Modules::CategoriesController < 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_modules_category, only: [:show, :edit, :update, :destroy]
|
11
10
|
|
12
11
|
# Categories Index
|
13
12
|
def index
|
14
|
-
@modules_categories = Modules::Category.where(
|
13
|
+
@modules_categories = Modules::Category.where(org_id: current_user.org_id)
|
15
14
|
end
|
16
15
|
|
17
16
|
# Categories Show
|
@@ -23,6 +22,8 @@ module Phcpresspro
|
|
23
22
|
# Categories New
|
24
23
|
def new
|
25
24
|
@modules_category = Modules::Category.new
|
25
|
+
@modules_category.user_id = current_user.id
|
26
|
+
@modules_category.org_id = current_user.org_id
|
26
27
|
end
|
27
28
|
|
28
29
|
# Categories Edit
|
@@ -33,9 +34,7 @@ module Phcpresspro
|
|
33
34
|
def create
|
34
35
|
@modules_category = Modules::Category.new(modules_category_params)
|
35
36
|
@modules_category.user_id = current_user.id
|
36
|
-
@modules_category.
|
37
|
-
@modules_category.membership_id = authrocket_membership_info.id
|
38
|
-
@modules_category.oganization_id = authrocket_membership_info.org_id
|
37
|
+
@modules_category.org_id = current_user.org_id
|
39
38
|
if @modules_category.save
|
40
39
|
redirect_to modules_categories_url, notice: 'Category was successfully created.'
|
41
40
|
else
|
@@ -46,9 +45,7 @@ module Phcpresspro
|
|
46
45
|
# PATCH/PUT
|
47
46
|
def update
|
48
47
|
@modules_category.user_id = current_user.id
|
49
|
-
@modules_category.
|
50
|
-
@modules_category.membership_id = authrocket_membership_info.id
|
51
|
-
@modules_category.oganization_id = authrocket_membership_info.org_id
|
48
|
+
@modules_category.org_id = current_user.org_id
|
52
49
|
if @modules_category.update(modules_category_params)
|
53
50
|
redirect_to modules_categories_url, notice: 'Category was successfully updated.'
|
54
51
|
else
|
@@ -71,7 +68,7 @@ module Phcpresspro
|
|
71
68
|
|
72
69
|
# Whitelist
|
73
70
|
def modules_category_params
|
74
|
-
params.require(:modules_category).permit(:catname, :slug, :user_id, :
|
71
|
+
params.require(:modules_category).permit(:catname, :slug, :user_id, :org_id)
|
75
72
|
end
|
76
73
|
|
77
74
|
end
|
@@ -4,14 +4,13 @@ module Phcpresspro
|
|
4
4
|
class Modules::ConnectionsController < 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_modules_connection, only: [:show, :edit, :update, :destroy]
|
11
10
|
|
12
11
|
# Connections Index
|
13
12
|
def index
|
14
|
-
@modules_connections = Modules::Connection.where(
|
13
|
+
@modules_connections = Modules::Connection.where(org_id: current_user.org_id)
|
15
14
|
end
|
16
15
|
|
17
16
|
# Connections Show
|
@@ -23,6 +22,8 @@ module Phcpresspro
|
|
23
22
|
# Connections New
|
24
23
|
def new
|
25
24
|
@modules_connection = Modules::Connection.new
|
25
|
+
@modules_connection.user_id = current_user.id
|
26
|
+
@modules_connection.org_id = current_user.org_id
|
26
27
|
end
|
27
28
|
|
28
29
|
# Connections Edit
|
@@ -33,9 +34,7 @@ module Phcpresspro
|
|
33
34
|
def create
|
34
35
|
@modules_connection = Modules::Connection.new(modules_connection_params)
|
35
36
|
@modules_connection.user_id = current_user.id
|
36
|
-
@modules_connection.
|
37
|
-
@modules_connection.membership_id = authrocket_membership_info.id
|
38
|
-
@modules_connection.oganization_id = authrocket_membership_info.org_id
|
37
|
+
@modules_connection.org_id = current_user.org_id
|
39
38
|
if @modules_connection.save
|
40
39
|
redirect_to modules_connections_url, notice: 'Connection was successfully created.'
|
41
40
|
else
|
@@ -46,9 +45,7 @@ module Phcpresspro
|
|
46
45
|
# PATCH/PUT
|
47
46
|
def update
|
48
47
|
@modules_connection.user_id = current_user.id
|
49
|
-
@modules_connection.
|
50
|
-
@modules_connection.membership_id = authrocket_membership_info.id
|
51
|
-
@modules_connection.oganization_id = authrocket_membership_info.org_id
|
48
|
+
@modules_connection.org_id = current_user.org_id
|
52
49
|
if @modules_connection.update(modules_connection_params)
|
53
50
|
redirect_to modules_connections_url, notice: 'Connection was successfully updated.'
|
54
51
|
else
|
@@ -71,7 +68,7 @@ module Phcpresspro
|
|
71
68
|
|
72
69
|
# Whitelist
|
73
70
|
def modules_connection_params
|
74
|
-
params.require(:modules_connection).permit(:post_id, :category_id, :slug, :user_id, :
|
71
|
+
params.require(:modules_connection).permit(:post_id, :category_id, :slug, :user_id, :org_id)
|
75
72
|
end
|
76
73
|
|
77
74
|
end
|
@@ -4,5 +4,5 @@
|
|
4
4
|
<% end %>
|
5
5
|
</div>
|
6
6
|
<div>
|
7
|
-
© 2012-<%= Time.now.year %> - v<%= Gem.loaded_specs["phcpresspro"].version.to_s %> - RELEASED - OCT-
|
7
|
+
© 2012-<%= Time.now.year %> - v<%= Gem.loaded_specs["phcpresspro"].version.to_s %> - RELEASED - OCT-29-<%= Date.today.year %>
|
8
8
|
</div>
|
@@ -14,6 +14,6 @@
|
|
14
14
|
<li><%= link_to "Terms & Conditions", "#", target: "_blank", rel: "nofollow" %></li>
|
15
15
|
</ul>
|
16
16
|
|
17
|
-
<strong>PHC</strong>Networks © 2012-<%= Time.now.year %> - v<%= Gem.loaded_specs["phcpresspro"].version.to_s %> - RELEASED - OCT-
|
17
|
+
<strong>PHC</strong>Networks © 2012-<%= Time.now.year %> - v<%= Gem.loaded_specs["phcpresspro"].version.to_s %> - RELEASED - OCT-29-<%= Date.today.year %>
|
18
18
|
|
19
19
|
</div>
|
@@ -0,0 +1,287 @@
|
|
1
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
|
+
# Many of these configuration options can be set straight in your model.
|
3
|
+
Devise.setup do |config|
|
4
|
+
# The secret key used by Devise. Devise uses this key to generate
|
5
|
+
# random tokens. Changing this key will render invalid all existing
|
6
|
+
# confirmation, reset password and unlock tokens in the database.
|
7
|
+
# Devise will use the `secret_key_base` as its `secret_key`
|
8
|
+
# by default. You can change it below and use your own secret key.
|
9
|
+
# config.secret_key = '528ca4f76c873a17c6411224f9a47999486f01ea90f01c40502801bee30cc569cf72039384708654df07f006b324abd68810a2b4b87ce7804f28143cec2a3038'
|
10
|
+
|
11
|
+
# ==> Mailer Configuration
|
12
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
13
|
+
# note that it will be overwritten if you use your own mailer class
|
14
|
+
# with default "from" parameter.
|
15
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
16
|
+
|
17
|
+
# Configure the class responsible to send e-mails.
|
18
|
+
# config.mailer = 'Devise::Mailer'
|
19
|
+
|
20
|
+
# Configure the parent class responsible to send e-mails.
|
21
|
+
# config.parent_mailer = 'ActionMailer::Base'
|
22
|
+
|
23
|
+
# ==> ORM configuration
|
24
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
25
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
26
|
+
# available as additional gems.
|
27
|
+
require 'devise/orm/active_record'
|
28
|
+
|
29
|
+
# ==> Configuration for any authentication mechanism
|
30
|
+
# Configure which keys are used when authenticating a user. The default is
|
31
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
32
|
+
# authenticating a user, both parameters are required. Remember that those
|
33
|
+
# parameters are used only when authenticating and not when retrieving from
|
34
|
+
# session. If you need permissions, you should implement that in a before filter.
|
35
|
+
# You can also supply a hash where the value is a boolean determining whether
|
36
|
+
# or not authentication should be aborted when the value is not present.
|
37
|
+
# config.authentication_keys = [:email]
|
38
|
+
|
39
|
+
# Configure parameters from the request object used for authentication. Each entry
|
40
|
+
# given should be a request method and it will automatically be passed to the
|
41
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
42
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
43
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
44
|
+
# config.request_keys = []
|
45
|
+
|
46
|
+
# Configure which authentication keys should be case-insensitive.
|
47
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
48
|
+
# to authenticate or find a user. Default is :email.
|
49
|
+
config.case_insensitive_keys = [:email]
|
50
|
+
|
51
|
+
# Configure which authentication keys should have whitespace stripped.
|
52
|
+
# These keys will have whitespace before and after removed upon creating or
|
53
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
54
|
+
config.strip_whitespace_keys = [:email]
|
55
|
+
|
56
|
+
# Tell if authentication through request.params is enabled. True by default.
|
57
|
+
# It can be set to an array that will enable params authentication only for the
|
58
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
59
|
+
# enable it only for database (email + password) authentication.
|
60
|
+
# config.params_authenticatable = true
|
61
|
+
|
62
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
63
|
+
# It can be set to an array that will enable http authentication only for the
|
64
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
65
|
+
# enable it only for database authentication. The supported strategies are:
|
66
|
+
# :database = Support basic authentication with authentication key + password
|
67
|
+
# config.http_authenticatable = false
|
68
|
+
|
69
|
+
# If 401 status code should be returned for AJAX requests. True by default.
|
70
|
+
# config.http_authenticatable_on_xhr = true
|
71
|
+
|
72
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
73
|
+
# config.http_authentication_realm = 'Application'
|
74
|
+
|
75
|
+
# It will change confirmation, password recovery and other workflows
|
76
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
77
|
+
# Does not affect registerable.
|
78
|
+
# config.paranoid = true
|
79
|
+
|
80
|
+
# By default Devise will store the user in session. You can skip storage for
|
81
|
+
# particular strategies by setting this option.
|
82
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
83
|
+
# may want to disable generating routes to Devise's sessions controller by
|
84
|
+
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
85
|
+
config.skip_session_storage = [:http_auth]
|
86
|
+
|
87
|
+
config.parent_controller = 'Phcaccountspro::ApplicationController'
|
88
|
+
|
89
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
90
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
91
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
92
|
+
# from the server. You can disable this option at your own risk.
|
93
|
+
# config.clean_up_csrf_token_on_authentication = true
|
94
|
+
|
95
|
+
# When false, Devise will not attempt to reload routes on eager load.
|
96
|
+
# This can reduce the time taken to boot the app but if your application
|
97
|
+
# requires the Devise mappings to be loaded during boot time the application
|
98
|
+
# won't boot properly.
|
99
|
+
# config.reload_routes = true
|
100
|
+
|
101
|
+
# ==> Configuration for :database_authenticatable
|
102
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 11. If
|
103
|
+
# using other algorithms, it sets how many times you want the password to be hashed.
|
104
|
+
#
|
105
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
106
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
107
|
+
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
108
|
+
# algorithm), the cost increases exponentially with the number of stretches (e.g.
|
109
|
+
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
110
|
+
config.stretches = Rails.env.test? ? 1 : 11
|
111
|
+
|
112
|
+
# Set up a pepper to generate the hashed password.
|
113
|
+
# config.pepper = '486f9673f47f98dea13787dc463b8d59c246801b5da1b219d7cc52ea2fa7d58d1fea107b12e0a7087390ed9003b4a11ec2aaacbd6cecc433fac5453ac7cf520b'
|
114
|
+
|
115
|
+
# Send a notification to the original email when the user's email is changed.
|
116
|
+
# config.send_email_changed_notification = false
|
117
|
+
|
118
|
+
# Send a notification email when the user's password is changed.
|
119
|
+
# config.send_password_change_notification = false
|
120
|
+
|
121
|
+
# ==> Configuration for :confirmable
|
122
|
+
# A period that the user is allowed to access the website even without
|
123
|
+
# confirming their account. For instance, if set to 2.days, the user will be
|
124
|
+
# able to access the website for two days without confirming their account,
|
125
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
126
|
+
# the user cannot access the website without confirming their account.
|
127
|
+
# config.allow_unconfirmed_access_for = 2.days
|
128
|
+
|
129
|
+
# A period that the user is allowed to confirm their account before their
|
130
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
131
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
132
|
+
# their account can't be confirmed with the token any more.
|
133
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
134
|
+
# before confirming their account.
|
135
|
+
# config.confirm_within = 3.days
|
136
|
+
|
137
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
138
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
139
|
+
# db field (see migrations). Until confirmed, new email is stored in
|
140
|
+
# unconfirmed_email column, and copied to email column on successful confirmation.
|
141
|
+
config.reconfirmable = true
|
142
|
+
|
143
|
+
# Defines which key will be used when confirming an account
|
144
|
+
# config.confirmation_keys = [:email]
|
145
|
+
|
146
|
+
# ==> Configuration for :rememberable
|
147
|
+
# The time the user will be remembered without asking for credentials again.
|
148
|
+
# config.remember_for = 2.weeks
|
149
|
+
|
150
|
+
# Invalidates all the remember me tokens when the user signs out.
|
151
|
+
config.expire_all_remember_me_on_sign_out = true
|
152
|
+
|
153
|
+
# If true, extends the user's remember period when remembered via cookie.
|
154
|
+
# config.extend_remember_period = false
|
155
|
+
|
156
|
+
# Options to be passed to the created cookie. For instance, you can set
|
157
|
+
# secure: true in order to force SSL only cookies.
|
158
|
+
# config.rememberable_options = {}
|
159
|
+
|
160
|
+
# ==> Configuration for :validatable
|
161
|
+
# Range for password length.
|
162
|
+
config.password_length = 6..128
|
163
|
+
|
164
|
+
# Email regex used to validate email formats. It simply asserts that
|
165
|
+
# one (and only one) @ exists in the given string. This is mainly
|
166
|
+
# to give user feedback and not to assert the e-mail validity.
|
167
|
+
config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
|
168
|
+
|
169
|
+
# ==> Configuration for :timeoutable
|
170
|
+
# The time you want to timeout the user session without activity. After this
|
171
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
172
|
+
# config.timeout_in = 30.minutes
|
173
|
+
|
174
|
+
# ==> Configuration for :lockable
|
175
|
+
# Defines which strategy will be used to lock an account.
|
176
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
177
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
178
|
+
# config.lock_strategy = :failed_attempts
|
179
|
+
|
180
|
+
# Defines which key will be used when locking and unlocking an account
|
181
|
+
# config.unlock_keys = [:email]
|
182
|
+
|
183
|
+
# Defines which strategy will be used to unlock an account.
|
184
|
+
# :email = Sends an unlock link to the user email
|
185
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
186
|
+
# :both = Enables both strategies
|
187
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
188
|
+
# config.unlock_strategy = :both
|
189
|
+
|
190
|
+
# Number of authentication tries before locking an account if lock_strategy
|
191
|
+
# is failed attempts.
|
192
|
+
# config.maximum_attempts = 20
|
193
|
+
|
194
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
195
|
+
# config.unlock_in = 1.hour
|
196
|
+
|
197
|
+
# Warn on the last attempt before the account is locked.
|
198
|
+
# config.last_attempt_warning = true
|
199
|
+
|
200
|
+
# ==> Configuration for :recoverable
|
201
|
+
#
|
202
|
+
# Defines which key will be used when recovering the password for an account
|
203
|
+
# config.reset_password_keys = [:email]
|
204
|
+
|
205
|
+
# Time interval you can reset your password with a reset password key.
|
206
|
+
# Don't put a too small interval or your users won't have the time to
|
207
|
+
# change their passwords.
|
208
|
+
config.reset_password_within = 6.hours
|
209
|
+
|
210
|
+
# When set to false, does not sign a user in automatically after their password is
|
211
|
+
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
212
|
+
# config.sign_in_after_reset_password = true
|
213
|
+
|
214
|
+
# ==> Configuration for :encryptable
|
215
|
+
# Allow you to use another hashing or encryption algorithm besides bcrypt (default).
|
216
|
+
# You can use :sha1, :sha512 or algorithms from others authentication tools as
|
217
|
+
# :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
|
218
|
+
# for default behavior) and :restful_authentication_sha1 (then you should set
|
219
|
+
# stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
|
220
|
+
#
|
221
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
222
|
+
# config.encryptor = :sha512
|
223
|
+
|
224
|
+
# ==> Scopes configuration
|
225
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
226
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
227
|
+
# are using only default views.
|
228
|
+
config.scoped_views = true
|
229
|
+
|
230
|
+
# Configure the default scope given to Warden. By default it's the first
|
231
|
+
# devise role declared in your routes (usually :user).
|
232
|
+
config.default_scope = :user
|
233
|
+
|
234
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
235
|
+
# only the current scope. By default, Devise signs out all scopes.
|
236
|
+
config.sign_out_all_scopes = false
|
237
|
+
|
238
|
+
# ==> Navigation configuration
|
239
|
+
# Lists the formats that should be treated as navigational. Formats like
|
240
|
+
# :html, should redirect to the sign in page when the user does not have
|
241
|
+
# access, but formats like :xml or :json, should return 401.
|
242
|
+
#
|
243
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
244
|
+
# should add them to the navigational formats lists.
|
245
|
+
#
|
246
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
247
|
+
# config.navigational_formats = ['*/*', :html]
|
248
|
+
|
249
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
250
|
+
config.sign_out_via = :delete
|
251
|
+
|
252
|
+
# ==> OmniAuth
|
253
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
254
|
+
# up on your models and hooks.
|
255
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
256
|
+
|
257
|
+
# ==> Warden configuration
|
258
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
259
|
+
# change the failure app, you can configure them inside the config.warden block.
|
260
|
+
#
|
261
|
+
# config.warden do |manager|
|
262
|
+
# manager.intercept_401 = false
|
263
|
+
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
264
|
+
# end
|
265
|
+
|
266
|
+
# ==> Mountable engine configurations
|
267
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
268
|
+
# is mountable, there are some extra configurations to be taken into account.
|
269
|
+
#
|
270
|
+
# mount MyEngine, at: '/my_engine'
|
271
|
+
#
|
272
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
273
|
+
config.router_name = :phcaccountspro
|
274
|
+
#
|
275
|
+
# When using OmniAuth, Devise cannot automatically set OmniAuth path,
|
276
|
+
# so you need to do it manually. For the users scope, it would be:
|
277
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
278
|
+
|
279
|
+
Rails.application.config.to_prepare do
|
280
|
+
Devise::SessionsController.layout "phcaccountspro/devise"
|
281
|
+
Devise::RegistrationsController.layout proc{ |controller| user_signed_in? ? "phcaccountspro/application" : "phcaccountspro/devise" }
|
282
|
+
Devise::ConfirmationsController.layout "phcaccountspro/devise"
|
283
|
+
Devise::UnlocksController.layout "phcaccountspro/devise"
|
284
|
+
Devise::PasswordsController.layout "phcaccountspro/devise"
|
285
|
+
end
|
286
|
+
|
287
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
2
|
+
|
3
|
+
en:
|
4
|
+
devise:
|
5
|
+
confirmations:
|
6
|
+
confirmed: "Your email address has been successfully confirmed."
|
7
|
+
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "You are already signed in."
|
11
|
+
inactive: "Your account is not activated yet."
|
12
|
+
invalid: "Invalid %{authentication_keys} or password."
|
13
|
+
locked: "Your account is locked."
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
16
|
+
timeout: "Your session expired. Please sign in again to continue."
|
17
|
+
unauthenticated: "You need to sign in or sign up before continuing."
|
18
|
+
unconfirmed: "You have to confirm your email address before continuing."
|
19
|
+
mailer:
|
20
|
+
confirmation_instructions:
|
21
|
+
subject: "Confirmation instructions"
|
22
|
+
reset_password_instructions:
|
23
|
+
subject: "Reset password instructions"
|
24
|
+
unlock_instructions:
|
25
|
+
subject: "Unlock instructions"
|
26
|
+
email_changed:
|
27
|
+
subject: "Email Changed"
|
28
|
+
password_change:
|
29
|
+
subject: "Password Changed"
|
30
|
+
omniauth_callbacks:
|
31
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
32
|
+
success: "Successfully authenticated from %{kind} account."
|
33
|
+
passwords:
|
34
|
+
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
35
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
36
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
37
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
38
|
+
updated_not_active: "Your password has been changed successfully."
|
39
|
+
registrations:
|
40
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
41
|
+
signed_up: "Welcome! You have signed up successfully."
|
42
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
43
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
44
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
45
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
|
46
|
+
updated: "Your account has been updated successfully."
|
47
|
+
sessions:
|
48
|
+
signed_in: "Signed in successfully."
|
49
|
+
signed_out: "Signed out successfully."
|
50
|
+
already_signed_out: "Signed out successfully."
|
51
|
+
unlocks:
|
52
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
53
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
54
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
55
|
+
errors:
|
56
|
+
messages:
|
57
|
+
already_confirmed: "was already confirmed, please try signing in"
|
58
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
59
|
+
expired: "has expired, please request a new one"
|
60
|
+
not_found: "not found"
|
61
|
+
not_locked: "was not locked"
|
62
|
+
not_saved:
|
63
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
64
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
data/lib/phcpresspro/engine.rb
CHANGED
@@ -37,8 +37,11 @@ module Phcpresspro
|
|
37
37
|
require 'carrierwave'
|
38
38
|
require 'cloudinary'
|
39
39
|
|
40
|
+
# Frindly URLS Frontend
|
41
|
+
require 'friendly_id'
|
42
|
+
|
40
43
|
# Isolate Namespace
|
41
|
-
isolate_namespace
|
44
|
+
isolate_namespace Phcpresspro
|
42
45
|
|
43
46
|
# Testing Generator
|
44
47
|
config.generators do |g|
|
data/lib/phcpresspro/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcpresspro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 27.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- BradPotts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paper_trail
|
@@ -737,9 +737,11 @@ files:
|
|
737
737
|
- app/views/phcpresspro/modules/connections/index.html.erb
|
738
738
|
- app/views/phcpresspro/modules/connections/new.html.erb
|
739
739
|
- app/views/phcpresspro/modules/connections/show.html.erb
|
740
|
+
- config/initializers/devise.rb
|
740
741
|
- config/initializers/friendly_id.rb
|
741
742
|
- config/initializers/locale.rb
|
742
743
|
- config/initializers/paper_trail.rb
|
744
|
+
- config/locales/devise.en.yml
|
743
745
|
- config/routes.rb
|
744
746
|
- config/tinymce.yml
|
745
747
|
- db/migrate/20160716182936_create_phcpresspro_modules_categories.rb
|