lockdown 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/Manifest.txt +0 -36
- data/lib/lockdown/controller.rb +2 -2
- data/lib/lockdown/version.rb +1 -1
- data/rails_generators/lockdown/lockdown_generator.rb +56 -57
- data/website/generator.html +1 -1
- data/website/index.html +1 -1
- metadata +2 -38
- data/app_generators/lockdown/lockdown_generator.rb.orig +0 -69
- data/rails_generators/lockdown_all/USAGE +0 -5
- data/rails_generators/lockdown_all/lockdown_all_generator.rb +0 -190
- data/rails_generators/lockdown_all/templates/app/controllers/permissions_controller.rb +0 -22
- data/rails_generators/lockdown_all/templates/app/controllers/sessions_controller.rb +0 -38
- data/rails_generators/lockdown_all/templates/app/controllers/user_groups_controller.rb +0 -113
- data/rails_generators/lockdown_all/templates/app/controllers/users_controller.rb +0 -124
- data/rails_generators/lockdown_all/templates/app/helpers/permissions_helper.rb +0 -13
- data/rails_generators/lockdown_all/templates/app/helpers/user_groups_helper.rb +0 -35
- data/rails_generators/lockdown_all/templates/app/helpers/users_helper.rb +0 -78
- data/rails_generators/lockdown_all/templates/app/models/permission.rb +0 -13
- data/rails_generators/lockdown_all/templates/app/models/profile.rb +0 -10
- data/rails_generators/lockdown_all/templates/app/models/user.rb +0 -72
- data/rails_generators/lockdown_all/templates/app/models/user_group.rb +0 -15
- data/rails_generators/lockdown_all/templates/app/views/permissions/_data.html.erb +0 -13
- data/rails_generators/lockdown_all/templates/app/views/permissions/index.html.erb +0 -16
- data/rails_generators/lockdown_all/templates/app/views/permissions/show.html.erb +0 -3
- data/rails_generators/lockdown_all/templates/app/views/sessions/new.html.erb +0 -12
- data/rails_generators/lockdown_all/templates/app/views/user_groups/_data.html.erb +0 -44
- data/rails_generators/lockdown_all/templates/app/views/user_groups/_form.html.erb +0 -11
- data/rails_generators/lockdown_all/templates/app/views/user_groups/edit.html.erb +0 -6
- data/rails_generators/lockdown_all/templates/app/views/user_groups/index.html.erb +0 -20
- data/rails_generators/lockdown_all/templates/app/views/user_groups/new.html.erb +0 -5
- data/rails_generators/lockdown_all/templates/app/views/user_groups/show.html.erb +0 -6
- data/rails_generators/lockdown_all/templates/app/views/users/_data.html.erb +0 -62
- data/rails_generators/lockdown_all/templates/app/views/users/_form.html.erb +0 -18
- data/rails_generators/lockdown_all/templates/app/views/users/_password.html.erb +0 -5
- data/rails_generators/lockdown_all/templates/app/views/users/edit.html.erb +0 -6
- data/rails_generators/lockdown_all/templates/app/views/users/index.html.erb +0 -22
- data/rails_generators/lockdown_all/templates/app/views/users/new.html.erb +0 -5
- data/rails_generators/lockdown_all/templates/app/views/users/show.html.erb +0 -4
- data/rails_generators/lockdown_all/templates/db/migrate/create_admin_user_and_user_group.rb +0 -19
- data/rails_generators/lockdown_all/templates/db/migrate/create_permissions.rb +0 -19
- data/rails_generators/lockdown_all/templates/db/migrate/create_profiles.rb +0 -26
- data/rails_generators/lockdown_all/templates/db/migrate/create_user_groups.rb +0 -19
- 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,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,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
|