trusty-cms 3.8.4 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/admin/validations/user_validations.js +1 -1
- data/app/controllers/admin/users_controller.rb +22 -2
- data/app/models/user.rb +1 -3
- data/app/views/admin/configuration/show.html.haml +1 -1
- data/app/views/admin/users/_choose_site.html.haml +1 -1
- data/app/views/admin/users/_form.html.haml +7 -6
- data/app/views/admin/users/_password_fields.html.haml +2 -2
- data/app/views/admin/users/index.html.haml +6 -5
- data/config/initializers/devise.rb +2 -2
- data/config/routes.rb +1 -1
- data/lib/trusty_cms.rb +1 -1
- metadata +2 -3
- data/app/assets/javascripts/notes.md +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9df33a1248b60c4b20687e3a7922084d20ff5bb27823e040739a6fc0cc10b1ab
|
4
|
+
data.tar.gz: 4afde72f6c24c038665594136612fbe3fc942f307d63d486103e275abae04877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e79f689270fcf27d9b55b140ecdce36b7c3e9fe9eff548d14c5e01598b8659cae3fd4157cb7896aed63841863a10966555e73a0f323afb9e6fb259fb4ad8474b
|
7
|
+
data.tar.gz: f84610156d6e501b8549cccf7c6efd1823f0807d5b40dae8e22541126f8176657676ea435ed25879a6207fa3880a893587234636f5c17418cc32a60584fab626
|
data/Gemfile.lock
CHANGED
@@ -11,6 +11,17 @@ class Admin::UsersController < Admin::ResourceController
|
|
11
11
|
redirect_to edit_admin_user_path(params[:id])
|
12
12
|
end
|
13
13
|
|
14
|
+
def create
|
15
|
+
user = User.new(user_params)
|
16
|
+
if user.save
|
17
|
+
flash[:notice] = 'User was created.'
|
18
|
+
redirect_to admin_users_path
|
19
|
+
else
|
20
|
+
flash[:error] = 'There was an error saving the user. Please try again.'
|
21
|
+
render :new
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
14
25
|
def update
|
15
26
|
user_params = params[model_symbol].permit!
|
16
27
|
if user_params && user_params['admin'] == false && model == current_user
|
@@ -18,8 +29,12 @@ class Admin::UsersController < Admin::ResourceController
|
|
18
29
|
announce_cannot_remove_self_from_admin_role
|
19
30
|
end
|
20
31
|
model.skip_password_validation = true unless user_params[:password_confirmation].present?
|
21
|
-
model.update_attributes
|
22
|
-
|
32
|
+
if model.update_attributes(user_params)
|
33
|
+
response_for :update
|
34
|
+
else
|
35
|
+
flash[:error] = 'There was an error saving the user. Please try again.'
|
36
|
+
render :edit
|
37
|
+
end
|
23
38
|
end
|
24
39
|
|
25
40
|
def ensure_deletable
|
@@ -31,6 +46,11 @@ class Admin::UsersController < Admin::ResourceController
|
|
31
46
|
|
32
47
|
private
|
33
48
|
|
49
|
+
def user_params
|
50
|
+
params.require(:user).permit(:first_name, :last_name, :admin, :designer,
|
51
|
+
:password, :password_confirmation, :email, :site_id, :notes)
|
52
|
+
end
|
53
|
+
|
34
54
|
def announce_cannot_delete_self
|
35
55
|
flash[:error] = t('users_controller.cannot_delete_self')
|
36
56
|
end
|
data/app/models/user.rb
CHANGED
@@ -58,9 +58,7 @@ class User < ActiveRecord::Base
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def password_complexity
|
61
|
-
|
62
|
-
return if password.blank? || password =~ /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,70}$/
|
63
|
-
|
61
|
+
return false if password.blank? || password =~ /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,70}$/
|
64
62
|
errors.add :password, 'Complexity requirement not met. Length should be 12 characters and include: 1 uppercase, 1 lowercase, 1 digit and 1 special character.'
|
65
63
|
end
|
66
64
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
- user.preferences do
|
6
6
|
%h3
|
7
7
|
.actions
|
8
|
-
= button_to t("edit_preferences"),
|
8
|
+
= button_to t("edit_preferences"), edit_admin_user_path(current_user), :method => :get
|
9
9
|
= t('personal_preferences')
|
10
10
|
= image_tag(gravatar_url(@user.email, :size=>"64px"), :class=>"avatar", :width=>64, :height=>64, :alt=>"")
|
11
11
|
%p.ruled
|
@@ -23,12 +23,13 @@
|
|
23
23
|
= render "password_fields", :f => f
|
24
24
|
|
25
25
|
- form.edit_roles do
|
26
|
-
|
27
|
-
%
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
- if current_user.admin?
|
27
|
+
%p
|
28
|
+
%label.multi_option= t('roles')
|
29
|
+
= f.check_box "admin", :class => "checkbox"
|
30
|
+
= f.label :admin, t('admin'), :class => "checkbox"
|
31
|
+
= f.check_box "designer", :class => "checkbox"
|
32
|
+
= f.label :designer, t('designer'), :class => "checkbox"
|
32
33
|
|
33
34
|
- form.edit_notes do
|
34
35
|
%p
|
@@ -6,10 +6,10 @@
|
|
6
6
|
.set#change_password{:style=> (!@user.new_record? && @user.valid?) ? "display: none" : nil}
|
7
7
|
%p
|
8
8
|
= f.label :password, t('new_password')
|
9
|
-
= f.password_field "password", :class => "textbox big", :value => "", :size => 15, :maxlength => 40, :autocomplete => '
|
9
|
+
= f.password_field "password", :class => "textbox big", :value => "", :size => 15, :maxlength => 40, :autocomplete => 'new-password'
|
10
10
|
%p
|
11
11
|
= f.label :password_confirmation, t('password_confirmation')
|
12
|
-
= f.password_field "password_confirmation", :class => "textbox big", :value => "", :size => 15, :maxlength => 40, :autocomplete => '
|
12
|
+
= f.password_field "password_confirmation", :class => "textbox big", :value => "", :size => 15, :maxlength => 40, :autocomplete => 'new-password'
|
13
13
|
- unless @user.new_record?
|
14
14
|
%span
|
15
15
|
= t('or')
|
@@ -25,14 +25,15 @@
|
|
25
25
|
%td.roles= roles(user)
|
26
26
|
- tbody.actions_cell do
|
27
27
|
%td.actions
|
28
|
-
- if
|
28
|
+
- if !current_user.admin?
|
29
29
|
%span.action.disabled= image('minus_disabled') + ' ' + t('remove')
|
30
30
|
- else
|
31
31
|
= link_to image('minus') + ' ' + t('remove'), remove_admin_user_url(user), :class => "action"
|
32
32
|
|
33
33
|
- render_region :bottom do |bottom|
|
34
34
|
- bottom.new_button do
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
%
|
35
|
+
- if current_user.admin?
|
36
|
+
#actions
|
37
|
+
= pagination_for(@users)
|
38
|
+
%ul
|
39
|
+
%li= link_to image('plus') + " " + t('new_user'), new_admin_user_url, :class => 'action_button'
|
@@ -177,7 +177,7 @@ Devise.setup do |config|
|
|
177
177
|
|
178
178
|
# ==> Configuration for :validatable
|
179
179
|
# Range for password length.
|
180
|
-
config.password_length = 12..
|
180
|
+
config.password_length = 12..64
|
181
181
|
|
182
182
|
# Email regex used to validate email formats. It simply asserts that
|
183
183
|
# one (and only one) @ exists in the given string. This is mainly
|
@@ -227,7 +227,7 @@ Devise.setup do |config|
|
|
227
227
|
|
228
228
|
# When set to false, does not sign a user in automatically after their password is
|
229
229
|
# reset. Defaults to true, so a user is signed in automatically after a reset.
|
230
|
-
|
230
|
+
config.sign_in_after_reset_password = false
|
231
231
|
|
232
232
|
# ==> Configuration for :encryptable
|
233
233
|
# Allow you to use another hashing or encryption algorithm besides bcrypt (default).
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
TrustyCms::Application.routes.draw do
|
2
2
|
root to: 'site#show_page'
|
3
|
-
devise_for :users, module: :devise
|
3
|
+
devise_for :users, module: :devise, :skip => :registration
|
4
4
|
get '/rad_social/mail' => 'social_mailer#social_mail_form', as: :rad_social_mail_form
|
5
5
|
post '/rad_social/mail' => 'social_mailer#create_social_mail', as: :rad_create_social_mail
|
6
6
|
TrustyCms::Application.config.enabled_extensions.each { |ext|
|
data/lib/trusty_cms.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trusty-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TrustyCms CMS dev team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: acts_as_list
|
@@ -589,7 +589,6 @@ files:
|
|
589
589
|
- app/assets/javascripts/admin/validations/user_validations.js
|
590
590
|
- app/assets/javascripts/ckeditor/config.js
|
591
591
|
- app/assets/javascripts/ckeditor/contents.css
|
592
|
-
- app/assets/javascripts/notes.md
|
593
592
|
- app/assets/javascripts/rad_social/captcha.js
|
594
593
|
- app/assets/javascripts/rad_social/jquery.validate.min.js
|
595
594
|
- app/assets/javascripts/rad_social/rad_ajax_form.js
|
@@ -1,39 +0,0 @@
|
|
1
|
-
Removed Features
|
2
|
-
===============
|
3
|
-
|
4
|
-
* Fade in/fade out on drag/drop
|
5
|
-
* Transparency while dragging
|
6
|
-
* Dropdown slide down/up
|
7
|
-
* Ability to drag/drop popups
|
8
|
-
* Shortcut keys
|
9
|
-
* s to save
|
10
|
-
* [ and ] to move between tabs
|
11
|
-
* 1-9 to select tabs by number
|
12
|
-
* Support for tabs in textareas
|
13
|
-
* Tag search in available tags reference
|
14
|
-
* Pretty popups
|
15
|
-
* form activate - focus fields
|
16
|
-
|
17
|
-
TODO
|
18
|
-
====
|
19
|
-
|
20
|
-
* Page field addition/removal, make pagefield.js more like page-edit.js
|
21
|
-
* Published at field datepicker
|
22
|
-
* Validation errors that are in context and can be dismissed
|
23
|
-
* (ajax spinner) Onsubmit statuses
|
24
|
-
|
25
|
-
* When page status is set to Scheduled, Published, or Hidden (>=90), show the published_at field. Otherwise, hide the published_at field.
|
26
|
-
* Get page_edit_javascripts and layout_edit_javascripts out of ruby
|
27
|
-
* Reimplement any undefined utility function calls
|
28
|
-
* (docs) Load tag reference - "Available Tags" link
|
29
|
-
|
30
|
-
Might work
|
31
|
-
==========
|
32
|
-
|
33
|
-
* pagefield.js
|
34
|
-
* Cookie
|
35
|
-
|
36
|
-
Notes
|
37
|
-
=====
|
38
|
-
|
39
|
-
* Sitemap only looks to be used on the table on the remove page, but it doesn't seem to have any effect. It looks like you used to be able to toggle things expanded or collapsed.
|