burp_cms 1.3.20 → 1.3.21

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
  SHA1:
3
- metadata.gz: d802a4742ce33b8f7328c3d0c4403c178bc28d7e
4
- data.tar.gz: ad45d06949b739f1b7390f0f70fdad51e74b4702
3
+ metadata.gz: 90816dfafb7b8d198d375659eded50e913cb071d
4
+ data.tar.gz: 699e7ab650690613be2e0eda642a03554e849511
5
5
  SHA512:
6
- metadata.gz: 0cdc26a4f3b0b0376030ff19e614bd2cac0d3219f58eeae5952e6056d9344286141b864cd6b3293279500b296d8a717c96265c95ea9b7bf2314f9b1cd6600347
7
- data.tar.gz: f6cf1dbad3d5e1ddd5dc185c5635702a2ef8cc7a18c6c3b1c5ef4e23592dad65af3cd110b16f0dcacf325adb528b842ba2a1cad74d8e5e357431170bfb643d60
6
+ metadata.gz: d4b98fddc20fc618794efb84b183d1e8e3fc71a0822ba92fc57d8628a87bb495dc06e0a6696f839f264dac6f38446c7f3c29d20a43a77b8ea66323c3d94c65b2
7
+ data.tar.gz: 34ae4f281246c95e51a18c0b47440aa893557de93aa3423f85da1ca7a36a10902dc9d287d6eca3bdf2f81709b31647d449d7b5921e5e02430da0e58325b8b8a5
@@ -287,11 +287,13 @@
287
287
  this.element.html("");
288
288
  this.element.append(tempElement.children());
289
289
 
290
- initializeMovable(this, this.element.find('img'), function(element, positionClass) {
291
- $(element).removeClass('left center right');
292
- $(element).addClass(positionClass);
293
- return element;
294
- });
290
+ setTimeout(function() {
291
+ initializeMovable(_this, _this.element.find('> img'), function(element, positionClass) {
292
+ $(element).removeClass('left center right');
293
+ $(element).addClass(positionClass);
294
+ return element;
295
+ });
296
+ },10);
295
297
  },
296
298
 
297
299
  makeDroppable: function(elements, createCallback) {
@@ -2,7 +2,6 @@ module Burp
2
2
  class ApplicationController < ActionController::Base
3
3
 
4
4
  protect_from_forgery
5
- before_filter :refresh_access
6
5
  before_filter :authenticate
7
6
  before_filter :init_body_classes
8
7
 
@@ -19,12 +18,12 @@ module Burp
19
18
 
20
19
  private
21
20
 
22
- def refresh_access
23
- Burp.access.refresh
21
+ def access
22
+ @access ||= Burp.new_access_instance(request, self)
24
23
  end
25
24
 
26
25
  def authenticate
27
- unless Burp.access.may_skip_http_auth? || Rails.env == "test"
26
+ unless access.may_skip_http_auth? || Rails.env == "test"
28
27
 
29
28
  if !Rails.application.config.respond_to?(:burp_password) or !Rails.application.config.respond_to?(:burp_username)
30
29
  raise "config.burp_username and config.burp_password are not set.\n\nYou can fix this by adding them to application.rb."
@@ -7,8 +7,9 @@ class Burp::CatchAllController < ApplicationController
7
7
  @menu = Burp::Menu.find("main")
8
8
  @burp_page_path = params[:burp_page_path] || request.path
9
9
  @cms_page = Burp.find_page(@burp_page_path)
10
- Burp.access.refresh
11
- Burp.access.may_view_page!(@cms_page)
10
+
11
+ @access = self.respond_to?(:access) ? self.access : Burp.new_access_instance(request, self)
12
+ @access.may_view_page!(@cms_page)
12
13
 
13
14
  raise ActionController::RoutingError.new('Page not Found') if @cms_page.nil?
14
15
 
@@ -8,7 +8,7 @@ module Burp
8
8
 
9
9
  def index
10
10
 
11
- Burp.access.may_view_file_list! do
11
+ access.may_view_file_list! do
12
12
 
13
13
  @files = FileModel.all
14
14
 
@@ -39,7 +39,7 @@ module Burp
39
39
  if File.expand_path(file_path) != file_path
40
40
  render :text => "403, Forbiden!", :status => 403, :content_type => "text/plain"
41
41
  elsif File.exist?(file_path)
42
- Burp.access.may_view_file!(file_path) do
42
+ access.may_view_file!(file_path) do
43
43
 
44
44
  headers["Cache-Control"] = "Public"
45
45
  headers["Last-Modified"] = File.mtime(file_path).utc.rfc2822
@@ -56,7 +56,7 @@ module Burp
56
56
  end
57
57
 
58
58
  def create
59
- Burp.access.may_upload_a_file! do
59
+ access.may_upload_a_file! do
60
60
  Util::UploadHandler.handle(params[:qqfile],request) do |file|
61
61
 
62
62
  errors = []
@@ -2,14 +2,14 @@ module Burp
2
2
  class PagesController < Burp::ApplicationController
3
3
 
4
4
  def index
5
- Burp.access.may_view_page_list! do
5
+ access.may_view_page_list! do
6
6
  @pages = PageModel.all
7
7
  end
8
8
  end
9
9
 
10
10
  def edit
11
11
  @page = PageModel.find(("/"+params[:id]).gsub("/$root","/"))
12
- Burp.access.may_edit_page!(@page) do
12
+ access.may_edit_page!(@page) do
13
13
 
14
14
  respond_to do |format|
15
15
  format.html {}
@@ -21,7 +21,7 @@ module Burp
21
21
  def show
22
22
  path = ("/"+params[:id]).gsub("/$root","/")
23
23
  @page = PageModel.find(path)
24
- Burp.access.may_view_page_data!(@page) do
24
+ access.may_view_page_data!(@page) do
25
25
 
26
26
  respond_to do |format|
27
27
  format.html {
@@ -34,14 +34,14 @@ module Burp
34
34
 
35
35
  def new
36
36
  @page = PageModel.new
37
- Burp.access.may_create_new_page! do
37
+ access.may_create_new_page! do
38
38
  render :action => :edit
39
39
  end
40
40
  end
41
41
 
42
42
  def create
43
43
 
44
- Burp.access.may_create_new_page! do
44
+ access.may_create_new_page! do
45
45
 
46
46
  @page = PageModel.new
47
47
 
@@ -73,7 +73,7 @@ module Burp
73
73
  def update
74
74
 
75
75
  @page = PageModel.find(("/"+params[:id]).gsub("/$root","/")) || PageModel.new(:path => ("/"+params[:id]).gsub("/$root","/"))
76
- Burp.access.may_update_page!(@page) do
76
+ access.may_update_page!(@page) do
77
77
 
78
78
  @page.title = params[:page][:title] if params[:page][:title]
79
79
  @page.path = params[:page][:path] if params[:page][:path]
@@ -99,7 +99,7 @@ module Burp
99
99
  def destroy
100
100
 
101
101
  @page = PageModel.find(("/"+params[:id]).gsub("/$root","/"))
102
- Burp.access.may_remove_page!(@page) do
102
+ access.may_remove_page!(@page) do
103
103
 
104
104
  @page.remove
105
105
  redirect_to "/burp/pages/"
@@ -1,7 +1,7 @@
1
1
  module Burp
2
2
  class StaticController < Burp::ApplicationController
3
3
  def index
4
- Burp.access.may_view_static_page!(params[:action])
4
+ access.may_view_static_page!(params[:action])
5
5
  end
6
6
 
7
7
  def help
@@ -1,8 +1,7 @@
1
1
  module Burp
2
2
  class Access
3
3
 
4
- def initialize(data)
5
- end
4
+ include MayI
6
5
 
7
6
  # If true no http auth check will be made. (Ment as a way to remove Burp's default auth method.)
8
7
  def may_skip_http_auth
data/lib/burp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Burp
2
- VERSION = "1.3.20"
2
+ VERSION = "1.3.21"
3
3
  end
data/lib/burp_cms.rb CHANGED
@@ -10,6 +10,7 @@ require "burp/version"
10
10
  module Burp
11
11
 
12
12
  @@content_directory = nil
13
+ @@access_builder = nil
13
14
 
14
15
 
15
16
  def self.find_page(path)
@@ -21,8 +22,16 @@ module Burp
21
22
 
22
23
 
23
24
 
24
- def self.access
25
- @@access ||= MayI::Access.new("Burp::Access")
25
+ def self.new_access_instance(request, controller)
26
+ if @@access_builder
27
+ @@access_builder.call(request, controller)
28
+ else
29
+ Burp::Access.new
30
+ end
31
+ end
32
+
33
+ def self.set_access_builder=(&block)
34
+ @@access_builder = block
26
35
  end
27
36
 
28
37
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: burp_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.20
4
+ version: 1.3.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darwin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-27 00:00:00.000000000 Z
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jquery-rails
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: mayi
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
- version: 1.0.0
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
- version: 1.0.0
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: therubyracer
71
71
  requirement: !ruby/object:Gem::Requirement