lockdown 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/History.txt +8 -0
  2. data/Manifest.txt +0 -36
  3. data/lib/lockdown/controller.rb +2 -2
  4. data/lib/lockdown/version.rb +1 -1
  5. data/rails_generators/lockdown/lockdown_generator.rb +56 -57
  6. data/website/generator.html +1 -1
  7. data/website/index.html +1 -1
  8. metadata +2 -38
  9. data/app_generators/lockdown/lockdown_generator.rb.orig +0 -69
  10. data/rails_generators/lockdown_all/USAGE +0 -5
  11. data/rails_generators/lockdown_all/lockdown_all_generator.rb +0 -190
  12. data/rails_generators/lockdown_all/templates/app/controllers/permissions_controller.rb +0 -22
  13. data/rails_generators/lockdown_all/templates/app/controllers/sessions_controller.rb +0 -38
  14. data/rails_generators/lockdown_all/templates/app/controllers/user_groups_controller.rb +0 -113
  15. data/rails_generators/lockdown_all/templates/app/controllers/users_controller.rb +0 -124
  16. data/rails_generators/lockdown_all/templates/app/helpers/permissions_helper.rb +0 -13
  17. data/rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb +0 -35
  18. data/rails_generators/lockdown_all/templates/app/helpers/users_helper.rb +0 -78
  19. data/rails_generators/lockdown_all/templates/app/models/permission.rb +0 -13
  20. data/rails_generators/lockdown_all/templates/app/models/profile.rb +0 -10
  21. data/rails_generators/lockdown_all/templates/app/models/user.rb +0 -72
  22. data/rails_generators/lockdown_all/templates/app/models/user_group.rb +0 -15
  23. data/rails_generators/lockdown_all/templates/app/views/permissions/_data.html.erb +0 -13
  24. data/rails_generators/lockdown_all/templates/app/views/permissions/index.html.erb +0 -16
  25. data/rails_generators/lockdown_all/templates/app/views/permissions/show.html.erb +0 -3
  26. data/rails_generators/lockdown_all/templates/app/views/sessions/new.html.erb +0 -12
  27. data/rails_generators/lockdown_all/templates/app/views/user_groups/_data.html.erb +0 -44
  28. data/rails_generators/lockdown_all/templates/app/views/user_groups/_form.html.erb +0 -11
  29. data/rails_generators/lockdown_all/templates/app/views/user_groups/edit.html.erb +0 -6
  30. data/rails_generators/lockdown_all/templates/app/views/user_groups/index.html.erb +0 -20
  31. data/rails_generators/lockdown_all/templates/app/views/user_groups/new.html.erb +0 -5
  32. data/rails_generators/lockdown_all/templates/app/views/user_groups/show.html.erb +0 -6
  33. data/rails_generators/lockdown_all/templates/app/views/users/_data.html.erb +0 -62
  34. data/rails_generators/lockdown_all/templates/app/views/users/_form.html.erb +0 -18
  35. data/rails_generators/lockdown_all/templates/app/views/users/_password.html.erb +0 -5
  36. data/rails_generators/lockdown_all/templates/app/views/users/edit.html.erb +0 -6
  37. data/rails_generators/lockdown_all/templates/app/views/users/index.html.erb +0 -22
  38. data/rails_generators/lockdown_all/templates/app/views/users/new.html.erb +0 -5
  39. data/rails_generators/lockdown_all/templates/app/views/users/show.html.erb +0 -4
  40. data/rails_generators/lockdown_all/templates/db/migrate/create_admin_user_and_user_group.rb +0 -19
  41. data/rails_generators/lockdown_all/templates/db/migrate/create_permissions.rb +0 -19
  42. data/rails_generators/lockdown_all/templates/db/migrate/create_profiles.rb +0 -26
  43. data/rails_generators/lockdown_all/templates/db/migrate/create_user_groups.rb +0 -19
  44. data/rails_generators/lockdown_all/templates/db/migrate/create_users.rb +0 -17
@@ -1,62 +0,0 @@
1
- <!--
2
- take the style block out. this is duplicated in users/_data.html.erb
3
- without this, the user group selection is just no good
4
- -->
5
- <style>
6
- .checklist{
7
- overflow: auto;
8
- border: 1px solid #ccc;
9
- list-style: none;
10
- height: 300px;
11
- text-align: left;
12
- list-style: none;
13
- margin-left: 12px;
14
- }
15
-
16
- .checklist li{
17
- padding-left: 6px;
18
- }
19
-
20
- li.even_checked,
21
- li.even{
22
- background: #DFDFDF;
23
- }
24
-
25
- li.even_checked,
26
- li.odd_checked{
27
- color: red;
28
- }
29
- </style>
30
-
31
- <p>
32
- <b>First name</b><br />
33
- <%= profile_first_name_value %>
34
- </p>
35
- <p>
36
- <b>Last name</b><br />
37
- <%= profile_last_name_value %>
38
- </p>
39
- <p>
40
- <b>Email</b><br />
41
- <%= profile_email_value %>
42
- </p>
43
- <p>
44
- <b><span>L</span>ogin</b><br />
45
- <%= user_login_value %>
46
- </p>
47
-
48
- <% unless @action_name == "show" -%>
49
- <p id="password">
50
- <% if @user.new_record? %>
51
- <%= render :partial => "password" %>
52
- <% else %>
53
- <a href="#" onclick="change_password()">Change Password</a><br/>
54
- <% end %>
55
- </p>
56
- <% end -%>
57
-
58
- <p>
59
- <b>User Groups</b><br />
60
- <%= user_user_groups_value %>
61
- </p>
62
-
@@ -1,18 +0,0 @@
1
- <%
2
- submit_label = "Update"
3
- submit_label = "Create" if @user.new_record?
4
- -%>
5
-
6
- <script type="text/javascript">
7
- function change_password()
8
- {
9
- new Ajax.Request("/users/change_password", {asynchronous: true, postBody: 'authenticity_token=<%= form_authenticity_token %>'});
10
- }
11
- </script>
12
- <%= error_messages_for :profile %>
13
- <%= error_messages_for :user %>
14
-
15
- <% form_for(@user) do |f| %>
16
- <%= render :partial => "data", :locals => {:f => f} %>
17
- <p> <%= f.submit submit_label %> </p>
18
- <% end %>
@@ -1,5 +0,0 @@
1
- <b><span>P</span>assword</b><br />
2
- <%= user_password_value %>
3
- <br/><br/>
4
- <b><span>P</span>assword confirmation</b><br />
5
- <%= user_password_confirmation_value %>
@@ -1,6 +0,0 @@
1
- <h1>Editing User</h1>
2
-
3
- <%= render :partial => "form" %>
4
-
5
- <%= link_to 'Show', @user %> |
6
- <%= link_to 'Back', users_path %>
@@ -1,22 +0,0 @@
1
- <h1>Listing Users</h1>
2
-
3
- <table>
4
- <tr>
5
- <th>Login</th>
6
- <th>Name</th>
7
- </tr>
8
-
9
- <% @users.each do |user| %>
10
- <tr>
11
- <td><%=h user.login %></td>
12
- <td><%=h user.full_name %></td>
13
- <td><%= link_to 'Show', user %></td>
14
- <td><%= link_to 'Edit', edit_user_path(user) %></td>
15
- <td><%= link_to 'Destroy', user, :confirm => 'Are you sure?', :method => :delete %></td>
16
- </tr>
17
- <% end %>
18
- </table>
19
-
20
- <br />
21
-
22
- <%= link_to 'New User', new_user_path %>
@@ -1,5 +0,0 @@
1
- <h1>New User</h1>
2
-
3
- <%= render :partial => "form" %>
4
-
5
- <%= link_to 'Back', users_path %>
@@ -1,4 +0,0 @@
1
- <%= render :partial => "data", :locals => {:f => nil} %>
2
-
3
- <%= link_to 'Edit', edit_user_path(@user) %> |
4
- <%= link_to 'Back', users_path %>
@@ -1,19 +0,0 @@
1
- class CreateAdminUserAndUserGroup < ActiveRecord::Migration
2
- def self.up
3
- # TODO: Change the password
4
- u = User.new( :password => "password",
5
- :password_confirmation => "password",
6
- :login => "admin")
7
-
8
- u.profile = Profile.create(:first_name => "Administrator",
9
- :last_name => "User",
10
- :email => "administrator@a.com")
11
- u.save
12
-
13
- Lockdown::System.make_user_administrator(u)
14
- end
15
-
16
- def self.down
17
- #Nothing to see here...
18
- end
19
- end
@@ -1,19 +0,0 @@
1
- class CreatePermissions < ActiveRecord::Migration
2
- def self.up
3
- create_table :permissions do |t|
4
- t.string :name
5
-
6
- t.timestamps
7
- end
8
-
9
- create_table :permissions_user_groups, :id => false do |t|
10
- t.integer :permission_id
11
- t.integer :user_group_id
12
- end
13
- end
14
-
15
- def self.down
16
- drop_table :permissions_user_groups
17
- drop_table :permissions
18
- end
19
- end
@@ -1,26 +0,0 @@
1
- class CreateProfiles < ActiveRecord::Migration
2
- def self.up
3
- create_table :profiles do |t|
4
- t.string :first_name
5
- t.string :last_name
6
- t.string :email
7
- t.integer :updated_by
8
- t.boolean :is_disabled
9
-
10
- t.timestamps
11
- end
12
-
13
- # The System profile is used as the updated_by reference when records
14
- # are created programatically and the responsible user cannot be determined
15
- # or is simply not available.
16
- # TODO: Change email address
17
- Profile.create(:first_name => "System",
18
- :last_name => "User",
19
- :email => "system@a.com")
20
-
21
- end
22
-
23
- def self.down
24
- drop_table :profiles
25
- end
26
- end
@@ -1,19 +0,0 @@
1
- class CreateUserGroups < ActiveRecord::Migration
2
- def self.up
3
- create_table :user_groups do |t|
4
- t.string :name
5
-
6
- t.timestamps
7
- end
8
-
9
- create_table :user_groups_users, :id => false do |t|
10
- t.integer :user_group_id
11
- t.integer :user_id
12
- end
13
- end
14
-
15
- def self.down
16
- drop_table :user_groups_users
17
- drop_table :user_groups
18
- end
19
- end
@@ -1,17 +0,0 @@
1
- class CreateUsers < ActiveRecord::Migration
2
- def self.up
3
- create_table :users do |t|
4
- t.string :login
5
- t.string :crypted_password
6
- t.string :salt
7
- t.integer :profile_id
8
- t.integer :updated_by
9
-
10
- t.timestamps
11
- end
12
- end
13
-
14
- def self.down
15
- drop_table :users
16
- end
17
- end