muck-users 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +27 -0
  3. data/Rakefile +96 -0
  4. data/VERSION +1 -0
  5. data/app/controllers/admin/muck/roles_controller.rb +57 -0
  6. data/app/controllers/admin/muck/users_controller.rb +122 -0
  7. data/app/controllers/muck/activations_controller.rb +31 -0
  8. data/app/controllers/muck/password_resets_controller.rb +81 -0
  9. data/app/controllers/muck/user_sessions_controller.rb +40 -0
  10. data/app/controllers/muck/username_request_controller.rb +43 -0
  11. data/app/controllers/muck/users_controller.rb +211 -0
  12. data/app/models/muck_user_mailer.rb +53 -0
  13. data/app/models/permission.rb +17 -0
  14. data/app/models/role.rb +25 -0
  15. data/app/views/admin/roles/_role.html.erb +9 -0
  16. data/app/views/admin/roles/edit.html.erb +17 -0
  17. data/app/views/admin/roles/index.html.erb +8 -0
  18. data/app/views/admin/roles/new.html.erb +16 -0
  19. data/app/views/admin/roles/show.html.erb +7 -0
  20. data/app/views/admin/users/_activate.html.erb +5 -0
  21. data/app/views/admin/users/_ajax_search_box.html.erb +6 -0
  22. data/app/views/admin/users/_row.html.erb +6 -0
  23. data/app/views/admin/users/_search_box.html.erb +6 -0
  24. data/app/views/admin/users/_table.html.erb +21 -0
  25. data/app/views/admin/users/_user_navigation.html.erb +11 -0
  26. data/app/views/admin/users/do_search.html.erb +5 -0
  27. data/app/views/admin/users/inactive.html.erb +8 -0
  28. data/app/views/admin/users/inactive_emails.html.erb +6 -0
  29. data/app/views/admin/users/index.html.erb +12 -0
  30. data/app/views/admin/users/search.html.erb +5 -0
  31. data/app/views/muck_user_mailer/activation_confirmation.html.erb +7 -0
  32. data/app/views/muck_user_mailer/activation_instructions.html.erb +7 -0
  33. data/app/views/muck_user_mailer/password_not_active_instructions.html.erb +10 -0
  34. data/app/views/muck_user_mailer/password_reset_instructions.html.erb +10 -0
  35. data/app/views/muck_user_mailer/username_request.html.erb +3 -0
  36. data/app/views/muck_user_mailer/welcome_notification.html.erb +5 -0
  37. data/app/views/password_resets/edit.html.erb +9 -0
  38. data/app/views/password_resets/new.html.erb +11 -0
  39. data/app/views/user_sessions/new.html.erb +17 -0
  40. data/app/views/username_request/new.html.erb +11 -0
  41. data/app/views/users/_user.html.erb +15 -0
  42. data/app/views/users/activation_confirmation.html.erb +1 -0
  43. data/app/views/users/activation_instructions.html.erb +1 -0
  44. data/app/views/users/edit.html.erb +45 -0
  45. data/app/views/users/new.html.erb +51 -0
  46. data/app/views/users/show.html.erb +4 -0
  47. data/app/views/users/welcome.html.erb +4 -0
  48. data/config/muck_users_routes.rb +56 -0
  49. data/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +16 -0
  50. data/db/migrate/20090512013727_add_photo_to_user.rb +13 -0
  51. data/install.rb +1 -0
  52. data/lib/action_controller/authentic_application.rb +213 -0
  53. data/lib/active_record/acts/muck_user.rb +192 -0
  54. data/lib/muck-users/exceptions.rb +5 -0
  55. data/lib/muck-users/initialize_routes.rb +8 -0
  56. data/lib/muck-users/tasks.rb +46 -0
  57. data/lib/muck-users.rb +7 -0
  58. data/locales/ar.yml +124 -0
  59. data/locales/bg.yml +124 -0
  60. data/locales/ca.yml +124 -0
  61. data/locales/cs.yml +124 -0
  62. data/locales/da.yml +124 -0
  63. data/locales/de.yml +124 -0
  64. data/locales/el.yml +124 -0
  65. data/locales/en.yml +127 -0
  66. data/locales/es.yml +124 -0
  67. data/locales/fr.yml +124 -0
  68. data/locales/it.yml +124 -0
  69. data/locales/iw.yml +124 -0
  70. data/locales/ja.yml +124 -0
  71. data/locales/ko.yml +124 -0
  72. data/locales/lt.yml +124 -0
  73. data/locales/lv.yml +124 -0
  74. data/locales/nl.yml +124 -0
  75. data/locales/no.yml +125 -0
  76. data/locales/pl.yml +124 -0
  77. data/locales/pt.yml +124 -0
  78. data/locales/ro.yml +124 -0
  79. data/locales/ru.yml +124 -0
  80. data/locales/sk.yml +124 -0
  81. data/locales/sl.yml +124 -0
  82. data/locales/sr.yml +124 -0
  83. data/locales/sv.yml +124 -0
  84. data/locales/tl.yml +124 -0
  85. data/locales/uk.yml +124 -0
  86. data/locales/vi.yml +124 -0
  87. data/locales/zh-CN.yml +124 -0
  88. data/locales/zh-TW.yml +124 -0
  89. data/locales/zh.yml +124 -0
  90. data/muck-users.gemspec +170 -0
  91. data/pkg/muck-users-0.1.0.gem +0 -0
  92. data/public/images/profile_default.jpg +0 -0
  93. data/rails/init.rb +18 -0
  94. data/tasks/muck_users_engine.rake +27 -0
  95. data/tasks/rails.rake +2 -0
  96. data/test/factories.rb +56 -0
  97. data/test/functional/activations_controller_test.rb +73 -0
  98. data/test/functional/admin/roles_controller_test.rb +10 -0
  99. data/test/functional/admin/users_controller_test.rb +55 -0
  100. data/test/functional/password_resets_controller_test.rb +60 -0
  101. data/test/functional/user_sessions_controller_test.rb +62 -0
  102. data/test/functional/users_controller_test.rb +255 -0
  103. data/test/shoulda_macros/controller.rb +43 -0
  104. data/test/shoulda_macros/forms.rb +28 -0
  105. data/test/shoulda_macros/models.rb +34 -0
  106. data/test/shoulda_macros/pagination.rb +48 -0
  107. data/test/shoulda_macros/plugins.rb +30 -0
  108. data/test/test_helper.rb +36 -0
  109. data/test/unit/muck_user_mailer_test.rb +64 -0
  110. data/test/unit/permission_test.rb +19 -0
  111. data/test/unit/role_test.rb +17 -0
  112. data/uninstall.rb +1 -0
  113. metadata +198 -0
@@ -0,0 +1,211 @@
1
+ class Muck::UsersController < ApplicationController
2
+ unloadable
3
+
4
+ ssl_required :show, :new, :edit, :create, :update
5
+ before_filter :not_logged_in_required, :only => [:new, :create]
6
+ before_filter :login_required, :only => [:show, :edit, :update, :welcome]
7
+ before_filter :check_administrator_role, :only => [:enable]
8
+
9
+ def show
10
+ @user = User.find(params[:id]) if params[:id]
11
+ @user ||= current_user
12
+ if @user == current_user || admin?
13
+ @page_title = @user.to_param
14
+ standard_response('show')
15
+ else
16
+ redirect_to public_user_path(@user)
17
+ end
18
+ end
19
+
20
+ def welcome
21
+ @page_title = t('muck.users.welcome')
22
+ @user = User.find(params[:id])
23
+ respond_to do |format|
24
+ format.html { render :template => 'users/welcome' }
25
+ end
26
+ end
27
+
28
+ def activation_instructions
29
+ @page_title = t('muck.users.welcome')
30
+ @user = User.find(params[:id])
31
+ respond_to do |format|
32
+ format.html { render :template => 'users/activation_instructions' }
33
+ end
34
+ end
35
+
36
+ def new
37
+ @page_title = t('muck.users.register_account', :application_name => GlobalConfig.application_name)
38
+ @user = User.new
39
+ standard_response('new')
40
+ end
41
+
42
+ def edit
43
+ @page_title = t('muck.users.update_profile')
44
+ @user = admin? ? User.find(params[:id]) : current_user
45
+ respond_to do |format|
46
+ format.html { render :template => 'users/edit' }
47
+ end
48
+ end
49
+
50
+ def create
51
+ @page_title = t('muck.users.register_account', :application_name => GlobalConfig.application_name)
52
+ cookies.delete :auth_token
53
+ @user = User.new(params[:user])
54
+
55
+ if GlobalConfig.use_recaptcha
56
+ if !(verify_recaptcha(@user) && @user.valid?)
57
+ raise ActiveRecord::RecordInvalid, @user
58
+ end
59
+ end
60
+
61
+ if GlobalConfig.automatically_activate
62
+ if GlobalConfig.automatically_login_after_account_create
63
+ if @user.save
64
+ @user.activate!
65
+ @user.deliver_welcome_email
66
+ flash[:notice] = t('muck.users.thanks_sign_up')
67
+ after_create_response(true, signup_complete_path(@user))
68
+ else
69
+ after_create_response(false)
70
+ end
71
+ else
72
+ if @user.save_without_session_maintenance
73
+ @user.activate!
74
+ @user.deliver_welcome_email
75
+ flash[:notice] = t('muck.users.thanks_sign_up_login')
76
+ after_create_response(true, signup_complete_login_required_path(@user))
77
+ else
78
+ after_create_response(false)
79
+ end
80
+ end
81
+ else
82
+ if @user.save_without_session_maintenance
83
+ @user.deliver_activation_instructions!
84
+ flash[:notice] = t('muck.users.thanks_sign_up_check')
85
+ after_create_response(true, signup_complete_activation_required_path(@user))
86
+ else
87
+ after_create_response(false)
88
+ end
89
+ end
90
+ end
91
+
92
+ def update
93
+ @title = t("users.update_profile")
94
+ @user = admin? ? User.find(params[:id]) : User.find(current_user)
95
+ if @user.update_attributes(params[:user])
96
+ flash[:notice] = t("muck.users.user_update")
97
+ after_update_response(true)
98
+ else
99
+ after_update_response(false)
100
+ end
101
+ end
102
+
103
+ def destroy
104
+ return unless admin? || GlobalConfig.let_users_delete_their_account
105
+ @user = admin? ? User.find(params[:id]) : User.find(current_user)
106
+ if @user.destroy
107
+ flash[:notice] = t("muck.users.user_account_deleted")
108
+ end
109
+ after_destroy_response
110
+ end
111
+
112
+ def is_login_available
113
+ result = t('muck.users.username_not_available')
114
+ if params[:user_login] && params[:user_login].length <= 0
115
+ result = ''
116
+ elsif !User.login_exists?(params[:user_login])
117
+ @user = User.new(:login => params[:user_login])
118
+ if !@user.validate_attributes(:only => [:login])
119
+ result = t('muck.users.invalid_username')
120
+ @user.errors.full_messages.each do |message|
121
+ if !message.include? 'blank'
122
+ result += "<br />#{message}"
123
+ end
124
+ end
125
+ else
126
+ result = t('muck.users.username_available')
127
+ end
128
+ end
129
+ respond_to do |format|
130
+ format.html { render :text => result}
131
+ end
132
+ end
133
+
134
+ def is_email_available
135
+ # TODO add in link to let the user recover their password
136
+ #recover_password_prompt = link_to(t('muck.users.recover_password_prompt'), reset_password_path)
137
+ recover_password_prompt = ''
138
+ result = t('muck.users.email_not_available', :reset_password_help => recover_password_prompt)
139
+
140
+ if params[:user_email] && params[:user_email].length <= 0
141
+ result = ''
142
+ elsif !User.email_exists?(params[:user_email])
143
+ result = t('muck.users.email_available')
144
+ end
145
+ respond_to do |format|
146
+ format.html { render :text => result}
147
+ end
148
+ end
149
+
150
+ protected
151
+
152
+ def standard_response(template)
153
+ respond_to do |format|
154
+ format.html { render :template => "users/#{template}" }
155
+ format.xml { render :xml => @user }
156
+ end
157
+ end
158
+
159
+ def after_create_response(success, local_uri = '')
160
+ if success
161
+ respond_to do |format|
162
+ format.html { redirect_to local_uri }
163
+ format.xml { render :xml => @user, :status => :created, :location => user_url(@user) }
164
+ end
165
+ else
166
+ respond_to do |format|
167
+ format.html { render :template => "users/new" }
168
+ format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
169
+ end
170
+ end
171
+ end
172
+
173
+ def after_update_response(success)
174
+ if success
175
+ respond_to do |format|
176
+ format.html do
177
+ get_redirect_to do
178
+ redirect_to admin? ? profile_path(@user) : user_path(@user)
179
+ end
180
+ end
181
+ format.xml{ head :ok }
182
+ end
183
+ else
184
+ respond_to do |format|
185
+ format.html { render :template => 'users/edit' }
186
+ format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
187
+ end
188
+ end
189
+ end
190
+
191
+ def after_destroy_response
192
+ respond_to do |format|
193
+ format.html do
194
+ get_redirect_to do
195
+ redirect_to(root_url)
196
+ end
197
+ end
198
+ format.xml { head :ok }
199
+ end
200
+ end
201
+
202
+ def permission_denied
203
+ flash[:notice] = t('muck.users.permission_denied')
204
+ respond_to do |format|
205
+ format.html do
206
+ redirect_to user_path(current_user)
207
+ end
208
+ end
209
+ end
210
+
211
+ end
@@ -0,0 +1,53 @@
1
+ class MuckUserMailer < ActionMailer::Base
2
+ unloadable
3
+
4
+ default_url_options[:host] = GlobalConfig.application_url
5
+
6
+ def activation_confirmation(user)
7
+ setup_email(user)
8
+ subject I18n.t('muck.users.activation_complete')
9
+ body :user => user
10
+ end
11
+
12
+ def activation_instructions(user)
13
+ setup_email(user)
14
+ subject I18n.t('muck.users.activation_instructions')
15
+ body :user => user,
16
+ :account_activation_url => activate_url(user.perishable_token)
17
+ end
18
+
19
+ def password_not_active_instructions(user)
20
+ setup_email(user)
21
+ subject I18n.t('muck.users.account_not_activated', :application_name => GlobalConfig.application_name)
22
+ body :user => user
23
+ end
24
+
25
+ def password_reset_instructions(user)
26
+ setup_email(user)
27
+ subject I18n.t('muck.users.password_reset_email_subject', :application_name => GlobalConfig.application_name)
28
+ body :user => user
29
+ end
30
+
31
+ def welcome_notification(user)
32
+ setup_email(user)
33
+ subject I18n.t('muck.users.welcome_email_subject', :application_name => GlobalConfig.application_name)
34
+ body :login => user.login,
35
+ :application_name => GlobalConfig.application_name
36
+ end
37
+
38
+ def username_request(user)
39
+ setup_email(user)
40
+ subject I18n.t('muck.users.request_username_subject', :application_name => GlobalConfig.application_name)
41
+ body :login => user.login,
42
+ :application_name => GlobalConfig.application_name
43
+ end
44
+
45
+ protected
46
+ def setup_email(user)
47
+ @recipients = "#{user.email}"
48
+ @from = "#{GlobalConfig.from_email}"
49
+ @sent_on = Time.now
50
+ @body[:user] = user
51
+ end
52
+
53
+ end
@@ -0,0 +1,17 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: permissions
4
+ #
5
+ # id :integer(4) not null, primary key
6
+ # role_id :integer(4) not null
7
+ # user_id :integer(4) not null
8
+ # created_at :datetime
9
+ # updated_at :datetime
10
+ #
11
+
12
+ class Permission < ActiveRecord::Base
13
+ unloadable
14
+
15
+ belongs_to :user
16
+ belongs_to :role
17
+ end
@@ -0,0 +1,25 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: roles
4
+ #
5
+ # id :integer(4) not null, primary key
6
+ # rolename :string(255)
7
+ # created_at :datetime
8
+ # updated_at :datetime
9
+ #
10
+
11
+ class Role < ActiveRecord::Base
12
+ unloadable
13
+
14
+ has_many :permissions
15
+ has_many :users, :through => :permissions
16
+
17
+ validates_presence_of :rolename
18
+
19
+ # roles can be defined as symbols. We want to store them as strings in the database
20
+ def rolename= val
21
+ write_attribute(:rolename, val.to_s)
22
+ end
23
+
24
+ end
25
+
@@ -0,0 +1,9 @@
1
+ <li>
2
+ <%= role.rolename %>
3
+ <% if @user.has_role?(role.rolename) %>
4
+ <%= link_to I18n.t('muck.roles.remove_role'), user_role_url(:id => role.id, :user_id => @user.id), :method => :delete %>
5
+ <% else %>
6
+ <%= link_to I18n.t('muck.roles.assign_role'), user_role_url(:id => role.id, :user_id => @user.id), :method => :put %>
7
+ <% end %>
8
+ </li>
9
+
@@ -0,0 +1,17 @@
1
+ <h1><%= I18n.t('Editing role') %></h1>
2
+
3
+ <%= error_messages_for :role %>
4
+
5
+ <% form_for(admin_roles_path(@role)) do |f| %>
6
+ <p>
7
+ <b><%= I18n.t('Rolename') %></b><br />
8
+ <%= f.text_field :rolename %>
9
+ </p>
10
+
11
+ <p>
12
+ <%= f.submit I18n.t('Update') %>
13
+ </p>
14
+ <% end %>
15
+
16
+ <%= link_to I18n.t('Show'), @role %> |
17
+ <%= link_to I18n.t('Back'), admin_roles_path %>
@@ -0,0 +1,8 @@
1
+ <h2><%= I18n.t('Roles for %{user}') % {:user => h(@user.login.capitalize)} %></h2>
2
+
3
+ <h3><%= I18n.t('Roles assigned:') %></h3>
4
+ <ul><%= render :partial => 'role', :collection => @user.roles %></ul>
5
+
6
+ <h3><%= I18n.t('Roles available:') %></h3>
7
+ <ul><%= render :partial => 'role', :collection => (@all_roles - @user.roles) %></ul>
8
+
@@ -0,0 +1,16 @@
1
+ <h1><%= I18n.t('New role') %></h1>
2
+
3
+ <%= error_messages_for :role %>
4
+
5
+ <% form_for @role, :url => admin_role_path(@role) do |f| %>
6
+ <p>
7
+ <b><%= I18n.t('Rolename') %></b><br />
8
+ <%= f.text_field :rolename %>
9
+ </p>
10
+
11
+ <p>
12
+ <%= f.submit I18n.t('Create') %>
13
+ </p>
14
+ <% end %>
15
+
16
+ <%= link_to I18n.t('Back'), admin_roles_path %>
@@ -0,0 +1,7 @@
1
+ <p>
2
+ <b><%= I18n.t('Rolename:') %></b>
3
+ <%=h @role.rolename %>
4
+ </p>
5
+
6
+ <%= link_to I18n.t('Edit'), edit_role_path(@role) %> |
7
+ <%= link_to I18n.t('Back'), admin_roles_path %>
@@ -0,0 +1,5 @@
1
+ <% if user.active? -%>
2
+ <%= link_to_remote I18n.t('muck.general.deactivate'), { :url => admin_user_path(user, :format => 'js'), :method => :put } -%>
3
+ <% else -%>
4
+ <%= link_to_remote I18n.t('muck.general.activate'), { :url => admin_user_path(user, :format => 'js'), :method => :put } -%>
5
+ <% end -%>
@@ -0,0 +1,6 @@
1
+ <div id="ajax_search_box" class="box" style="display: none;" >
2
+ <% form_remote_tag :action => 'ajax_search', :url => '/admin/users/ajax_search', :update => "manage" do %>
3
+ <%= text_field_tag :query, '', :class => 'span-5' %>
4
+ <%= submit_tag t("muck.users.admin.search_users") %>
5
+ <% end %>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <tr id="<%=user.dom_id('row')%>" class="<%= cycle('odd','even') %>">
2
+ <td><%= link_to h(user.full_name), user %></td>
3
+ <td><%= mail_to h(user.email), user.email %></td>
4
+ <td id="<%=user.dom_id('link')%>"><%= render :partial => 'admin/users/activate', :locals => { :user => user } %></td>
5
+ <td><%= link_to_remote t("muck.general.delete"), { :url => admin_user_path(user.id), :method => :delete }, { :title => t('muck.users.delete_this_user'), :class => 'delete-user' } -%></td>
6
+ </tr>
@@ -0,0 +1,6 @@
1
+ <div id="search_box" class="box">
2
+ <% form_tag :action => 'search' do %>
3
+ <%= text_field_tag :query, '', :class => 'span-5' %>
4
+ <%= submit_tag t("muck.users.admin.search_users") %>
5
+ <% end %>
6
+ </div>
@@ -0,0 +1,21 @@
1
+ <table id="manage" class="manage">
2
+ <thead>
3
+ <tr>
4
+ <th><%= t('muck.users.name') %></th>
5
+ <th><%= t('muck.users.email_address') %></th>
6
+ <th></th>
7
+ <th></th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <%= render :partial => 'admin/users/row', :collection => @users, :as => :user %>
12
+ </tbody>
13
+ </table>
14
+ <%= will_paginate @users %>
15
+ <script type="text/javascript" language="JavaScript">
16
+ jQuery(document).ready(function() {
17
+ jQuery(".delete-user").click(function() {
18
+ jQuery(this).parent().html('deleting user...');
19
+ });
20
+ });
21
+ </script>
@@ -0,0 +1,11 @@
1
+ <% content_for :sidebar do -%>
2
+ <%= render :partial => 'admin/users/search_box' -%>
3
+ <%= render :partial => 'admin/users/ajax_search_box' -%>
4
+ <div id="user-navigation" class="box">
5
+ <ul>
6
+ <li><%= link_to t("muck.users.navigation.all_users"), admin_users_path %></li>
7
+ <li><%= link_to t("muck.users.navigation.inactive_users"), inactive_admin_users_path %></li>
8
+ <li><%= link_to t("muck.users.navigation.search_users"), search_admin_users_path %></li>
9
+ </ul>
10
+ </div>
11
+ <% end -%>
@@ -0,0 +1,5 @@
1
+ <%= render :partial => 'admin/users/user_navigation' -%>
2
+
3
+ <%= render :partial => 'admin/users/search_box' -%>
4
+
5
+ <%= render :partial => 'admin/users/table' -%>
@@ -0,0 +1,8 @@
1
+ <%= render :partial => 'admin/users/user_navigation' -%>
2
+ <div>
3
+ <h2><%= t('muck.users.admin.unactivated_users', :count => @user_inactive_count) %>
4
+ <span class="link-button"><%= link_to t('muck.users.admin.activate_all_inactive_users'), activate_all_admin_users_path, :confirm => t('muck.users.admin.activate_all_inactive_users_confirm') %></span>
5
+ <span class="link-button"><%= link_to t('muck.users.admin.show_emails'), inactive_emails_admin_users_path %></span>
6
+ </h2>
7
+ <%= render :partial => 'admin/users/table' -%>
8
+ </div>
@@ -0,0 +1,6 @@
1
+ <%= render :partial => 'admin/users/user_navigation' -%>
2
+ <div id="inactive-emails" class="activity_box">
3
+ <h2><%= I18n.t("Inactive User's Emails (%{count} total)") % {:count => @user_inactive_count} %></h2>
4
+ <textarea id="user-emails"><%= @users.collect{|user| user.email}.join(', ') -%></textarea>
5
+ </div>
6
+
@@ -0,0 +1,12 @@
1
+ <%= render :partial => 'admin/users/user_navigation' -%>
2
+ <div>
3
+ <h2><%= t('muck.users.admin_users_title') %></h2>
4
+ <%= render :partial => 'admin/users/table' -%>
5
+ </div>
6
+
7
+ <script type="text/javascript" language="JavaScript">
8
+ jQuery(document).ready(function() {
9
+ jQuery("#search_box").hide();
10
+ jQuery("#ajax_search_box").show();
11
+ });
12
+ </script>
@@ -0,0 +1,5 @@
1
+ <%= render :partial => 'admin/users/user_navigation' -%>
2
+
3
+ <%= render :partial => 'admin/users/search_box' -%>
4
+
5
+
@@ -0,0 +1,7 @@
1
+ Welcome <%= h(@user.login) %>,
2
+
3
+ Your account has been activated.
4
+
5
+ <%= root_url %>
6
+
7
+ If the above URL does not work try copying and pasting it into your browser. If you continue to have problem, please feel free to contact us.
@@ -0,0 +1,7 @@
1
+ Welcome <%= h(@user.login) %>,
2
+
3
+ Thank you for creating an account! Click the url below to activate your account!
4
+
5
+ <%= @account_activation_url %>
6
+
7
+ If the above URL does not work try copying and pasting it into your browser. If you continue to have problem, please feel free to contact us.
@@ -0,0 +1,10 @@
1
+ Hello <%= h(@user.login) %>,
2
+
3
+ A request to reset your password has been made.
4
+ If you did not make this request, simply ignore this email.
5
+
6
+ Your account has not yet been activated. Simply click the url below to activate your account. After that you may change your password to something that is easy to remember.
7
+
8
+ <%= activate_url(@user.perishable_token) %>
9
+
10
+ If the above URL does not work try copying and pasting it into your browser. If you continue to have problem, please feel free to contact us.
@@ -0,0 +1,10 @@
1
+ Hello <%= h(@user.login) %>,
2
+
3
+ A request to reset your password has been made.
4
+ If you did not make this request, simply ignore this email.
5
+ If you did make this request just click the link below:
6
+
7
+ <%= reset_password_url(@user.perishable_token) %>
8
+
9
+ If the above URL does not work try copying and pasting it into your browser.
10
+ If you continue to have problem please feel free to contact us.
@@ -0,0 +1,3 @@
1
+ Your login for <%= GlobalConfig.application_name %> is <%= h(@login) %>,
2
+
3
+ <%= @root_url %>
@@ -0,0 +1,5 @@
1
+ Hello <%= h(@login) %>,
2
+
3
+ Welcome to <%= GlobalConfig.application_name %>. Your account has been successfully created.
4
+
5
+ <%= @root_url %>
@@ -0,0 +1,9 @@
1
+ <div id="reset-password-confirm" class="common-form">
2
+ <h1><%= t('muck.users.select_new_password') %></h1>
3
+ <%= output_errors(t('muck.users.select_new_password'), {:class => 'help-box'}) %>
4
+ <% custom_form_for :reset_password, :url => password_resets_path, :html => {:method => :put} do |f| -%>
5
+ <%= f.text_field :password, { :label => t('muck.users.password'), :hide_required => true } -%>
6
+ <%= f.text_field :password_confirmation, { :label => t('muck.users.confirm_password'), :hide_required => true } -%>
7
+ <%= submit_tag t('muck.users.confirm_select_new_password') %>
8
+ <% end -%>
9
+ </div>
@@ -0,0 +1,11 @@
1
+ <div id="reset-password" class="common-form">
2
+ <h1><%= t('muck.users.forgot_password') %></h1>
3
+ <%= output_errors(t('muck.users.reset_password'), {:class => 'help-box'}) %>
4
+ <% custom_form_for :reset_password, :url => password_resets_path do |f| -%>
5
+ <p><%= t('muck.users.email_recover_prompt') %></p>
6
+ <%= f.text_field :email, { :label => t('muck.users.email_address'), :hide_required => true } -%>
7
+ <div class="button form-row">
8
+ <%= submit_tag t('muck.users.reset_password') %>
9
+ </div>
10
+ <% end -%>
11
+ </div>
@@ -0,0 +1,17 @@
1
+ <div id="sign_in" class="common-form">
2
+ <% custom_form_for @user_session, :url => user_session_path do |f| -%>
3
+ <h1><%= I18n.t('muck.users.login_title') %></h1>
4
+ <%= output_errors(t('muck.users.login_fail'), {:class => 'help-box'}) %>
5
+ <%= f.text_field :login, { :label => I18n.t('muck.users.username'), :hide_required => true, :hide_control_error => true } -%>
6
+ <%= f.password_field :password, { :label => I18n.t('muck.users.password'), :hide_required => true, :hide_control_error => true } -%>
7
+ <%= f.check_box :remember_me, { :label => I18n.t('muck.users.remember_me'), :hide_required => true, :hide_control_error => true } %>
8
+ <div class="button form-row">
9
+ <%= submit_tag I18n.t('muck.users.sign_in') %>
10
+ </div>
11
+ <div class="form-row">
12
+ <span class="instruction"><%= link_to I18n.t('muck.users.register_for_account'), signup_url %></span> |
13
+ <span class="instruction"><%= link_to I18n.t('muck.users.forgot_your_password'), forgot_password_path %></span> |
14
+ <span class="instruction"><%= link_to I18n.t('muck.users.forgot_your_username'), forgot_username_path %></span>
15
+ </div>
16
+ <% end %>
17
+ </div>
@@ -0,0 +1,11 @@
1
+ <div id="request-username" class="common-form">
2
+ <h1><%= t('muck.users.forgot_username') %></h1>
3
+ <%= output_errors(t('muck.users.request_username'), {:class => 'help-box'}) %>
4
+ <% custom_form_for :request_username, :url => username_request_path do |f| -%>
5
+ <p><%= t('muck.users.username_recover_prompt') %></p>
6
+ <%= f.text_field :email, { :label => t('muck.users.email_address'), :hide_required => true } -%>
7
+ <div class="button form-row">
8
+ <%= submit_tag t('muck.users.request_username') %>
9
+ </div>
10
+ <% end -%>
11
+ </div>
@@ -0,0 +1,15 @@
1
+ <tr class="<%= cycle('odd', 'even') %>">
2
+ <td><%=h user.login %></td>
3
+ <td><%=h user.email %></td>
4
+ <td><%= user.enabled ? I18n.t('muck.general.yes') : I18n.t('muck.general.no') %>
5
+ <% unless user == current_user %>
6
+ <% if user.enabled %>
7
+ <%= link_to(I18n.t('muck.general.disable'), user_path(user.id), :method => :delete) %>
8
+ <% else %>
9
+ <%= link_to(I18n.t('muck.general.enable'), enable_user_path(user.id), :method => :put) %>
10
+ <% end %>
11
+ <% end %>
12
+ </td>
13
+ <td><%= link_to I18n.t('muck.roles.edit_roles'), user_admin_roles_path(user) %>]</td>
14
+ </tr>
15
+
@@ -0,0 +1 @@
1
+ Thank you for activating your account
@@ -0,0 +1 @@
1
+ You will receive an email with instructions on how to activate your account.