lockdown 0.5.7 → 0.5.8

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.8 2008-06-17
2
+ * Fixed: External links are no longer restricted by link_to security.
3
+ * Modified: Name of migration that adds admin user.
4
+
1
5
  == 0.5.7 2008-06-13
2
6
  * Fixed: Change password template, removed ajax usage. Issue: http://stonean.com/issues/show/5
3
7
 
data/Manifest.txt CHANGED
@@ -49,7 +49,7 @@ rails_generators/lockdown/templates/app/views/users/edit.html.erb
49
49
  rails_generators/lockdown/templates/app/views/users/index.html.erb
50
50
  rails_generators/lockdown/templates/app/views/users/new.html.erb
51
51
  rails_generators/lockdown/templates/app/views/users/show.html.erb
52
- rails_generators/lockdown/templates/db/migrate/create_admin_user_and_user_group.rb
52
+ rails_generators/lockdown/templates/db/migrate/create_admin_user.rb
53
53
  rails_generators/lockdown/templates/db/migrate/create_permissions.rb
54
54
  rails_generators/lockdown/templates/db/migrate/create_profiles.rb
55
55
  rails_generators/lockdown/templates/db/migrate/create_user_groups.rb
data/README.txt CHANGED
@@ -1,20 +1,20 @@
1
1
  = lockdown
2
2
 
3
- http://lockdown.rubyforge.org
3
+ http://stonean.com/wiki/lockdown
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- Lockdown is a authentication/authorization system for RubyOnRails and Merb.
7
+ Lockdown is a authentication/authorization system for RubyOnRails. (Merb compatibility coming soon).
8
8
 
9
- For more information please visit the rubyforge site.
9
+ For more information please visit stonean.com
10
10
 
11
11
  == REQUIREMENTS:
12
12
 
13
13
  Lockdown currently supports:
14
14
 
15
- Frameworks: RubyOnRails or Merb
15
+ Frameworks: RubyOnRails
16
16
 
17
- ORMs: ActiveRecord or DataMapper
17
+ ORMs: ActiveRecord
18
18
 
19
19
  == INSTALL:
20
20
 
@@ -185,13 +185,17 @@ module Lockdown
185
185
  # continue on
186
186
  end
187
187
 
188
+ # Passing in different domain
189
+ return true if remote_url?(url_parts[2])
190
+
188
191
  false
189
192
  end
190
193
 
191
194
  def access_denied(e)
192
- if Lockdown::System.fetch(:logout_on_access_violation)
193
- reset_session
194
- end
195
+ if Lockdown::System.fetch(:logout_on_access_violation)
196
+ reset_session
197
+ end
198
+
195
199
  respond_to do |accepts|
196
200
  accepts.html do
197
201
  store_location
@@ -209,7 +213,11 @@ module Lockdown
209
213
  def path_from_hash(hsh)
210
214
  hsh[:controller].to_s + "/" + hsh[:action].to_s
211
215
  end
212
-
216
+
217
+ def remote_url?(domain = nil)
218
+ return false if domain.nil? || domain.strip.length == 0
219
+ request.host.downcase != domain.downcase
220
+ end
213
221
  end # InstanceMethods
214
222
  end # Rails
215
223
  end # Controller
@@ -2,7 +2,7 @@ module Lockdown #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- TINY = 7
5
+ TINY = 8
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -149,9 +149,9 @@ class LockdownGenerator < Rails::Generator::Base
149
149
  end
150
150
 
151
151
  begin
152
- m.migration_template "db/migrate/create_admin_user_and_user_group.rb",
152
+ m.migration_template "db/migrate/create_admin_user.rb",
153
153
  "db/migrate",
154
- :migration_file_name => "create_admin_user_and_user_group"
154
+ :migration_file_name => "create_admin_user"
155
155
  rescue
156
156
  puts "Admin User Group... migration exists"
157
157
  end
@@ -1,4 +1,4 @@
1
- class CreateAdminUserAndUserGroup < ActiveRecord::Migration
1
+ class CreateAdminUser < ActiveRecord::Migration
2
2
  def self.up
3
3
  # TODO: Change the password
4
4
  u = User.new( :password => "password",
@@ -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.7</a>
36
+ <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.8</a>
37
37
  </div>
38
38
  <h2>What</h2>
39
39
 
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.7</a>
36
+ <a href="http://rubyforge.org/projects/lockdown" class="numbers">0.5.8</a>
37
37
  </div>
38
38
  <h2>What</h2>
39
39
 
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.7
4
+ version: 0.5.8
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-06-13 00:00:00 -04:00
12
+ date: 2008-06-17 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -88,7 +88,7 @@ files:
88
88
  - rails_generators/lockdown/templates/app/views/users/index.html.erb
89
89
  - rails_generators/lockdown/templates/app/views/users/new.html.erb
90
90
  - rails_generators/lockdown/templates/app/views/users/show.html.erb
91
- - rails_generators/lockdown/templates/db/migrate/create_admin_user_and_user_group.rb
91
+ - rails_generators/lockdown/templates/db/migrate/create_admin_user.rb
92
92
  - rails_generators/lockdown/templates/db/migrate/create_permissions.rb
93
93
  - rails_generators/lockdown/templates/db/migrate/create_profiles.rb
94
94
  - rails_generators/lockdown/templates/db/migrate/create_user_groups.rb