authengine 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +10 -0
- data/.rspec +1 -0
- data/Gemfile +4 -0
- data/README.md +86 -0
- data/Rakefile +31 -0
- data/app/assets/images/message_block/back.gif +0 -0
- data/app/assets/images/message_block/back_m.gif +0 -0
- data/app/assets/images/message_block/confirmation.gif +0 -0
- data/app/assets/images/message_block/confirmation_m.gif +0 -0
- data/app/assets/images/message_block/error.gif +0 -0
- data/app/assets/images/message_block/error_m.gif +0 -0
- data/app/assets/images/message_block/info.gif +0 -0
- data/app/assets/images/message_block/info_m.gif +0 -0
- data/app/assets/images/message_block/notice.gif +0 -0
- data/app/assets/images/message_block/notice_m.gif +0 -0
- data/app/assets/images/message_block/warn.gif +0 -0
- data/app/assets/images/message_block/warn_m.gif +0 -0
- data/app/assets/stylesheets/authengine.css +3 -0
- data/app/assets/stylesheets/message_block.css +45 -0
- data/app/controllers/authengine/accounts_controller.rb +56 -0
- data/app/controllers/authengine/action_roles_controller.rb +22 -0
- data/app/controllers/authengine/actions_controller.rb +17 -0
- data/app/controllers/authengine/roles_controller.rb +35 -0
- data/app/controllers/authengine/sessions_controller.rb +75 -0
- data/app/controllers/authengine/user_roles_controller.rb +55 -0
- data/app/controllers/authengine/useractions_controller.rb +17 -0
- data/app/controllers/authengine/users_controller.rb +137 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/authengine/users_helper.rb +11 -0
- data/app/helpers/roles_helper.rb +2 -0
- data/app/mailers/authengine/user_mailer.rb +53 -0
- data/app/models/action.rb +54 -0
- data/app/models/action_role.rb +29 -0
- data/app/models/authenticated_system.rb +179 -0
- data/app/models/authorized_system.rb +41 -0
- data/app/models/controller.rb +124 -0
- data/app/models/role.rb +71 -0
- data/app/models/session.rb +3 -0
- data/app/models/session_role.rb +17 -0
- data/app/models/user.rb +191 -0
- data/app/models/user_observer.rb +14 -0
- data/app/models/user_role.rb +4 -0
- data/app/models/useraction.rb +56 -0
- data/app/views/authengine/accounts/edit.html.erb +19 -0
- data/app/views/authengine/actions/create.html.erb +2 -0
- data/app/views/authengine/actions/destroy.html.erb +2 -0
- data/app/views/authengine/actions/edit.html.erb +80 -0
- data/app/views/authengine/actions/index.html.haml +26 -0
- data/app/views/authengine/actions/new.html.erb +2 -0
- data/app/views/authengine/actions/show.html.erb +8 -0
- data/app/views/authengine/actions/update.html.erb +11 -0
- data/app/views/authengine/admin/_show.html.haml +5 -0
- data/app/views/authengine/layouts/authengine.html.haml +9 -0
- data/app/views/authengine/roles/index.html.haml +12 -0
- data/app/views/authengine/roles/new.html.haml +15 -0
- data/app/views/authengine/roles/show.html.erb +8 -0
- data/app/views/authengine/sessions/new.html.haml +18 -0
- data/app/views/authengine/user_mailer/activation.html.erb +5 -0
- data/app/views/authengine/user_mailer/forgot_password.html.erb +3 -0
- data/app/views/authengine/user_mailer/message_to_admin.html.erb +2 -0
- data/app/views/authengine/user_mailer/reset_password.html.erb +1 -0
- data/app/views/authengine/user_mailer/signup_notification.html.erb +5 -0
- data/app/views/authengine/user_roles/edit.html.haml +10 -0
- data/app/views/authengine/user_roles/index.html.haml +14 -0
- data/app/views/authengine/user_roles/new.html.haml +8 -0
- data/app/views/authengine/useractions/_useraction.html.erb +6 -0
- data/app/views/authengine/useractions/index.html.erb +13 -0
- data/app/views/authengine/useractions/show.html.haml +14 -0
- data/app/views/authengine/useractions/update.html.erb +2 -0
- data/app/views/authengine/users/_no_privacy_policy.html.haml +1 -0
- data/app/views/authengine/users/_privacy_policy_example.html.haml +36 -0
- data/app/views/authengine/users/_user.html.haml +19 -0
- data/app/views/authengine/users/edit.html.haml +24 -0
- data/app/views/authengine/users/index.html.haml +10 -0
- data/app/views/authengine/users/new.html.haml +31 -0
- data/app/views/authengine/users/show.html.haml +19 -0
- data/app/views/authengine/users/signup.html.haml +52 -0
- data/authengine.gemspec +44 -0
- data/config/application.rb +1 -0
- data/config/routes.rb +43 -0
- data/db/migrate/20110320171029_create_authengine_tables.rb +90 -0
- data/db/migrate/20110924165900_add_parent_id_to_roles_table.rb +5 -0
- data/db/migrate/20110925202800_add_type_field_to_user_roles_table.rb +5 -0
- data/db/migrate/20111003074700_add_indexes_to_several_tables.rb +7 -0
- data/db/seeds.rb +7 -0
- data/lib/application_helper.rb +19 -0
- data/lib/authengine.rb +5 -0
- data/lib/authengine/engine.rb +44 -0
- data/lib/authengine/testing_support/factories/user_factory.rb +13 -0
- data/lib/authengine/version.rb +3 -0
- data/lib/rails/generators/authengine/authengine_generator.rb +160 -0
- data/lib/rails/generators/authengine/templates/initializer.rb +3 -0
- data/lib/rails/generators/authengine/templates/migration.rb +16 -0
- data/lib/rails/generators/authengine/templates/pre_populate_database.rb +20 -0
- data/lib/rails/generators/authengine/templates/schema.rb +69 -0
- data/lib/tasks/bootstrap.rake +29 -0
- data/spec/authengine_spec.rb +7 -0
- data/spec/dummy/.rspec +1 -0
- data/spec/dummy/Gemfile +3 -0
- data/spec/dummy/Rakefile +8 -0
- data/spec/dummy/app/assets/javascripts/jasmine_examples/Player.js +22 -0
- data/spec/dummy/app/assets/javascripts/jasmine_examples/Song.js +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +50 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +22 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +26 -0
- data/spec/dummy/config/environments/production.rb +49 -0
- data/spec/dummy/config/environments/test.rb +35 -0
- data/spec/dummy/config/initializers/application.rb +1 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +87 -0
- data/spec/dummy/lib/constants.rb +5 -0
- data/spec/dummy/log/development.log +117 -0
- data/spec/dummy/log/production.log +0 -0
- data/spec/dummy/log/server.log +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/javascripts/application.js +2 -0
- data/spec/dummy/public/javascripts/controls.js +965 -0
- data/spec/dummy/public/javascripts/dragdrop.js +974 -0
- data/spec/dummy/public/javascripts/effects.js +1123 -0
- data/spec/dummy/public/javascripts/prototype.js +6001 -0
- data/spec/dummy/public/javascripts/rails.js +191 -0
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/spec/javascripts/helpers/.gitkeep +0 -0
- data/spec/dummy/spec/javascripts/helpers/SpecHelper.js +9 -0
- data/spec/dummy/spec/javascripts/jasmine_examples/PlayerSpec.js +58 -0
- data/spec/dummy/spec/javascripts/support/jasmine.yml +76 -0
- data/spec/generators/authengine_generator_spec.rb +11 -0
- data/spec/integration/navigation_spec.rb +9 -0
- data/spec/javascripts/spec.css +3 -0
- data/spec/javascripts/spec.js.coffee +2 -0
- data/spec/models/action_role_spec.rb +59 -0
- data/spec/models/authenticated_system_spec.rb +109 -0
- data/spec/models/role_spec.rb +38 -0
- data/spec/models/user_factory_spec.rb +7 -0
- data/spec/models/user_spec.rb +16 -0
- data/spec/requests/sessions_spec.rb +11 -0
- data/spec/spec_helper.rb +57 -0
- metadata +405 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
class UserObserver < ActiveRecord::Observer
|
2
|
+
def after_create(user)
|
3
|
+
Authengine::UserMailer.signup_notification(user).deliver
|
4
|
+
end
|
5
|
+
|
6
|
+
def after_save(user)
|
7
|
+
# the next line causes deprecation warnings in
|
8
|
+
# actionmailer/lib/actionmailer/adv_attr_accessor.rb
|
9
|
+
# this could become fatal when the deprecated methods are removed
|
10
|
+
Authengine::UserMailer.activation(user).deliver if user.pending? # pending? true if user is activated
|
11
|
+
Authengine::UserMailer.forgot_password(user).deliver if user.recently_forgot_password?
|
12
|
+
Authengine::UserMailer.reset_password(user).deliver if user.recently_reset_password?
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
class Useraction < ActiveRecord::Base
|
2
|
+
belongs_to :user
|
3
|
+
belongs_to :action
|
4
|
+
|
5
|
+
delegate :lastName, :to => :user, :prefix => true
|
6
|
+
scope :expired, :conditions => ['updated_at < ?',Time.zone.now.advance(:hours => -24)]
|
7
|
+
|
8
|
+
def self.create(params)
|
9
|
+
self.name.constantize.send(:expired).each { |u| u.destroy }
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.current
|
14
|
+
eval("Useraction#{current_index}")
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.date_range
|
18
|
+
t = Time.zone.now.to_date
|
19
|
+
t.advance(:days => -4) .. t
|
20
|
+
end
|
21
|
+
|
22
|
+
# if current index = 2
|
23
|
+
# i days before today
|
24
|
+
# 0 2
|
25
|
+
# 1 1
|
26
|
+
# 2 0
|
27
|
+
# 3 4
|
28
|
+
# 4 3
|
29
|
+
def self.date_of_index(i)
|
30
|
+
Time.zone.now.to_date.advance(:days => -((current_index - i)%5))
|
31
|
+
end
|
32
|
+
|
33
|
+
def params_truncated
|
34
|
+
# because some requests, especially the "actions" controller, produce huge params fields, with little value
|
35
|
+
# so we display a truncated version only (but full params are stored
|
36
|
+
# in the db, available for display if necessary).
|
37
|
+
if params.to_s.size > 80
|
38
|
+
p = params.to_s[0..80]+" ...more"
|
39
|
+
else
|
40
|
+
p = params.to_s
|
41
|
+
end
|
42
|
+
p.gsub(/^\{|\}$/,"") # remove start/end braces
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def self.current_index
|
48
|
+
(Time.zone.now.to_datetime - Date.new(2011,1,1)).to_i.%5
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class Useraction0 < Useraction; end
|
53
|
+
class Useraction1 < Useraction; end
|
54
|
+
class Useraction2 < Useraction; end
|
55
|
+
class Useraction3 < Useraction; end
|
56
|
+
class Useraction4 < Useraction; end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<% form_tag user_account_path(current_user), :method => :put do %>
|
2
|
+
<p><label for="old_password" class="block">Old Password</label><br />
|
3
|
+
<%= password_field_tag 'old_password', @old_password, :size => 45 %></p>
|
4
|
+
|
5
|
+
<p><label for="password" class="block">New Password</label><br />
|
6
|
+
<%= password_field_tag 'password', {}, :size => 45 %><br />
|
7
|
+
<small>Between 4 and 40 characters</small></p>
|
8
|
+
|
9
|
+
<p><label for="password_confirmation" class="block">Confirm new password</label><br />
|
10
|
+
<%= password_field_tag 'password_confirmation', {}, :size => 45 %></p>
|
11
|
+
|
12
|
+
<%= submit_tag 'Change password' %>
|
13
|
+
<br/>
|
14
|
+
<p><%= link_to("Cancel", :controller=>session[:referer][:controller], :action=>session[:referer][:action])%></p>
|
15
|
+
|
16
|
+
<% end %>
|
17
|
+
<script type='text/javascript'>
|
18
|
+
document.getElementById('old_password').focus()
|
19
|
+
</script>
|
@@ -0,0 +1,80 @@
|
|
1
|
+
<h1>Edit role</h1>
|
2
|
+
|
3
|
+
<%= error_messages_for :role %>
|
4
|
+
|
5
|
+
<% form_for(@role) do |f| %>
|
6
|
+
<table>
|
7
|
+
<tr><td>Name:</td><td colspan="3"><%= f.text_field :name %></td></tr>
|
8
|
+
<tr><td>Manage DB Users:</td>
|
9
|
+
<td> <%= f.label :read %>
|
10
|
+
<%= radio_button('role', 'manageDbUsers', 'read') %>
|
11
|
+
</td>
|
12
|
+
<td> <%= f.label :write %>
|
13
|
+
<%= radio_button('role', 'manageDbUsers', 'write') %>
|
14
|
+
</td>
|
15
|
+
<td> <%= f.label :none %>
|
16
|
+
<%= radio_button('role', 'manageDbUsers', 'none') %>
|
17
|
+
</td>
|
18
|
+
</tr>
|
19
|
+
<tr><td>Manage Students:</td>
|
20
|
+
<td> <%= f.label :read %>
|
21
|
+
<%= radio_button('role', 'manageStudents', 'read') %>
|
22
|
+
</td>
|
23
|
+
<td> <%= f.label :write %>
|
24
|
+
<%= radio_button('role', 'manageStudents', 'write') %>
|
25
|
+
</td>
|
26
|
+
<td> <%= f.label :none %>
|
27
|
+
<%= radio_button('role', 'manageStudents', 'none') %>
|
28
|
+
</td>
|
29
|
+
</tr>
|
30
|
+
<tr><td>Manage Self:</td>
|
31
|
+
<td> <%= f.label :read %>
|
32
|
+
<%= radio_button('role', 'manageSelf', 'read') %>
|
33
|
+
</td>
|
34
|
+
<td> <%= f.label :write %>
|
35
|
+
<%= radio_button('role', 'manageSelf', 'write') %>
|
36
|
+
</td>
|
37
|
+
<td> <%= f.label :none %>
|
38
|
+
<%= radio_button('role', 'manageSelf', 'none') %>
|
39
|
+
</td>
|
40
|
+
</tr>
|
41
|
+
<tr><td>Manage Queries:</td>
|
42
|
+
<td> <%= f.label :read %>
|
43
|
+
<%= radio_button('role', 'manageQueries', 'read') %>
|
44
|
+
</td>
|
45
|
+
<td> <%= f.label :write %>
|
46
|
+
<%= radio_button('role', 'manageQueries', 'write') %>
|
47
|
+
</td>
|
48
|
+
<td> <%= f.label :none %>
|
49
|
+
<%= radio_button('role', 'manageQueries', 'none') %>
|
50
|
+
</td>
|
51
|
+
</tr>
|
52
|
+
<tr><td>Manage Roles:</td>
|
53
|
+
<td> <%= f.label :read %>
|
54
|
+
<%= radio_button('role', 'manageRoles', 'read') %>
|
55
|
+
</td>
|
56
|
+
<td> <%= f.label :write %>
|
57
|
+
<%= radio_button('role', 'manageRoles', 'write') %>
|
58
|
+
</td>
|
59
|
+
<td> <%= f.label :none %>
|
60
|
+
<%= radio_button('role', 'manageRoles', 'none') %>
|
61
|
+
</td>
|
62
|
+
</tr>
|
63
|
+
<tr><td>Manage Translations:</td>
|
64
|
+
<td> <%= f.label :read %>
|
65
|
+
<%= radio_button('role', 'manageTranslations', 'read') %>
|
66
|
+
</td>
|
67
|
+
<td> <%= f.label :write %>
|
68
|
+
<%= radio_button('role', 'manageTranslations', 'write') %>
|
69
|
+
</td>
|
70
|
+
<td> <%= f.label :none %>
|
71
|
+
<%= radio_button('role', 'manageTranslations', 'none') %>
|
72
|
+
</td>
|
73
|
+
</tr>
|
74
|
+
</table>
|
75
|
+
<p>
|
76
|
+
<%= f.submit "Update" %>
|
77
|
+
</p>
|
78
|
+
<% end %>
|
79
|
+
<%= link_to 'Show', @role %> |
|
80
|
+
<%= link_to 'Back', roles_path %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
%h1 Configure Permissions for Roles
|
2
|
+
= form_tag update_all_authengine_action_roles_path,:method => :put do
|
3
|
+
%table{:style=>"width:780px"}
|
4
|
+
%tr
|
5
|
+
%th{:style=>"width:200px"}
|
6
|
+
Controller
|
7
|
+
%th{:style=>"width:125px"}
|
8
|
+
Action
|
9
|
+
- for role in @roles do
|
10
|
+
%th{:style=>"width:70px"}
|
11
|
+
= role
|
12
|
+
|
13
|
+
%div{:style=>"height:400px; width:1000px; margin-r:0px; overflow:auto"}
|
14
|
+
%table{:style=>"width:780px"}
|
15
|
+
- for action in @actions do
|
16
|
+
%tr{:class=>"#{cycle('odd', 'even')}"}
|
17
|
+
%td{:style=>"width:200px"}
|
18
|
+
= action.controller_name
|
19
|
+
%td{:style=>"width:125px"}
|
20
|
+
= action.action_name
|
21
|
+
- for role in @roles do
|
22
|
+
%td{:style=>"width:70px"}
|
23
|
+
%input{:name=>"permission[#{role.id}][#{action.id}]" , :type=>"hidden", :value=>'0'}
|
24
|
+
= check_box_tag("permission[#{role.id}][#{action.id}]", "1", @allowed[role.id].include?(action.id) )
|
25
|
+
|
26
|
+
= submit_tag 'Save'
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<h1>Update Actions</h1>
|
2
|
+
<% params[:permission].each do |role, permissions| %>
|
3
|
+
<%= "role name: #{role}):" %><br/>
|
4
|
+
<% permissions.each do |controller, actions|%>
|
5
|
+
<%= "controller: #{controller}," %><br/>
|
6
|
+
<% actions.each do |action_name, val|%>
|
7
|
+
<%= "action #{action_name}" %><br/>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
<br/>
|
11
|
+
<% end %>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
%ul
|
2
|
+
%li= link_to "Manage users", authengine_users_path
|
3
|
+
%li= link_to "Manage access roles", authengine_roles_path
|
4
|
+
%li= link_to "Manage access", authengine_actions_path
|
5
|
+
%li= link_to "Restrict access for the current session", edit_authengine_user_user_roles_path(current_user)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
= message_block :on => :role
|
2
|
+
%h1 Edit roles
|
3
|
+
%table{:cellspacing =>'0', :cellpadding => '4'}
|
4
|
+
%tr
|
5
|
+
%th Role
|
6
|
+
- for role in @all_roles
|
7
|
+
%tr
|
8
|
+
%td= role.name
|
9
|
+
%td= (link_to "Remove", authengine_role_path(role), :method => :delete) unless role.is_developer?
|
10
|
+
|
11
|
+
%p= link_to 'Add new role', :controller=>:roles, :action=>:new
|
12
|
+
%p= link_to "Cancel", admin_index_path
|
@@ -0,0 +1,15 @@
|
|
1
|
+
= message_block :on => :role
|
2
|
+
%h1 Add role
|
3
|
+
|
4
|
+
= form_for @role, :url => authengine_roles_path do |f|
|
5
|
+
%table
|
6
|
+
%tr
|
7
|
+
%td
|
8
|
+
%label{:for => :name} Name:
|
9
|
+
%td{:colspan=>"3"}= f.text_field :name, :autocomplete => 'off'
|
10
|
+
%tr
|
11
|
+
%td= f.label(:parent_id, "Parent:")
|
12
|
+
%td{:colspan=>"3"}= f.select :parent_id, @roles.collect{|r| [r.name, r.id]}
|
13
|
+
- submit_or_return_to authengine_roles_path
|
14
|
+
|
15
|
+
-focus('role_name')
|
@@ -0,0 +1,18 @@
|
|
1
|
+
- focus('login')
|
2
|
+
= message_block
|
3
|
+
- unless logged_in?
|
4
|
+
%h1 Please log in
|
5
|
+
=form_tag authengine_sessions_path do
|
6
|
+
%table
|
7
|
+
%tr
|
8
|
+
%td User name:
|
9
|
+
%td
|
10
|
+
=text_field_tag "login"
|
11
|
+
%tr
|
12
|
+
%td Password
|
13
|
+
%td
|
14
|
+
=password_field_tag "password"
|
15
|
+
%tr
|
16
|
+
%td
|
17
|
+
= submit_tag 'Log in...'
|
18
|
+
%td
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<p><%=h @user.firstName %> <%=h @user.lastName %>,</p>
|
2
|
+
<p>your <%= APPLICATION_NAME || "database" %> access account has been activated. To visit the site, follow the link below:</p>
|
3
|
+
<p><%= @url %></p>
|
4
|
+
<p>Please respect the confidentiality of the information in the database. Never share your username or password with anyone.</p>
|
5
|
+
<p><%= APPLICATION_NAME || "database" %> administrator</p>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%=h @user.login %>, Your password has been reset
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<p><%=h @user.firstName %> <%=h @user.lastName %></p>
|
2
|
+
<p>An account has been created so that you can access the <%= APPLICATION_NAME || "database" %>.</p>
|
3
|
+
<p>Please click <a href='<%= @url %>'>here</a> to activate your account.</p>
|
4
|
+
<p>You will be asked to select a login name and password.</p>
|
5
|
+
<p><%= APPLICATION_NAME || "database" %> administrator</p>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
= message_block
|
2
|
+
|
3
|
+
%h1 Select new temporary access role for this session
|
4
|
+
|
5
|
+
= form_for @user_role, :url => authengine_user_user_roles_path(current_user), :method => :put do |f|
|
6
|
+
%table
|
7
|
+
%tr
|
8
|
+
%td= f.label :role_id, "New role"
|
9
|
+
%td= f.select :role_id, @roles.collect{|r| [r.name, r.id]}
|
10
|
+
- submit_or_return_to admin_index_path
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%h2 Roles for #{@user.first_last_name}
|
2
|
+
%h3 Roles assigned:
|
3
|
+
%ul#assigned_roles
|
4
|
+
- for role in @user.user_roles.map(&:role)
|
5
|
+
%li #{role.name} [ #{link_to "remove role", authengine_user_user_role_path(@user,role), :method => :delete} ]
|
6
|
+
|
7
|
+
%h3 Roles available:
|
8
|
+
%ul#available_roles
|
9
|
+
- for role in (@all_roles - @user.user_roles.map(&:role))
|
10
|
+
= form_for @user_role, :url => authengine_user_user_roles_path(@user), :method => :post do |f|
|
11
|
+
= hidden_field :user_role, :role_id, :value => role.id
|
12
|
+
%li #{role.name} [ #{ link_to "assign role", "#", :onclick => "$(this).closest('form').submit()"} ]
|
13
|
+
|
14
|
+
%p= link_to "Back", authengine_users_path
|
@@ -0,0 +1,8 @@
|
|
1
|
+
%h1 Select new access role
|
2
|
+
|
3
|
+
= form_for @user_role, :url => authengine_user_user_roles_path(current_user), :method => :post do |f|
|
4
|
+
%table
|
5
|
+
%tr
|
6
|
+
%td= f.label :role_id, "New role"
|
7
|
+
%td= f.select :role_id, @roles.collect{|r| [r.name, r.id]}
|
8
|
+
- submit_or_return_to admin_index_path
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<tr>
|
2
|
+
<td><%= useraction.created_at.to_formatted_s(:log_format) %></td>
|
3
|
+
<td><%= useraction.user.first_last_name %></td>
|
4
|
+
<td><%= (useraction.action.controller_name+"/"+useraction.action.action_name) unless !useraction.action %></td>
|
5
|
+
<td><%= useraction.params_truncated %></td>
|
6
|
+
</tr>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<h1>User activity logs</h1>
|
2
|
+
<table>
|
3
|
+
<tr><th>Date</th></tr>
|
4
|
+
<% @dates.keys.sort.each do |date| %>
|
5
|
+
<tr><td><%= link_to date, :controller=>"useractions", :action=>:show, :actionlog_id=>@dates[date] %></td></tr>
|
6
|
+
<% end %>
|
7
|
+
</table>
|
8
|
+
<h1>Rails logs</h1>
|
9
|
+
<table>
|
10
|
+
<tr><td><%= if RAILS_ENV == 'production' then link_to 'Production log', '/rails_logs/show' else link_to 'Development log', '/rails_logs/show' end %></td></tr>
|
11
|
+
<tr><td><%= link_to 'Cron log', "/cron_logs/show" %></td></tr>
|
12
|
+
<tr><td><%= link_to 'Failed login log', "/failedlogin_logs/show" %></td></tr>
|
13
|
+
</table>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
%h1 User activity log for #{ @date }
|
2
|
+
%script
|
3
|
+
var rank = #{ sort_map(@useractions, @sort_criteria) }
|
4
|
+
var rows = #{ table_rows(@useractions, 'useraction') }
|
5
|
+
var last_sort = "#{ @sort_criteria.first.to_s }"
|
6
|
+
%script{:src => '/javascripts/column_sort.js' }
|
7
|
+
%table#sortable
|
8
|
+
%tr
|
9
|
+
%th
|
10
|
+
- js_sort("Time(GMT)",'created_at')
|
11
|
+
%th
|
12
|
+
- js_sort("User",'user_lastName')
|
13
|
+
%th Controller/Action
|
14
|
+
%th Parameters
|
@@ -0,0 +1 @@
|
|
1
|
+
%p= submit_tag 'Sign up'
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#privacy_policy{:style=>"display:none; width:600px"}
|
2
|
+
%h2 Please read the #{APPLICATION_NAME || "database"} Privacy Policy and indicate your committment to comply by checking all the checkboxes
|
3
|
+
%p #{ORGANIZATION_NAME} Privacy Policy
|
4
|
+
%table
|
5
|
+
%tr
|
6
|
+
%td{:colspan=>"2"} As a condition of my being granted access to the #{APPLICATION_NAME || "database"}:
|
7
|
+
%tr{:valign => 'top'}
|
8
|
+
%td= check_box "user[cb]", :cb1
|
9
|
+
%td I agree to treat all client and donor data responsibly and to keep all information secure.
|
10
|
+
%tr{:valign => 'top'}
|
11
|
+
%td= check_box "user[cb]", :cb2
|
12
|
+
%td I understand that client data are private and confidential and that data should be accessed only in the course of my official duties for #{APPLICATION_NAME || "database"}.
|
13
|
+
%tr
|
14
|
+
%td{:colspan=>"2"} When working with the #{APPLICATION_NAME || "database"} and files, I will observe the following guidelines for handling confidential client data:
|
15
|
+
%tr{:valign => 'top'}
|
16
|
+
%td= check_box "user[cb]", :cb3
|
17
|
+
%td I will not discuss any client information or display it in an environment where it may be viewed or overheard by unauthorized individuals.
|
18
|
+
%tr{:valign => 'top'}
|
19
|
+
%td= check_box "user[cb]", :cb4
|
20
|
+
%td When using the #{APPLICATION_NAME || "database"}, I will log out of my session if I ever leave my computer for any length of time.
|
21
|
+
%tr{:valign => 'top'}
|
22
|
+
%td= check_box "user[cb]", :cb5
|
23
|
+
%td When printing, photocopying or faxing anything including client information, I will ensure that only authorized personnel will be able to see the output.
|
24
|
+
%tr{:valign => 'top'}
|
25
|
+
%td= check_box "user[cb]", :cb6
|
26
|
+
%td I will store all paper documents in the file cabinet in the #{APPLICATION_NAME || "database"} office and will ensure that the cabinet is only accessed by #{APPLICATION_NAME} personnel.
|
27
|
+
%tr{:valign => 'top'}
|
28
|
+
%td= check_box "user[cb]", :cb7
|
29
|
+
%td I will not, without the permission of the Executive Director, remove any client information from the #{APPLICATION_NAME || "database"} office, save it on removable media or my personal computer, or send this information via instant message or unsecured file transfer.
|
30
|
+
%tr{:valign => 'top'}
|
31
|
+
%td= check_box "user[cb]", :cb8
|
32
|
+
%td I recognize that violations of this policy are a serious matter that can result in the suspension of my access to the database and other disciplinary measures.
|
33
|
+
%tr{:valign => 'top'}
|
34
|
+
%td= check_box "user[cb]", :cb9
|
35
|
+
%td I understand that client information is private and confidential, and I will work to the best of my ability to preserve this privacy and confidentiality – and our clients’ trust – throughout my time with #{APPLICATION_NAME || "database"}.
|
36
|
+
%p= submit_tag 'Sign up'
|