simple_user 0.1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +35 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/simple_user/application.js +15 -0
- data/app/assets/javascripts/simple_user/facebook_connect.js.erb +33 -0
- data/app/assets/stylesheets/simple_user/application.css +13 -0
- data/app/controllers/simple_user/admin_users/registrations_controller.rb +7 -0
- data/app/controllers/simple_user/admin_users/sessions_controller.rb +20 -0
- data/app/controllers/simple_user/admin_users_controller.rb +134 -0
- data/app/controllers/simple_user/application_controller.rb +7 -0
- data/app/controllers/simple_user/auth_controller.rb +26 -0
- data/app/controllers/simple_user/users/registrations_controller.rb +5 -0
- data/app/controllers/simple_user/users/sessions_controller.rb +41 -0
- data/app/controllers/simple_user/users_controller.rb +88 -0
- data/app/helpers/simple_user/application_helper.rb +13 -0
- data/app/helpers/simple_user/links_helper.rb +9 -0
- data/app/models/ability.rb +25 -0
- data/app/models/role.rb +18 -0
- data/app/models/simple_user/admin_user.rb +48 -0
- data/app/models/simple_user/authentication.rb +9 -0
- data/app/models/simple_user/user.rb +92 -0
- data/app/views/layouts/simple_user/application.html.erb +28 -0
- data/app/views/simple_user/admin_users/_form.html.erb +15 -0
- data/app/views/simple_user/admin_users/confirmations/new.html.erb +16 -0
- data/app/views/simple_user/admin_users/edit.html.erb +6 -0
- data/app/views/simple_user/admin_users/index.html.erb +27 -0
- data/app/views/simple_user/admin_users/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/simple_user/admin_users/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/simple_user/admin_users/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/simple_user/admin_users/new.html.erb +5 -0
- data/app/views/simple_user/admin_users/passwords/edit.html.erb +19 -0
- data/app/views/simple_user/admin_users/passwords/new.html.erb +15 -0
- data/app/views/simple_user/admin_users/registrations/edit.html.erb +28 -0
- data/app/views/simple_user/admin_users/registrations/new.html.erb +18 -0
- data/app/views/simple_user/admin_users/sessions/new.html.erb +15 -0
- data/app/views/simple_user/admin_users/shared/_links.erb +25 -0
- data/app/views/simple_user/admin_users/show.html.erb +15 -0
- data/app/views/simple_user/admin_users/unlocks/new.html.erb +16 -0
- data/app/views/simple_user/application/_menu_admin_users.html.erb +15 -0
- data/app/views/simple_user/application/_menu_users.html.erb +9 -0
- data/app/views/simple_user/users/_form.html.erb +14 -0
- data/app/views/simple_user/users/confirmations/new.html.erb +16 -0
- data/app/views/simple_user/users/edit.html.erb +6 -0
- data/app/views/simple_user/users/index.html.erb +31 -0
- data/app/views/simple_user/users/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/simple_user/users/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/simple_user/users/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/simple_user/users/new.html.erb +5 -0
- data/app/views/simple_user/users/passwords/edit.html.erb +19 -0
- data/app/views/simple_user/users/passwords/new.html.erb +15 -0
- data/app/views/simple_user/users/registrations/edit.html.erb +30 -0
- data/app/views/simple_user/users/registrations/new.html.erb +20 -0
- data/app/views/simple_user/users/sessions/new.html.erb +15 -0
- data/app/views/simple_user/users/shared/_links.erb +25 -0
- data/app/views/simple_user/users/show.html.erb +25 -0
- data/app/views/simple_user/users/unlocks/new.html.erb +16 -0
- data/config/initializers/devise.rb +243 -0
- data/config/initializers/omniauth.rb +7 -0
- data/config/initializers/rolify.rb +8 -0
- data/config/locales/devise.en.yml +59 -0
- data/config/routes.rb +39 -0
- data/db/migrate/20130312215459_devise_create_simple_user_users.rb +50 -0
- data/db/migrate/20130312215519_devise_create_simple_user_admin_users.rb +48 -0
- data/db/migrate/20130312215950_create_simple_user_authentications.rb +13 -0
- data/db/migrate/20130312226960_rolify_create_roles.rb +19 -0
- data/db/seed.rb +9 -0
- data/lib/generators/simple_user/generate_views/generate_views_generator.rb +12 -0
- data/lib/generators/simple_user/install/install_generator.rb +20 -0
- data/lib/generators/simple_user/install/templates/devise_config.yml +1 -0
- data/lib/generators/simple_user/install/templates/fb_config.yml +3 -0
- data/lib/generators/simple_user/install/templates/simple_user.yml +3 -0
- data/lib/simple_user.rb +4 -0
- data/lib/simple_user/engine.rb +48 -0
- data/lib/simple_user/version.rb +3 -0
- data/lib/tasks/simple_user_tasks.rake +16 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +16 -0
- data/test/dummy/app/assets/javascripts/welcome.js +2 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/assets/stylesheets/welcome.css +4 -0
- data/test/dummy/app/controllers/application_controller.rb +31 -0
- data/test/dummy/app/controllers/welcome_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/welcome_helper.rb +2 -0
- data/test/dummy/app/views/admin_users/_form.html.erb +15 -0
- data/test/dummy/app/views/admin_users/confirmations/new.html.erb +16 -0
- data/test/dummy/app/views/admin_users/edit.html.erb +6 -0
- data/test/dummy/app/views/admin_users/index.html.erb +27 -0
- data/test/dummy/app/views/admin_users/mailer/confirmation_instructions.html.erb +5 -0
- data/test/dummy/app/views/admin_users/mailer/reset_password_instructions.html.erb +8 -0
- data/test/dummy/app/views/admin_users/mailer/unlock_instructions.html.erb +7 -0
- data/test/dummy/app/views/admin_users/new.html.erb +5 -0
- data/test/dummy/app/views/admin_users/passwords/edit.html.erb +19 -0
- data/test/dummy/app/views/admin_users/passwords/new.html.erb +15 -0
- data/test/dummy/app/views/admin_users/registrations/edit.html.erb +28 -0
- data/test/dummy/app/views/admin_users/registrations/new.html.erb +18 -0
- data/test/dummy/app/views/admin_users/sessions/new.html.erb +15 -0
- data/test/dummy/app/views/admin_users/shared/_links.erb +25 -0
- data/test/dummy/app/views/admin_users/show.html.erb +15 -0
- data/test/dummy/app/views/admin_users/unlocks/new.html.erb +16 -0
- data/test/dummy/app/views/application/_menu_admin_users.html.erb +15 -0
- data/test/dummy/app/views/application/_menu_users.html.erb +9 -0
- data/test/dummy/app/views/layouts/application.html.erb +28 -0
- data/test/dummy/app/views/simple_user/admin_users/_form.html.erb +15 -0
- data/test/dummy/app/views/simple_user/admin_users/confirmations/new.html.erb +16 -0
- data/test/dummy/app/views/simple_user/admin_users/edit.html.erb +6 -0
- data/test/dummy/app/views/simple_user/admin_users/index.html.erb +27 -0
- data/test/dummy/app/views/simple_user/admin_users/mailer/confirmation_instructions.html.erb +5 -0
- data/test/dummy/app/views/simple_user/admin_users/mailer/reset_password_instructions.html.erb +8 -0
- data/test/dummy/app/views/simple_user/admin_users/mailer/unlock_instructions.html.erb +7 -0
- data/test/dummy/app/views/simple_user/admin_users/new.html.erb +5 -0
- data/test/dummy/app/views/simple_user/admin_users/passwords/edit.html.erb +19 -0
- data/test/dummy/app/views/simple_user/admin_users/passwords/new.html.erb +15 -0
- data/test/dummy/app/views/simple_user/admin_users/registrations/edit.html.erb +28 -0
- data/test/dummy/app/views/simple_user/admin_users/registrations/new.html.erb +18 -0
- data/test/dummy/app/views/simple_user/admin_users/sessions/new.html.erb +15 -0
- data/test/dummy/app/views/simple_user/admin_users/shared/_links.erb +25 -0
- data/test/dummy/app/views/simple_user/admin_users/show.html.erb +15 -0
- data/test/dummy/app/views/simple_user/admin_users/unlocks/new.html.erb +16 -0
- data/test/dummy/app/views/simple_user/application/_menu_admin_users.html.erb +15 -0
- data/test/dummy/app/views/simple_user/application/_menu_users.html.erb +9 -0
- data/test/dummy/app/views/simple_user/users/_form.html.erb +14 -0
- data/test/dummy/app/views/simple_user/users/confirmations/new.html.erb +16 -0
- data/test/dummy/app/views/simple_user/users/edit.html.erb +6 -0
- data/test/dummy/app/views/simple_user/users/index.html.erb +31 -0
- data/test/dummy/app/views/simple_user/users/mailer/confirmation_instructions.html.erb +5 -0
- data/test/dummy/app/views/simple_user/users/mailer/reset_password_instructions.html.erb +8 -0
- data/test/dummy/app/views/simple_user/users/mailer/unlock_instructions.html.erb +7 -0
- data/test/dummy/app/views/simple_user/users/new.html.erb +5 -0
- data/test/dummy/app/views/simple_user/users/passwords/edit.html.erb +19 -0
- data/test/dummy/app/views/simple_user/users/passwords/new.html.erb +15 -0
- data/test/dummy/app/views/simple_user/users/registrations/edit.html.erb +30 -0
- data/test/dummy/app/views/simple_user/users/registrations/new.html.erb +20 -0
- data/test/dummy/app/views/simple_user/users/sessions/new.html.erb +15 -0
- data/test/dummy/app/views/simple_user/users/shared/_links.erb +25 -0
- data/test/dummy/app/views/simple_user/users/show.html.erb +25 -0
- data/test/dummy/app/views/simple_user/users/unlocks/new.html.erb +16 -0
- data/test/dummy/app/views/welcome/index.html.erb +3 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +59 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/devise_config.yml +1 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/fb_config.yml +3 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +7 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20130314021609_devise_create_simple_user_users.simple_user.rb +51 -0
- data/test/dummy/db/migrate/20130314021610_devise_create_simple_user_admin_users.simple_user.rb +49 -0
- data/test/dummy/db/migrate/20130314021611_create_simple_user_authentications.simple_user.rb +14 -0
- data/test/dummy/db/migrate/20130314021612_rolify_create_simple_user_roles.simple_user.rb +20 -0
- data/test/dummy/db/migrate/20130314222446_devise_create_simple_user_users.simple_user.rb +51 -0
- data/test/dummy/db/migrate/20130314222447_devise_create_simple_user_admin_users.simple_user.rb +49 -0
- data/test/dummy/db/migrate/20130314222448_create_simple_user_authentications.simple_user.rb +14 -0
- data/test/dummy/db/migrate/20130314222449_rolify_create_roles.simple_user.rb +20 -0
- data/test/dummy/db/schema.rb +87 -0
- data/test/dummy/log/development.log +100 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/functional/welcome_controller_test.rb +9 -0
- data/test/dummy/test/unit/helpers/welcome_helper_test.rb +4 -0
- data/test/dummy/tmp/cache/assets/C43/6A0/sprockets%2F9112a8a5c58f114023075f00ab994366 +0 -0
- data/test/dummy/tmp/cache/assets/C7B/190/sprockets%2F37b103f4623089af1456b90830fe941c +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/D13/C60/sprockets%2F2dedb8177c20286c4259c1d58c5646cc +0 -0
- data/test/dummy/tmp/cache/assets/D21/5D0/sprockets%2Fe2c4f946939f2d7d0b42d86383755cae +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D3E/F40/sprockets%2F25a167c7563d6fe8ec6b13ec1ac09274 +0 -0
- data/test/dummy/tmp/cache/assets/D43/A50/sprockets%2Fa41b368b71464f0a4feb19b6f875e44e +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D92/950/sprockets%2Fcda629d2e4e4583027facd41bf1ea406 +0 -0
- data/test/dummy/tmp/cache/assets/DA0/140/sprockets%2F25f485eb0a9f28b68e69ab1c0f57c0da +0 -0
- data/test/dummy/tmp/cache/assets/DCF/BD0/sprockets%2Fc8b53c6aae12e5a5be5fe8db5472a793 +0 -0
- data/test/dummy/tmp/cache/assets/DD2/810/sprockets%2Fdc8aca3689d6b6e14aa38b7c88a46bc3 +0 -0
- data/test/dummy/tmp/cache/assets/DD8/CE0/sprockets%2F5de7f141c1d9dc26ce8af1ad6246d99f +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/E02/930/sprockets%2Fec83bf6c33e43fb6a5cf38a52df8c60e +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E2A/CE0/sprockets%2F17bd5e2fd8a5fd2d834c9dadfd102c2f +0 -0
- data/test/fixtures/simple_user/admin_users.yml +11 -0
- data/test/fixtures/simple_user/authentications.yml +13 -0
- data/test/fixtures/simple_user/users.yml +11 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/simple_user_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/simple_user/admin_user_test.rb +9 -0
- data/test/unit/simple_user/authentication_test.rb +9 -0
- data/test/unit/simple_user/user_test.rb +9 -0
- metadata +516 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
2
|
+
<%= link_to "Sign in", new_session_path(resource_name) %><br />
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
+
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
10
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
15
|
+
<% end -%>
|
16
|
+
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
18
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
19
|
+
<% end -%>
|
20
|
+
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
23
|
+
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
|
24
|
+
<% end -%>
|
25
|
+
<% end -%>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<b>Email:</b>
|
5
|
+
<%= @admin_user.email %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<b>Username:</b>
|
10
|
+
<%= @admin_user.username %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
|
14
|
+
<%= link_to 'Edit', edit_admin_user_path(@admin_user) %> |
|
15
|
+
<%= link_to 'Back', admin_users_path %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2>Resend unlock instructions</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
<%= f.full_error :unlock_token %>
|
6
|
+
|
7
|
+
<div class="form-inputs">
|
8
|
+
<%= f.input :email, :required => true, :autofocus => true %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="form-actions">
|
12
|
+
<%= f.button :submit, "Resend unlock instructions" %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% unless admin_user_signed_in? %>
|
2
|
+
<%=link_to "Admin Login", new_admin_user_session_path %>
|
3
|
+
<% else %>
|
4
|
+
<%= link_to "Welcome, Admin: #{current_admin_user.username}", edit_admin_user_registration_path %>
|
5
|
+
|
6
|
+
<% if can? :manage, SimpleUser::AdminUser %>
|
7
|
+
| <%= link_to "Manage Admins", admin_users_path %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<% if can? :manage, SimpleUser::User %>
|
11
|
+
| <%= link_to "Manage Users", users_path %>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
| <%= link_to "Log out from Admin", destroy_admin_user_session_path, method: :delete, id: "sign_out" %>
|
15
|
+
<% end %>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% unless user_signed_in? %>
|
2
|
+
<%=link_to "Login", new_user_session_path %>
|
3
|
+
|
|
4
|
+
<%= link_to "Login with Facebook", "/auth/facebook", id: "sign_in" %>
|
5
|
+
<% else %>
|
6
|
+
<%= link_to "Welcome, #{current_user.username}", edit_user_registration_path %>
|
7
|
+
|
|
8
|
+
<%= link_to "Log out", destroy_user_session_path, method: :delete, id: "sign_out" %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%= simple_form_for @user, :html => { :class => 'form-horizontal' } do |f| %>
|
2
|
+
<%= f.input :username, :required => true %>
|
3
|
+
<%= f.input :first_name, :required => true %>
|
4
|
+
<%= f.input :last_name, :required => true %>
|
5
|
+
<%= f.input :email, :required => true %>
|
6
|
+
|
7
|
+
<% if can? :manage, SimpleUser::User %>
|
8
|
+
<%= f.input :active %>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<div class="actions">
|
12
|
+
<%= f.button :submit %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2>Resend confirmation instructions</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
<%= f.full_error :confirmation_token %>
|
6
|
+
|
7
|
+
<div class="form-inputs">
|
8
|
+
<%= f.input :email, :required => true, :autofocus => true %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="form-actions">
|
12
|
+
<%= f.button :submit, "Resend confirmation instructions" %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<h1>Users</h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<th>First name</th>
|
6
|
+
<th>Last name</th>
|
7
|
+
<th>Email</th>
|
8
|
+
<th>Username</th>
|
9
|
+
<th>Active</th>
|
10
|
+
<th></th>
|
11
|
+
<th></th>
|
12
|
+
<th></th>
|
13
|
+
</tr>
|
14
|
+
|
15
|
+
<% @users.each do |user| %>
|
16
|
+
<tr>
|
17
|
+
<td><%= user.first_name %></td>
|
18
|
+
<td><%= user.last_name %></td>
|
19
|
+
<td><%= user.email %></td>
|
20
|
+
<td><%= user.username %></td>
|
21
|
+
<td><%= print_yes_or_no user.active %></td>
|
22
|
+
<td><%= link_to 'Show', user %></td>
|
23
|
+
<td><%= link_to 'Edit', edit_user_path(user) %></td>
|
24
|
+
<td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
25
|
+
</tr>
|
26
|
+
<% end %>
|
27
|
+
</table>
|
28
|
+
|
29
|
+
<br />
|
30
|
+
|
31
|
+
<%= link_to 'New User', new_user_path %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
4
|
+
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
|
6
|
+
|
7
|
+
<p>If you didn't request this, please ignore this email.</p>
|
8
|
+
<p>Your password won't change until you access the link above and create a new one.</p>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<p>Hello <%= @resource.email %>!</p>
|
2
|
+
|
3
|
+
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
4
|
+
|
5
|
+
<p>Click the link below to unlock your account:</p>
|
6
|
+
|
7
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<h2>Change your password</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<%= f.input :reset_password_token, :as => :hidden %>
|
7
|
+
<%= f.full_error :reset_password_token %>
|
8
|
+
|
9
|
+
<div class="form-inputs">
|
10
|
+
<%= f.input :password, :label => "New password", :required => true, :autofocus => true %>
|
11
|
+
<%= f.input :password_confirmation, :label => "Confirm your new password", :required => true %>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
<div class="form-actions">
|
15
|
+
<%= f.button :submit, "Change my password" %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<h2>Forgot your password?</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<div class="form-inputs">
|
7
|
+
<%= f.input :email, :required => true, :autofocus => true %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="form-actions">
|
11
|
+
<%= f.button :submit, "Send me reset password instructions" %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<div class="form-inputs">
|
7
|
+
<%= f.input :email, :required => true, :autofocus => true %>
|
8
|
+
|
9
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
10
|
+
<p>Currently waiting confirmation for: <%= resource.unconfirmed_email %></p>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%= f.input :first_name, :required => true %>
|
14
|
+
<%= f.input :last_name, :required => true %>
|
15
|
+
<%= f.input :username, :required => true %>
|
16
|
+
<%= f.input :password, :autocomplete => "off", :hint => "leave it blank if you don't want to change it", :required => false %>
|
17
|
+
<%= f.input :password_confirmation, :required => false %>
|
18
|
+
<%= f.input :current_password, :hint => "we need your current password to confirm your changes", :required => true %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="form-actions">
|
22
|
+
<%= f.button :submit, "Update" %>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<h3>Cancel my account</h3>
|
27
|
+
|
28
|
+
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.</p>
|
29
|
+
|
30
|
+
<%= link_to "Back", :back %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<h2>Sign up</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<div class="form-inputs">
|
7
|
+
<%= f.input :first_name, :required => true %>
|
8
|
+
<%= f.input :last_name, :required => true %>
|
9
|
+
<%= f.input :username, :required => true %>
|
10
|
+
<%= f.input :email, :required => true, :autofocus => true %>
|
11
|
+
<%= f.input :password, :required => true %>
|
12
|
+
<%= f.input :password_confirmation, :required => true %>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="form-actions">
|
16
|
+
<%= f.button :submit, "Sign up" %>
|
17
|
+
</div>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<h2>Sign in</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
4
|
+
<div class="form-inputs">
|
5
|
+
<%= f.input :username, :required => true, :autofocus => true %>
|
6
|
+
<%= f.input :password, :required => true %>
|
7
|
+
<%= f.input :remember_me, :as => :boolean if devise_mapping.rememberable? %>
|
8
|
+
</div>
|
9
|
+
|
10
|
+
<div class="form-actions">
|
11
|
+
<%= f.button :submit, "Sign in" %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
2
|
+
<%= link_to "Sign in", new_session_path(resource_name) %><br />
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
+
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
10
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
15
|
+
<% end -%>
|
16
|
+
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
18
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
19
|
+
<% end -%>
|
20
|
+
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
23
|
+
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
|
24
|
+
<% end -%>
|
25
|
+
<% end -%>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<b>First name:</b>
|
5
|
+
<%= @user.first_name %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<b>Last name:</b>
|
10
|
+
<%= @user.last_name %>
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p>
|
14
|
+
<b>Email:</b>
|
15
|
+
<%= @user.email %>
|
16
|
+
</p>
|
17
|
+
|
18
|
+
<p>
|
19
|
+
<b>Username:</b>
|
20
|
+
<%= @user.username %>
|
21
|
+
</p>
|
22
|
+
|
23
|
+
|
24
|
+
<%= link_to 'Edit', edit_user_path(@user) %> |
|
25
|
+
<%= link_to 'Back', users_path %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2>Resend unlock instructions</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
<%= f.full_error :unlock_token %>
|
6
|
+
|
7
|
+
<div class="form-inputs">
|
8
|
+
<%= f.input :email, :required => true, :autofocus => true %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="form-actions">
|
12
|
+
<%= f.button :submit, "Resend unlock instructions" %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render "devise/shared/links" %>
|
@@ -0,0 +1,243 @@
|
|
1
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
|
+
# Many of these configuration options can be set straight in your model.
|
3
|
+
Devise.setup do |config|
|
4
|
+
# ==> Mailer Configuration
|
5
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
6
|
+
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
|
7
|
+
config.mailer_sender = ENV['SU_MAILER_SENDER']
|
8
|
+
|
9
|
+
# Configure the class responsible to send e-mails.
|
10
|
+
# config.mailer = "Devise::Mailer"
|
11
|
+
|
12
|
+
# ==> ORM configuration
|
13
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
14
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
15
|
+
# available as additional gems.
|
16
|
+
require 'devise/orm/active_record'
|
17
|
+
|
18
|
+
# ==> Configuration for any authentication mechanism
|
19
|
+
# Configure which keys are used when authenticating a user. The default is
|
20
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
21
|
+
# authenticating a user, both parameters are required. Remember that those
|
22
|
+
# parameters are used only when authenticating and not when retrieving from
|
23
|
+
# session. If you need permissions, you should implement that in a before filter.
|
24
|
+
# You can also supply a hash where the value is a boolean determining whether
|
25
|
+
# or not authentication should be aborted when the value is not present.
|
26
|
+
# config.authentication_keys = [ :email ]
|
27
|
+
config.authentication_keys = [ :username ]
|
28
|
+
|
29
|
+
# Configure parameters from the request object used for authentication. Each entry
|
30
|
+
# given should be a request method and it will automatically be passed to the
|
31
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
32
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
33
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
34
|
+
# config.request_keys = []
|
35
|
+
|
36
|
+
# Configure which authentication keys should be case-insensitive.
|
37
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
38
|
+
# to authenticate or find a user. Default is :email.
|
39
|
+
#config.case_insensitive_keys = [ :email ]
|
40
|
+
config.case_insensitive_keys = [ :username ]
|
41
|
+
|
42
|
+
# Configure which authentication keys should have whitespace stripped.
|
43
|
+
# These keys will have whitespace before and after removed upon creating or
|
44
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
45
|
+
#config.strip_whitespace_keys = [ :email ]
|
46
|
+
config.strip_whitespace_keys = [ :username ]
|
47
|
+
|
48
|
+
# Tell if authentication through request.params is enabled. True by default.
|
49
|
+
# It can be set to an array that will enable params authentication only for the
|
50
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
51
|
+
# enable it only for database (email + password) authentication.
|
52
|
+
# config.params_authenticatable = true
|
53
|
+
|
54
|
+
# Tell if authentication through HTTP Basic Auth is enabled. False by default.
|
55
|
+
# It can be set to an array that will enable http authentication only for the
|
56
|
+
# given strategies, for example, `config.http_authenticatable = [:token]` will
|
57
|
+
# enable it only for token authentication.
|
58
|
+
# config.http_authenticatable = false
|
59
|
+
|
60
|
+
# If http headers should be returned for AJAX requests. True by default.
|
61
|
+
# config.http_authenticatable_on_xhr = true
|
62
|
+
|
63
|
+
# The realm used in Http Basic Authentication. "Application" by default.
|
64
|
+
# config.http_authentication_realm = "Application"
|
65
|
+
|
66
|
+
# It will change confirmation, password recovery and other workflows
|
67
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
68
|
+
# Does not affect registerable.
|
69
|
+
# config.paranoid = true
|
70
|
+
|
71
|
+
# By default Devise will store the user in session. You can skip storage for
|
72
|
+
# :http_auth and :token_auth by adding those symbols to the array below.
|
73
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
74
|
+
# may want to disable generating routes to Devise's sessions controller by
|
75
|
+
# passing :skip => :sessions to `devise_for` in your config/routes.rb
|
76
|
+
config.skip_session_storage = [:http_auth]
|
77
|
+
|
78
|
+
# ==> Configuration for :database_authenticatable
|
79
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
80
|
+
# using other encryptors, it sets how many times you want the password re-encrypted.
|
81
|
+
#
|
82
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
83
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
84
|
+
# a value less than 10 in other environments.
|
85
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
86
|
+
|
87
|
+
# Setup a pepper to generate the encrypted password.
|
88
|
+
# config.pepper = "9c559e52e5f1056c945374f82d98851d3fb00e1139f7e95ecd44da9aa3be507cd538fe1201313dbf937f0d7d6605d9f648596000d2ee8f41e535f7396a668750"
|
89
|
+
|
90
|
+
# ==> Configuration for :confirmable
|
91
|
+
# A period that the user is allowed to access the website even without
|
92
|
+
# confirming his account. For instance, if set to 2.days, the user will be
|
93
|
+
# able to access the website for two days without confirming his account,
|
94
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
95
|
+
# the user cannot access the website without confirming his account.
|
96
|
+
# config.allow_unconfirmed_access_for = 2.days
|
97
|
+
|
98
|
+
# A period that the user is allowed to confirm their account before their
|
99
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
100
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
101
|
+
# their account can't be confirmed with the token any more.
|
102
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
103
|
+
# before confirming their account.
|
104
|
+
# config.confirm_within = 3.days
|
105
|
+
|
106
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
107
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
108
|
+
# db field (see migrations). Until confirmed new email is stored in
|
109
|
+
# unconfirmed email column, and copied to email column on successful confirmation.
|
110
|
+
config.reconfirmable = true
|
111
|
+
|
112
|
+
# Defines which key will be used when confirming an account
|
113
|
+
# config.confirmation_keys = [ :email ]
|
114
|
+
|
115
|
+
# ==> Configuration for :rememberable
|
116
|
+
# The time the user will be remembered without asking for credentials again.
|
117
|
+
# config.remember_for = 2.weeks
|
118
|
+
|
119
|
+
# If true, extends the user's remember period when remembered via cookie.
|
120
|
+
# config.extend_remember_period = false
|
121
|
+
|
122
|
+
# Options to be passed to the created cookie. For instance, you can set
|
123
|
+
# :secure => true in order to force SSL only cookies.
|
124
|
+
# config.rememberable_options = {}
|
125
|
+
|
126
|
+
# ==> Configuration for :validatable
|
127
|
+
# Range for password length. Default is 8..128.
|
128
|
+
config.password_length = 8..128
|
129
|
+
|
130
|
+
# Email regex used to validate email formats. It simply asserts that
|
131
|
+
# an one (and only one) @ exists in the given string. This is mainly
|
132
|
+
# to give user feedback and not to assert the e-mail validity.
|
133
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
134
|
+
|
135
|
+
# ==> Configuration for :timeoutable
|
136
|
+
# The time you want to timeout the user session without activity. After this
|
137
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
138
|
+
# config.timeout_in = 30.minutes
|
139
|
+
|
140
|
+
# If true, expires auth token on session timeout.
|
141
|
+
# config.expire_auth_token_on_timeout = false
|
142
|
+
|
143
|
+
# ==> Configuration for :lockable
|
144
|
+
# Defines which strategy will be used to lock an account.
|
145
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
146
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
147
|
+
# config.lock_strategy = :failed_attempts
|
148
|
+
|
149
|
+
# Defines which key will be used when locking and unlocking an account
|
150
|
+
# config.unlock_keys = [ :email ]
|
151
|
+
|
152
|
+
# Defines which strategy will be used to unlock an account.
|
153
|
+
# :email = Sends an unlock link to the user email
|
154
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
155
|
+
# :both = Enables both strategies
|
156
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
157
|
+
# config.unlock_strategy = :both
|
158
|
+
|
159
|
+
# Number of authentication tries before locking an account if lock_strategy
|
160
|
+
# is failed attempts.
|
161
|
+
# config.maximum_attempts = 20
|
162
|
+
|
163
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
164
|
+
# config.unlock_in = 1.hour
|
165
|
+
|
166
|
+
# ==> Configuration for :recoverable
|
167
|
+
#
|
168
|
+
# Defines which key will be used when recovering the password for an account
|
169
|
+
# config.reset_password_keys = [ :email ]
|
170
|
+
|
171
|
+
# Time interval you can reset your password with a reset password key.
|
172
|
+
# Don't put a too small interval or your users won't have the time to
|
173
|
+
# change their passwords.
|
174
|
+
config.reset_password_within = 6.hours
|
175
|
+
|
176
|
+
# ==> Configuration for :encryptable
|
177
|
+
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
178
|
+
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
179
|
+
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
180
|
+
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
181
|
+
# REST_AUTH_SITE_KEY to pepper)
|
182
|
+
# config.encryptor = :sha512
|
183
|
+
|
184
|
+
# ==> Configuration for :token_authenticatable
|
185
|
+
# Defines name of the authentication token params key
|
186
|
+
# config.token_authentication_key = :auth_token
|
187
|
+
|
188
|
+
# ==> Scopes configuration
|
189
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
190
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
191
|
+
# are using only default views.
|
192
|
+
config.scoped_views = true
|
193
|
+
|
194
|
+
# Configure the default scope given to Warden. By default it's the first
|
195
|
+
# devise role declared in your routes (usually :user).
|
196
|
+
# config.default_scope = :user
|
197
|
+
|
198
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
199
|
+
# only the current scope. By default, Devise signs out all scopes.
|
200
|
+
# config.sign_out_all_scopes = true
|
201
|
+
|
202
|
+
# ==> Navigation configuration
|
203
|
+
# Lists the formats that should be treated as navigational. Formats like
|
204
|
+
# :html, should redirect to the sign in page when the user does not have
|
205
|
+
# access, but formats like :xml or :json, should return 401.
|
206
|
+
#
|
207
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
208
|
+
# should add them to the navigational formats lists.
|
209
|
+
#
|
210
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
211
|
+
# config.navigational_formats = ["*/*", :html]
|
212
|
+
|
213
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
214
|
+
config.sign_out_via = :delete
|
215
|
+
|
216
|
+
# ==> OmniAuth
|
217
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
218
|
+
# up on your models and hooks.
|
219
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
220
|
+
|
221
|
+
# ==> Warden configuration
|
222
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
223
|
+
# change the failure app, you can configure them inside the config.warden block.
|
224
|
+
#
|
225
|
+
# config.warden do |manager|
|
226
|
+
# manager.intercept_401 = false
|
227
|
+
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
|
228
|
+
# end
|
229
|
+
|
230
|
+
# ==> Mountable engine configurations
|
231
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
232
|
+
# is mountable, there are some extra configurations to be taken into account.
|
233
|
+
# The following options are available, assuming the engine is mounted as:
|
234
|
+
#
|
235
|
+
# mount MyEngine, at: "/my_engine"
|
236
|
+
#
|
237
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
238
|
+
config.router_name = :simple_user
|
239
|
+
#
|
240
|
+
# When using omniauth, Devise cannot automatically set Omniauth path,
|
241
|
+
# so you need to do it manually. For the users scope, it would be:
|
242
|
+
# config.omniauth_path_prefix = "/my_engine/users/auth"
|
243
|
+
end
|