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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16008084828e31ad0ae76709269a435f9a89241d5a8a1e59cde3a310088ec616
4
- data.tar.gz: c6c8ec48f78cde6e481e4aede127233895be9d83c9365467022e3fddaa3189f8
3
+ metadata.gz: 9df33a1248b60c4b20687e3a7922084d20ff5bb27823e040739a6fc0cc10b1ab
4
+ data.tar.gz: 4afde72f6c24c038665594136612fbe3fc942f307d63d486103e275abae04877
5
5
  SHA512:
6
- metadata.gz: f994ecbba09fbecd02765367dc379222345d06eaa337707de0f475ddd05708e10f3fc6854755fda963c9937df36a2dffc16f7b4fabb1edfa5e8b4a2d6fbcd6f7
7
- data.tar.gz: a4031c894cbfebf29206cdcaf9a0b24aeb03adf8bc4a9f16293b56b1a8a8d2619a96fd4763ac141984863213adf3a54d720fee46c1ba3cc5d308c982d3fc2a6d
6
+ metadata.gz: e79f689270fcf27d9b55b140ecdce36b7c3e9fe9eff548d14c5e01598b8659cae3fd4157cb7896aed63841863a10966555e73a0f323afb9e6fb259fb4ad8474b
7
+ data.tar.gz: f84610156d6e501b8549cccf7c6efd1823f0807d5b40dae8e22541126f8176657676ea435ed25879a6207fa3880a893587234636f5c17418cc32a60584fab626
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-cms (3.8.4)
4
+ trusty-cms (3.9.0)
5
5
  RedCloth (= 4.3.2)
6
6
  acts_as_list (~> 0.9.5)
7
7
  acts_as_tree (>= 2.6.1, < 2.9.0)
@@ -10,7 +10,7 @@ $(function () {
10
10
  },
11
11
  "user[password]": {
12
12
  required: true,
13
- minlength: 5
13
+ minlength: 12
14
14
  },
15
15
  "user[password_confirmation]": {
16
16
  required: true,
@@ -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!(user_params)
22
- response_for :update
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
- # Regexp extracted from https://stackoverflow.com/questions/19605150/regex-for-password-must-contain-at-least-eight-characters-at-least-one-number-a
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"), edit_user_registration_path, :method => :get
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
@@ -1,4 +1,4 @@
1
- - unless current_user.site
1
+ - if current_user.admin?
2
2
  %tr
3
3
  %th.label
4
4
  %label{:for=>"user_admin"} Can edit site
@@ -23,12 +23,13 @@
23
23
  = render "password_fields", :f => f
24
24
 
25
25
  - form.edit_roles do
26
- %p
27
- %label.multi_option= t('roles')
28
- = f.check_box "admin", :class => "checkbox"
29
- = f.label :admin, t('admin'), :class => "checkbox"
30
- = f.check_box "designer", :class => "checkbox"
31
- = f.label :designer, t('designer'), :class => "checkbox"
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 => 'off'
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 => 'off'
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 user == current_user
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
- #actions
36
- = pagination_for(@users)
37
- %ul
38
- %li= link_to image('plus') + " " + t('new_user'), new_admin_user_url, :class => 'action_button'
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..128
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
- # config.sign_in_after_reset_password = true
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
@@ -2,6 +2,6 @@ TRUSTY_CMS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "..")) unle
2
2
 
3
3
  unless defined? TrustyCms::VERSION
4
4
  module TrustyCms
5
- VERSION = '3.8.4'
5
+ VERSION = '3.9.0'
6
6
  end
7
7
  end
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.8.4
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-04 00:00:00.000000000 Z
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.