camaleon_cms 2.4.3.12 → 2.4.3.13

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of camaleon_cms might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a88c2eae7a1687093b36edc1b7e114025c6f35c5
4
- data.tar.gz: 2a4a338e0a9e7331d2c9ede64cb7a01a14ea2ce4
3
+ metadata.gz: 60220e65572eba3df3e3307a97c423dda3a5c88b
4
+ data.tar.gz: 8fbafdb15258a5aec532b99f1f361f3f76a65d83
5
5
  SHA512:
6
- metadata.gz: e8058188fc6b86f8103fdb8391cddb1f3cade1c2ac0c178d91c71454bf0443de450891563303ea1363690f6a54e762debd50291113efc1e7cc01836c2698bf6b
7
- data.tar.gz: 5cf62d58034bbe6d0e9e71677089648a154a91d3062ed9e6f88341e3c11af7b3ddc39200a21be5425a127a62041595762559072abf381a76cdfaea6fad2a2968
6
+ metadata.gz: 3f392f06e049b9fc300785f955cbca6e57efda0e30719e2cfa7f1271673578579a2e328b040ae27b977247a9a2b0633464a27af960dbf0fceadaa51642d9f7dc
7
+ data.tar.gz: 6bef7a0c8e4c174456cbf5b9daec32377199a69f6e4d3238b887e615964a35c8fa529a616a2cfd12c0cfe9c5f971b5521702ff8f41b13d34039848cd68b4c57c
@@ -42,7 +42,7 @@ module Plugins::AuthoringPost::AuthoringPostHelper
42
42
  def plugin_authoring_authors_list(post)
43
43
  author_id = post.new_record? ? current_user.id : post.author.id
44
44
  ret = ''
45
- current_site.users.unscoped.where('role <> ?', 'client').order(:username).each do |user|
45
+ current_site.users.where('role <> ?', 'client').order(:username).each do |user|
46
46
  ret += "<option value='#{user.id}' #{user.id.eql?(author_id) ? 'selected' : ''}>#{user.username.titleize}#{user.fullname.eql?(user.username.titleize) ? '' : ' (' + user.fullname + ')' }</option>"
47
47
  end
48
48
  ret
@@ -23,11 +23,7 @@ class Plugins::FrontCache::AdminController < CamaleonCms::Apps::PluginsAdminCont
23
23
  def clean_cache
24
24
  flash[:notice] = "#{t('plugin.front_cache.message.cache_destroyed')}"
25
25
  front_cache_clean()
26
- if Rails.version.to_i < 5
27
- redirect_to :back
28
- else
29
- redirect_back(fallback_location: '/admin/plugins')
30
- end
26
+ redirect_to(request.referer || '/admin/plugins')
31
27
  end
32
28
 
33
29
  end
@@ -1,12 +1,12 @@
1
1
  jQuery(function($){
2
2
  var panel = $("#panel-post-visibility");
3
3
  var link_edit = panel.find(".edit-visibility").click(function(){
4
- panel.find(".panel-options").removeClass("hidden").show().find('input[name="post_private_groups[]"]:first').addClass('required data-error-place-parent');
4
+ panel.find(".panel-options").removeClass("hidden").show();
5
5
  link_edit.hide();
6
6
  return false;
7
7
  });
8
8
  panel.find(".lnk_hide").click(function(){
9
- panel.find(".panel-options").hide().find('input[name="post_private_groups[]"]:first').removeClass('required');
9
+ panel.find(".panel-options").hide();
10
10
  link_edit.show();
11
11
  return false;
12
12
  });
@@ -15,11 +15,14 @@ jQuery(function($){
15
15
  var label = $(this).closest("label");
16
16
  panel.find(".visibility_label").html(label.text());
17
17
  label.siblings("div").hide();
18
- label.next().show();
19
- }).click(function(){
20
- //var label = $(this).closest("label");
21
- //label.siblings("div").hide();
22
- //label.next().show();
18
+ var rel_block = label.next().show();
19
+
20
+ if($(this).val() == 'private') rel_block.find('input.visibility_private_group_item:first').addClass('required data-error-place-parent');
21
+ else panel.find('input.visibility_private_group_item:first').removeClass('required');
22
+
23
+ if($(this).val() == 'password') rel_block.find('input:text').addClass('required');
24
+ else panel.find('input.password_field_value').removeClass('required');
25
+
23
26
  }).filter(":checked").trigger("change");
24
27
 
25
28
  var cal_input = $("#form-post").find('#published_from');
@@ -102,7 +102,7 @@ module Plugins::VisibilityPost::VisibilityPostHelper
102
102
  <div style='padding-left: 20px;'>#{groups_list(post)}</div>
103
103
 
104
104
  <label style='display: block;'><input type='radio' name='post[visibility]' claass='radio' value='password' #{"checked=''" if "password" == post.visibility}> #{t('camaleon_cms.admin.table.password_protection')}</label>
105
- <div><input type='text' class='form-control' name='post[visibility_value]' value='#{post.visibility_value if "password" == post.visibility}'></div>
105
+ <div><input type='text' class='form-control password_field_value' name='post[visibility_value]' value='#{post.visibility_value if "password" == post.visibility}'></div>
106
106
 
107
107
  <p>
108
108
  <a class='lnk_hide' href='#'>#{t('camaleon_cms.admin.table.hide')}</a>
@@ -116,7 +116,7 @@ module Plugins::VisibilityPost::VisibilityPostHelper
116
116
  current_groups = []
117
117
  current_groups = post.visibility_value.split(",") if post.visibility == "private"
118
118
  current_site.user_roles.each do |role|
119
- res << "<label><input type='checkbox' name='post_private_groups[]' class='' value='#{role.slug}' #{"checked=''" if current_groups.include?(role.slug.to_s) }> #{role.name}</label><br>"
119
+ res << "<label><input type='checkbox' name='post_private_groups[]' class='visibility_private_group_item' value='#{role.slug}' #{"checked=''" if current_groups.include?(role.slug.to_s) }> #{role.name}</label><br>"
120
120
  end
121
121
  res.join("")
122
122
  end
@@ -2302,7 +2302,7 @@
2302
2302
  input = element;
2303
2303
  } else {
2304
2304
  input = element.find(options.datepickerInput);
2305
- if (input.size() === 0) {
2305
+ if (input.length === 0) {
2306
2306
  input = element.find('input');
2307
2307
  } else if (!input.is('input')) {
2308
2308
  throw new Error('CSS class "' + options.datepickerInput + '" cannot be applied to non input element');
@@ -2311,7 +2311,7 @@
2311
2311
 
2312
2312
  if (element.hasClass('input-group')) {
2313
2313
  // in case there is more then one 'input-group-addon' Issue #48
2314
- if (element.find('.datepickerbutton').size() === 0) {
2314
+ if (element.find('.datepickerbutton').length === 0) {
2315
2315
  component = element.find('.input-group-addon');
2316
2316
  } else {
2317
2317
  component = element.find('.datepickerbutton');
@@ -44,7 +44,7 @@ function slugFunc(v, sep){
44
44
  } else {
45
45
  $target.filter(':not(.slugify-locked)').text(slug);
46
46
  }
47
- if(settings.change && $target.filter(':not(.slugify-locked)').size() > 0){
47
+ if(settings.change && $target.filter(':not(.slugify-locked)').length > 0){
48
48
  settings.change(slug);
49
49
  }
50
50
  };
@@ -52,7 +52,7 @@ var init_form_validations = function (form, args) {
52
52
 
53
53
  (form ? form : $('#admin_content form')).each(function () {
54
54
  var $form = $(this)
55
- if ($form.find('.translatable').size() > 0) {
55
+ if ($form.find('.translatable').length > 0) {
56
56
  $form.find('.translatable').Translatable();
57
57
  }
58
58
  }).filter(".validate").each(function () {
@@ -61,7 +61,7 @@ function open_modal(settings){
61
61
  settings = $.extend({}, def, settings);
62
62
  if(settings.id){
63
63
  var hidden_modal = $("#"+settings.id);
64
- if(hidden_modal.size()){ hidden_modal.modal('show'); return hidden_modal; }
64
+ if(hidden_modal.length){ hidden_modal.modal('show'); return hidden_modal; }
65
65
  }
66
66
  var modal = $('<div id="'+settings.id+'" class="modal fade modal-'+settings.type+'">'+
67
67
  '<div class="modal-dialog '+settings.modal_size+'">'+
@@ -56,7 +56,7 @@ function cama_init_post(obj) {
56
56
  window["post_editor_draft_intrval"] = setInterval(function () { if($form.length == 0){ clearInterval(window["post_editor_draft_intrval"]); } else{ App_post.save_draft_ajax(null, true); } }, 1 * 60 * 1000);
57
57
  window.save_draft = App_post.save_draft_ajax;
58
58
 
59
- if($form.find(".title-post" + class_translate).size() == 0) class_translate = '';
59
+ if($form.find(".title-post" + class_translate).length == 0) class_translate = '';
60
60
  $form.find(".title-post" + class_translate).each(function () {
61
61
  var $this = $(this);
62
62
  if (!$this.hasClass('sluged')) {
@@ -108,7 +108,7 @@ window["cama_init_media"] = (media_panel) ->
108
108
  dynamicFormData: customFileData,
109
109
  onSuccess: ((files,res_upload,xhr,pd)->
110
110
  if res_upload.search("media_item") >= 0 # success upload
111
- media_panel.trigger("add_file", {item: res_upload, selected: $(pd.statusbar).siblings().not('.error_file_upload').size() == 0})
111
+ media_panel.trigger("add_file", {item: res_upload, selected: $(pd.statusbar).siblings().not('.error_file_upload').length == 0})
112
112
  $(pd.statusbar).remove();
113
113
  else
114
114
  $(pd.statusbar).find(".ajax-file-upload-progress").html("<span style='color: red;'>"+res_upload+"</span>");
@@ -158,7 +158,7 @@ class CamaleonCms::Admin::PostsController < CamaleonCms::AdminController
158
158
  flash[:error] = @post.errors.full_messages.join(', ')
159
159
  end
160
160
  end
161
- redirect_to (:back || url_for(action: :index, s: params[:s]))
161
+ redirect_to(request.referer || url_for(action: :index, s: params[:s]))
162
162
  end
163
163
 
164
164
  # ajax options
@@ -100,7 +100,14 @@ class CamaleonCms::CamaleonController < ApplicationController
100
100
  # inactive page control
101
101
  if current_site.is_inactive?
102
102
  p = current_site.posts.find(current_site.get_option('page_inactive')).decorate
103
- redirect_to(p.the_url) if params != {"controller"=>"camaleon_cms/frontend", "action"=>"post", "slug"=>p.the_slug}
103
+ if request.original_url.to_s.match /\A#{current_site.the_url}admin(\/|\z)/
104
+ if cama_current_user.present?
105
+ cama_logout_user
106
+ flash[:error] = ('Site is Inactive')
107
+ end
108
+ else
109
+ redirect_to(p.the_url) unless params == {"controller"=>"camaleon_cms/frontend", "action"=>"post", "slug"=>p.the_slug}
110
+ end
104
111
  end
105
112
 
106
113
  # maintenance page and IP's control
@@ -57,6 +57,6 @@ module CamaleonCms::FrontendConcern extend ActiveSupport::Concern
57
57
  else
58
58
  flash[:comment_submit][:error] = t('camaleon_cms.admin.message.unauthorized')
59
59
  end
60
- params[:format] == 'json' ? render(json: flash.discard(:comment_submit).to_hash) : redirect_to(:back)
60
+ params[:format] == 'json' ? render(json: flash.discard(:comment_submit).to_hash) : redirect_to(request.referer || @post.the_url(as_path: true))
61
61
  end
62
- end
62
+ end
@@ -2,7 +2,7 @@ module CamaleonCms::Admin::BreadcrumbHelper
2
2
  # draw the title for the admin admin panel according the breadcrumb
3
3
  def cama_admin_title_draw
4
4
  res = [t("camaleon_cms.admin.sidebar_top.admin_panel")]
5
- @breadcrumbs.reverse.slice(0, 2).reverse.each{|b| res << b.name }
5
+ @breadcrumbs.reverse.slice(0, 2).reverse.each{|b| res << (b.is_a?(Hash) ? b[:name] : b.name) }
6
6
  res.join(" &raquo; ")
7
7
  end
8
8
 
@@ -133,7 +133,7 @@
133
133
 
134
134
  $('#add_btn<%= @index %>').click(function(){
135
135
  add_option_default({
136
- value: $sortable.children('li').size() + 1
136
+ value: $sortable.children('li').length + 1
137
137
  });
138
138
  return false;
139
139
  });
@@ -1,3 +1,3 @@
1
1
  module CamaleonCms
2
- VERSION = '2.4.3.12'
2
+ VERSION = '2.4.3.13'
3
3
  end
@@ -13,12 +13,6 @@
13
13
 
14
14
  ActiveRecord::Schema.define(version: 20161215202255) do
15
15
 
16
- create_table "ar_internal_metadata", primary_key: "key", force: :cascade do |t|
17
- t.string "value"
18
- t.datetime "created_at", null: false
19
- t.datetime "updated_at", null: false
20
- end
21
-
22
16
  create_table "comments", force: :cascade do |t|
23
17
  t.string "author"
24
18
  t.string "author_email"
@@ -84,17 +78,6 @@ ActiveRecord::Schema.define(version: 20161215202255) do
84
78
  add_index "metas", ["object_class"], name: "index_metas_on_object_class"
85
79
  add_index "metas", ["objectid"], name: "index_metas_on_objectid"
86
80
 
87
- create_table "plugins_attacks", force: :cascade do |t|
88
- t.string "path"
89
- t.string "browser_key"
90
- t.integer "site_id"
91
- t.datetime "created_at"
92
- end
93
-
94
- add_index "plugins_attacks", ["browser_key"], name: "index_plugins_attacks_on_browser_key"
95
- add_index "plugins_attacks", ["path"], name: "index_plugins_attacks_on_path"
96
- add_index "plugins_attacks", ["site_id"], name: "index_plugins_attacks_on_site_id"
97
-
98
81
  create_table "plugins_contact_forms", force: :cascade do |t|
99
82
  t.integer "site_id"
100
83
  t.integer "count"
data/spec/spec_helper.rb CHANGED
@@ -45,9 +45,9 @@ end
45
45
  #****** configuration to test using poltergeist *****#
46
46
  require 'capybara/poltergeist'
47
47
  # Note: you need phantomjs 1.9.x which can be downloaded from here: https://code.google.com/archive/p/phantomjs/downloads
48
- if File.exist?(File.join(CAMALEON_CMS_ROOT, '..', 'phantomjs'))
48
+ if File.exist?(File.join(CAMALEON_CMS_ROOT, 'spec', 'bin', 'phantomjs'))
49
49
  Capybara.register_driver :poltergeist do |app|
50
- Capybara::Poltergeist::Driver.new(app, :phantomjs => File.join(CAMALEON_CMS_ROOT, '..', 'phantomjs').to_s)
50
+ Capybara::Poltergeist::Driver.new(app, :phantomjs => File.join(CAMALEON_CMS_ROOT, 'spec', 'bin', 'phantomjs').to_s)
51
51
  end
52
52
  end
53
53
  Capybara.javascript_driver = :poltergeist
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: camaleon_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.3.12
4
+ version: 2.4.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Owen Peredo Diaz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-14 00:00:00.000000000 Z
11
+ date: 2017-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.0.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.0.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: cancancan
29
43
  requirement: !ruby/object:Gem::Requirement