lockdown 0.5.19 → 0.5.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.5.20 2008-08-04
2
+ * Fixed authorized? method to avoid ActionController::Routing::Routes.recognize_path invalid return values
3
+ * Added option[:session_timeout_method]. This method will be called when the session times out.
4
+
1
5
  == 0.5.19 2008-08-01
2
6
  * Modified the lockdown system to account for permissions added/removed from user groups in init.rb. This will NOT manage user groups defined via the admin screens.
3
7
  == 0.5.18 2008-07-23
@@ -11,6 +11,9 @@ Lockdown::System.configure do
11
11
  # Set timeout to 1 hour:
12
12
  # options[:session_timeout] = (60 * 60)
13
13
  #
14
+ # Call method when timeout occurs (method must be callable by controller):
15
+ # options[:session_timeout_method] = :clear_session_values
16
+ #
14
17
  # Set system to logout if unauthorized access is attempted:
15
18
  # options[:logout_on_access_violation] = false
16
19
  #
@@ -46,6 +46,10 @@ module Lockdown
46
46
  def check_session_expiry
47
47
  if session[:expiry_time] && session[:expiry_time] < Time.now
48
48
  nil_lockdown_values
49
+ timeout_method = Lockdown::System.fetch(:session_timeout_method)
50
+ if timeout_method.is_a?(Symbol) && self.respond_to?(timeout_method)
51
+ send(timeout_method)
52
+ end
49
53
  end
50
54
  session[:expiry_time] = Time.now + Lockdown::System.fetch(:session_timeout)
51
55
  end
@@ -181,11 +185,11 @@ module Lockdown
181
185
 
182
186
  # Test for a named routed
183
187
  begin
184
- hsh = ActionController::Routing::Routes.recognize_path(url)
185
- unless hsh.nil?
188
+ hsh = ActionController::Routing::Routes.recognize_path(path)
189
+ unless hsh.nil? || hsh[:id]
186
190
  return true if path_allowed?(path_from_hash(hsh))
187
191
  end
188
- rescue Exception => e
192
+ rescue Exception
189
193
  # continue on
190
194
  end
191
195
 
@@ -2,7 +2,7 @@ module Lockdown #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 19
5
+ TINY = 20
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>Lockdown</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/lockdown"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.19</a>
36
+ <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.20</a>
37
37
  </div>
38
38
  <h2>What</h2>
39
39
  <p>Lockdown is a authentication/authorization system for RubyOnRails (ver 2.x). While Merb functionality is in place, it is not complete. There will be a release solely focused on getting the Merb functionality up to par with Rails.</p>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lockdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.19
4
+ version: 0.5.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-01 00:00:00 -04:00
12
+ date: 2008-08-04 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency