devise_rails3_ennder 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/.bnsignore +21 -0
  2. data/.rvmrc +2 -0
  3. data/CHANGELOG.rdoc +397 -0
  4. data/History.txt +3 -0
  5. data/INSTALL +93 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.rdoc +272 -0
  8. data/Rakefile +17 -0
  9. data/TODO +2 -0
  10. data/app/.directory +3 -0
  11. data/app/views/.directory +3 -0
  12. data/app/views/devise/.directory +3 -0
  13. data/app/views/devise/confirmations/new.html.erb +14 -0
  14. data/app/views/devise/mailer/confirmation_instructions.html.erb +7 -0
  15. data/app/views/devise/mailer/reset_password_instructions.html.erb +12 -0
  16. data/app/views/devise/mailer/unlock_instructions.html.erb +10 -0
  17. data/app/views/devise/passwords/edit.html.erb +20 -0
  18. data/app/views/devise/passwords/new.html.erb +14 -0
  19. data/app/views/devise/registrations/.directory +3 -0
  20. data/app/views/devise/registrations/edit.html.erb +31 -0
  21. data/app/views/devise/registrations/new.html.erb +18 -0
  22. data/app/views/devise/sessions/new.html.erb +17 -0
  23. data/app/views/devise/shared/_links.erb +25 -0
  24. data/app/views/devise/shared/_user_nav.html.erb +15 -0
  25. data/app/views/devise/unlocks/new.html.erb +14 -0
  26. data/bin/.directory +3 -0
  27. data/bin/devise_rails3_ennder.rb +6 -0
  28. data/config/.directory +4 -0
  29. data/config/routes.rb +25 -0
  30. data/lib/.directory +3 -0
  31. data/lib/app/.directory +3 -0
  32. data/lib/app/models/.directory +3 -0
  33. data/lib/app/models/user.rb +9 -0
  34. data/lib/config/.directory +3 -0
  35. data/lib/config/initializers/.directory +3 -0
  36. data/lib/config/initializers/devise.rb +194 -0
  37. data/lib/db/.directory +3 -0
  38. data/lib/db/migrate/.directory +3 -0
  39. data/lib/db/migrate/SSAAMMJJHHMMSS_devise_create_users.rb +26 -0
  40. data/lib/devise_rails3_ennder/.directory +3 -0
  41. data/lib/devise_rails3_ennder/config/.directory +3 -0
  42. data/lib/devise_rails3_ennder/config/locales/.directory +3 -0
  43. data/lib/devise_rails3_ennder/config/locales/devise.en.yml +98 -0
  44. data/lib/devise_rails3_ennder/config/locales/devise.fr.yml +109 -0
  45. data/lib/devise_rails3_ennder/engine.rb +8 -0
  46. data/lib/devise_rails3_ennder/load_locales.rb +12 -0
  47. data/lib/devise_rails3_ennder.rb +64 -0
  48. data/lib/tasks/.directory +3 -0
  49. data/lib/tasks/devise_rails3_ennder_tasks.rake +30 -0
  50. data/version.txt +1 -0
  51. metadata +134 -0
data/README.rdoc ADDED
@@ -0,0 +1,272 @@
1
+ == Devise Rails 3 Ennder
2
+
3
+ Devise is a flexible authentication solution for Rails based on Warden (translated in FR by Ennder). It:
4
+
5
+ What this gem does :
6
+ - adds a rake task (devise_rails3_ennder:sync_user_model) that adds a model 'User' that has devise enabled
7
+ - adds a rake task (devise_rails3_ennder:sync_migrations) to add a migration that creates the users table and its devise fields
8
+ - adds a rake task (devise_rails3_ennder:sync_devise_initializer) to add the devise initializer configuration file
9
+ - adds extended devise translations in modified views (en, fr)
10
+
11
+ This gem does not (you have to do it) :
12
+ - add the devise routes to your config/routes.rb
13
+ route devise_for :users
14
+ - add config/initializers/devise.rb
15
+
16
+
17
+ Right now devise composed of 12 modules:
18
+
19
+ * Database Authenticatable: responsible for encrypting password and validating authenticity of a user while signing in.
20
+ * Token Authenticatable: validates authenticity of a user while signing in using an authentication token (also known as "single access token").
21
+ * HttpAuthenticatable: sign in users using basic HTTP authentication.
22
+ * Confirmable: responsible for verifying whether an account is already confirmed to sign in, and to send emails with confirmation instructions.
23
+ * Recoverable: takes care of reseting the user password and send reset instructions.
24
+ * Registerable: handles signing up users through a registration process.
25
+ * Rememberable: manages generating and clearing token for remember the user from a saved cookie.
26
+ * Trackable: tracks sign in count, timestamps and ip.
27
+ * Timeoutable: expires sessions without activity in a certain period of time.
28
+ * Validatable: creates all needed validations for email and password. It's totally optional, so you're able to to customize validations by yourself.
29
+ * Lockable: takes care of locking an account based on the number of failed sign in attempts. Handles unlock via expire and email.
30
+ * Activatable: if you need to activate accounts by other means, which are not through confirmation, use this module.
31
+
32
+ == Dependencies
33
+
34
+ Devise Rails 3 Ennder is based on :
35
+ - Devise
36
+ - Warden (http://github.com/hassox/warden), a Rack Authentication Framework so you need to install it as a gem. Please ensure you have it installed in order to use devise (see installation below).
37
+
38
+ == Installation
39
+
40
+ Install devise_rails3_ennder
41
+
42
+ gem install devise_rails3_ennder
43
+
44
+ Install warden gem if you don't have it installed:
45
+
46
+ gem install warden
47
+
48
+ Install devise gem:
49
+
50
+ gem install devise
51
+
52
+ Configure warden and devise gems inside your app:
53
+
54
+ gem 'warden'
55
+ gem 'devise'
56
+ gem 'devise_rails3_ennder'
57
+
58
+ == Basic Usage
59
+
60
+ This is a walkthrough with all steps you need to setup a devise resource, including model, migration, route files, and optional configuration. You MUST also check out the *Generators* section below to help you start.
61
+
62
+ Devise must be set up within the model (or models) you want to use, and devise routes must be created inside your config/routes.rb file.
63
+
64
+ We're assuming here you want a User model with some modules, as outlined below:
65
+
66
+ class User < ActiveRecord::Base
67
+ devise :database_authenticatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable
68
+ end
69
+
70
+ After you choose which modules to use, you need to setup your migrations. Luckily, devise has some helpers to save you from this boring work:
71
+
72
+ create_table :users do |t|
73
+ t.database_authenticatable
74
+ t.confirmable
75
+ t.recoverable
76
+ t.rememberable
77
+ t.trackable
78
+ t.timestamps
79
+ end
80
+
81
+ Remember that Devise don't rely on _attr_accessible_ or _attr_protected_ inside its modules, so be sure to setup what attributes are accessible or protected in your model.
82
+
83
+ The next setup after setting up your model is to configure your routes. You do this by opening up your config/routes.rb and adding:
84
+
85
+ map.devise_for :users
86
+
87
+ This is going to look inside you User model and create a set of needed routes (you can see them by running `rake routes`).
88
+
89
+ There are also some options available for configuring your routes, as :class_name (to set the class for that route), :path_prefix, :as and :path_names, where the last two have the same meaning as in common routes. The available :path_names are:
90
+
91
+ map.devise_for :users, :as => "usuarios", :path_names => { :sign_in => 'login', :sign_out => 'logout', :password => 'secret', :confirmation => 'verification', :unlock => 'unblock' }
92
+
93
+ Be sure to check devise_for documentation for detailed description.
94
+
95
+ After this steps, run your migrations, and you are ready to go! But don't finish reading, we still have a lot to tell you:
96
+
97
+ == Controller filters and helpers
98
+
99
+ Devise is gonna create some helpers to use inside your controllers and views. To setup a controller that needs user authentication, just add this before_filter:
100
+
101
+ before_filter :authenticate_user!
102
+
103
+ To verify if a user is signed in, you have the following helper:
104
+
105
+ user_signed_in?
106
+
107
+ And to get the current signed in user this helper is available:
108
+
109
+ current_user
110
+
111
+ You have also access to the session for this scope:
112
+
113
+ user_session
114
+
115
+ After signing in a user, confirming it's account or updating it's password, devise will look for a scoped root path to redirect. Example: For a :user resource, it will use user_root_path if it exists, otherwise default root_path will be used. This means that you need to set the root inside your routes:
116
+
117
+ map.root :controller => 'home'
118
+
119
+ You can also overwrite after_sign_in_path_for and after_sign_out_path_for to customize better your redirect hooks.
120
+
121
+ Finally, you also need to setup default url options for the mailer in each environment. Here's is the configuration for config/environments/development.rb:
122
+
123
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
124
+
125
+ == Tidying up
126
+
127
+ Devise let's you setup as many roles as you want, so let's say you already have this User model and also want an Admin model with just authentication, trackable, lockable and timeoutable stuff and none of confirmation or password recovery. Just follow the same steps:
128
+
129
+ # Create a migration with the required fields
130
+ create_table :admins do |t|
131
+ t.database_authenticatable
132
+ t.lockable
133
+ t.trackable
134
+ end
135
+
136
+ # Inside your Admin model
137
+ devise :database_authenticatable, :trackable, :timeoutable, :lockable
138
+
139
+ # Inside your routes
140
+ map.devise_for :admin
141
+
142
+ # Inside your protected controller
143
+ before_filter :authenticate_admin!
144
+
145
+ # Inside your controllers and views
146
+ admin_signed_in?
147
+ current_admin
148
+ admin_session
149
+
150
+ == Generators
151
+
152
+ Devise comes with some generators to help you start:
153
+
154
+ ruby script/generate devise_install
155
+
156
+ This will generate an initializer, with a description of all configuration values. You can also generate models through:
157
+
158
+ ruby script/generate devise Model
159
+
160
+ A model configured with all devise modules and attr_accessible for default fields will be created. The generator will also create the migration and configure your routes for devise.
161
+
162
+ == Model configuration
163
+
164
+ The devise method in your models also accept some options to configure its modules. For example, you can chose which encryptor to use in database_authenticatable:
165
+
166
+ devise :database_authenticatable, :confirmable, :recoverable, :encryptor => :bcrypt
167
+
168
+ Besides :encryptor, you can provide :pepper, :stretches, :confirm_within, :remember_for, :timeout_in, :unlock_in and others. All those are describer in the initializer created when you invoke the devise_install generator describer above.
169
+
170
+ == Views
171
+
172
+ Since devise is an engine, it has all default views inside the gem. They are good to get you started, but you will want to customize them at some point. And Devise has a generator to make copy them all to your application:
173
+
174
+ ruby script/generate devise_views
175
+
176
+ By default Devise will use the same views for all roles you have. But what if you need so different views to each of them? Devise also has an easy way to accomplish it: just setup config.scoped_views to true inside "config/initializers/devise.rb".
177
+
178
+ After doing so you will be able to have views based on the scope like 'sessions/users/new' and 'sessions/admin/new'. If no view is found within the scope, Devise will fallback to the default view.
179
+
180
+ Devise uses flash messages to let users know if their login is successful or not. Devise expects your application to call 'flash[:notice]' and 'flash[:alert]' as appropriate.
181
+
182
+ == I18n
183
+
184
+ Devise uses flash messages with I18n with the flash keys :success and :failure. To customize your app, you can setup your locale file this way:
185
+
186
+ en:
187
+ devise:
188
+ sessions:
189
+ signed_in: 'Signed in successfully.'
190
+
191
+ You can also create distinct messages based on the resource you've configured using the singular name given in routes:
192
+
193
+ en:
194
+ devise:
195
+ sessions:
196
+ user:
197
+ signed_in: 'Welcome user, you are signed in.'
198
+ admin:
199
+ signed_in: 'Hello admin!'
200
+
201
+ Devise mailer uses the same pattern to create subject messages:
202
+
203
+ en:
204
+ devise:
205
+ mailer:
206
+ confirmation_instructions: 'Hello everybody!'
207
+ user:
208
+ confirmation_instructions: 'Hello User! Please confirm your email'
209
+ reset_password_instructions: 'Reset instructions'
210
+
211
+ Take a look at our locale file to check all available messages.
212
+
213
+ == Test helpers
214
+
215
+ Devise includes some tests helpers for functional specs. To use them, you just need to include Devise::TestHelpers in your test class and use the sign_in and sign_out method. Such methods have the same signature as in controllers:
216
+
217
+ sign_in :user, @user # sign_in(scope, resource)
218
+ sign_in @user # sign_in(resource)
219
+
220
+ sign_out :user # sign_out(scope)
221
+ sign_out @user # sign_out(resource)
222
+
223
+ You can include the Devise Test Helpers in all of your tests by adding the following to the bottom of your test/test_helper.rb or spec/spec_helper.rb file:
224
+
225
+ class ActionController::TestCase
226
+ include Devise::TestHelpers
227
+ end
228
+
229
+ Do not use such helpers for integration tests like Cucumber, Webrat... Just fill in the form or explicitly set the user in session. For more tips, check the wiki (http://wiki.github.com/plataformatec/devise).
230
+
231
+ == Migrating from other solutions
232
+
233
+ Devise implements encryption strategies for Clearance, Authlogic and Restful-Authentication. To make use of it set the desired encryptor in the encryptor initializer config option. You might also need to rename your encrypted password and salt columns to match Devises's one (encrypted_password and password_salt).
234
+
235
+ == Other ORMs
236
+
237
+ Devise supports both ActiveRecord (default) and MongoMapper, and has experimental Datamapper supports (in a sense that Devise test suite does not run completely with Datamapper). To choose other ORM, you just need to configure it in the initializer file.
238
+
239
+ == TODO
240
+
241
+ Please refer to TODO file.
242
+
243
+ == Security
244
+
245
+ Needless to say, security is extremely important to Devise. If you find yourself in a possible security issue with Devise, please go through the following steps, trying to reproduce the bug:
246
+
247
+ 1) Look at the source code a bit to find out whether your assumptions are correct;
248
+ 2) If possible, provide a way to reproduce the bug: a small app on Github or a step-by-step to reproduce;
249
+ 3) E-mail us or send a Github private message instead of using the normal issues;
250
+
251
+ Being able to reproduce the bug is the first step to fix it. Thanks for your understanding.
252
+
253
+ == Maintainers
254
+
255
+ * José Valim (http://github.com/josevalim)
256
+ * Carlos Antônio da Silva (http://github.com/carlosantoniodasilva)
257
+
258
+ == Contributors
259
+
260
+ We have a long running list of contributors. Check them all here:
261
+
262
+ http://github.com/plataformatec/devise/contributors
263
+
264
+ == Bugs and Feedback
265
+
266
+ If you discover any bugs or want to drop a line, feel free to create an issue on
267
+ GitHub or send an e-mail to the mailing list.
268
+
269
+ http://github.com/plataformatec/devise/issues
270
+ http://groups.google.com/group/plataformatec-devise
271
+
272
+ MIT License. Copyright 2009 Plataforma Tecnologia. http://blog.plataformatec.com.br
data/Rakefile ADDED
@@ -0,0 +1,17 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ begin
4
+ require 'bones'
5
+ rescue LoadError
6
+ abort '### Please install the "bones" gem ###'
7
+ end
8
+
9
+ task :default => 'test:run'
10
+ task 'gem:release' => 'test:run'
11
+
12
+ Bones {
13
+ name 'devise_rails3_ennder'
14
+ authors 'José VALIM, Carlos ANTÔNIO, Jérôme BATAILLE'
15
+ email 'mel@ennder.fr'
16
+ url 'http://www.ennder.fr'
17
+ }
data/TODO ADDED
@@ -0,0 +1,2 @@
1
+ * ajout dépendances gems warden et devise au lancement
2
+ * tests
data/app/.directory ADDED
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2010,12,15,16,56,31
3
+ ViewMode=1
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2010,12,15,16,56,34
3
+ ViewMode=1
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,6,7,11,27,6
3
+ ViewMode=1
@@ -0,0 +1,14 @@
1
+ <!-- TODO Ennder A TRADUIRE "Resend confirmation instructions/Renvoi des instructions de confirmation" -->
2
+ <h2>Resend confirmation instructions</h2>
3
+
4
+ <%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
5
+ <%= devise_error_messages! %>
6
+
7
+ <p><%= f.label :email %><br />
8
+ <%= f.email_field :email %></p>
9
+
10
+ <!-- TODO Ennder A TRADUIRE "Resend confirmation instructions/Renvoyer les instructions de confirmation" -->
11
+ <p><%= f.submit "Resend confirmation instructions" %></p>
12
+ <% end %>
13
+
14
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,7 @@
1
+ <p>Welcome <%= @resource.email %>!</p>
2
+
3
+ <!-- t("devise.registrations.confirm_link") -->
4
+ <p>You can confirm your account through the link below:</p>
5
+
6
+ <!-- TODO Ennder TRANSLATION 'Confirm my account/Confirmer mon inscription'-->
7
+ <p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
@@ -0,0 +1,12 @@
1
+ <p>Hello <%= (@resource.username + ' : ') unless @resource.username.blank? %><%= @resource.email %>!</p>
2
+
3
+ <!-- t('devise.mailer.Someone_requested_change_password') -->
4
+ <p>Someone has requested a link to change your password, and you can do this through the link below.</p>
5
+
6
+ <!-- t('devise.mailer.Change_my_password') -->
7
+ <p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
8
+
9
+ <!-- t('devise.mailer.If_you_didnt_request_this') -->
10
+ <p>If you didn't request this, please ignore this email.</p>
11
+ <!--t('devise.mailer.Your_password_wont_change_until') -->
12
+ <p>Your password won't change until you access the link above and create a new one.</p>
@@ -0,0 +1,10 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <!-- TOTO Ennder TRANSLATION "Your account has been locked due to an excessive amount of unsuccessful sign in attempts." -->
4
+ <p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
5
+
6
+ <!-- TOTO Ennder TRANSLATION "Click the link below to unlock your account:" -->
7
+ <p>Click the link below to unlock your account:</p>
8
+
9
+ <!-- TOTO Ennder TRANSLATION "Unlock my account" -->
10
+ <p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
@@ -0,0 +1,20 @@
1
+ <!-- TODO Ennder Trad° "Change your password" -->
2
+ <h2>Change your password</h2>
3
+
4
+ <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
5
+ <%= devise_error_messages! %>
6
+ <%= f.hidden_field :reset_password_token %>
7
+
8
+ <!-- TODO Ennder Trad° "New password" -->
9
+ <p><%= f.label :password, "New password" %><br />
10
+ <%= f.password_field :password %></p>
11
+
12
+ <!-- TODO Ennder Trad° "Confirm new password" -->
13
+ <p><%= f.label :password_confirmation, "Confirm new password" %><br />
14
+ <%= f.password_field :password_confirmation %></p>
15
+
16
+ <!-- TODO Ennder Trad° "Change my password" -->
17
+ <p><%= f.submit "Change my password" %></p>
18
+ <% end %>
19
+
20
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,14 @@
1
+ <!-- t('devise.passwords.link') -->
2
+ <h2>Forgot your password?</h2>
3
+
4
+ <%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
5
+ <%= devise_error_messages! %>
6
+
7
+ <p><%= f.label :email %><br />
8
+ <%= f.email_field :email %></p>
9
+
10
+ <!-- t('devise.passwords.send_me_instructions') -->
11
+ <p><%= f.submit "Send me reset password instructions" %></p>
12
+ <% end %>
13
+
14
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,5,24,12,10,49
3
+ ViewMode=1
@@ -0,0 +1,31 @@
1
+ <h2><%= t('devise.registrations.edit_only') %> <%= t("activerecord.models.#{resource_name}") %></h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
4
+ <%
5
+ if !resource.errors.empty?
6
+ -%>
7
+ <div id="flash_error"><%= devise_error_messages! %></div>
8
+ <%
9
+ end
10
+ -%>
11
+
12
+ <p><%= f.label :email %><br />
13
+ <%= f.email_field :email %></p>
14
+
15
+ <p><%= f.label :password %> <i>(<%= t('devise.registrations.leave_password_blank_dont_change') %>)</i><br />
16
+ <%= f.password_field :password %></p>
17
+
18
+ <p><%= f.label :password_confirmation %><br />
19
+ <%= f.password_field :password_confirmation %></p>
20
+
21
+ <p><%= f.label :current_password %> <i>(<%= t('devise.registrations.need_current_passord') %>)</i><br />
22
+ <%= f.password_field :current_password %></p>
23
+
24
+ <p><%= f.submit t('Update') %></p>
25
+ <% end %>
26
+
27
+ <h3><%= t('devise.registrations.cancel_account') %></h3>
28
+
29
+ <p><%= t('devise.registrations.unhappy') %> <%= link_to t('devise.registrations.cancel_account'), registration_path(resource_name), :confirm => t('confirmation.are_you_sure'), :method => :delete %>.</p>
30
+
31
+ <%= link_to t('links.back'), :back %>
@@ -0,0 +1,18 @@
1
+ <h2><%= t('devise.registrations.sign_up') %></h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
4
+ <%= devise_error_messages! %>
5
+
6
+ <p><%= f.label :email %><br />
7
+ <%= f.email_field :email %></p>
8
+
9
+ <p><%= f.label :password %><br />
10
+ <%= f.password_field :password %></p>
11
+
12
+ <p><%= f.label :password_confirmation %><br />
13
+ <%= f.password_field :password_confirmation %></p>
14
+
15
+ <p><%= f.submit t('devise.registrations.sign_up') %></p>
16
+ <% end %>
17
+
18
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,17 @@
1
+ <h2><%= t('devise.sessions.sign_in') %></h2>
2
+
3
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
4
+ <p><%= f.label :email %><br />
5
+ <%= f.email_field :email %></p>
6
+
7
+ <p><%= f.label :password %><br />
8
+ <%= f.password_field :password %></p>
9
+
10
+ <% if devise_mapping.rememberable? -%>
11
+ <p><%= f.check_box :remember_me %> <%= f.label :remember_me %></p>
12
+ <% end -%>
13
+
14
+ <p><%= f.submit t('devise.sessions.sign_in') %></p>
15
+ <% end %>
16
+
17
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,25 @@
1
+ <%- if controller_name != 'sessions' %>
2
+ <%= link_to t('devise.sessions.sign_in'), new_session_path(resource_name) %><br />
3
+ <% end -%>
4
+
5
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to t('devise.registrations.sign_up'), new_registration_path(resource_name) %><br />
7
+ <% end -%>
8
+
9
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
10
+ <%= link_to t('devise.passwords.link'), new_password_path(resource_name) %><br />
11
+ <% end -%>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to t('devise.confirmations.link'), 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 t('devise.unlocks.link'), 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
+ <div id="user_nav" align="right">
2
+ <%
3
+ if user_signed_in?
4
+ %> <%= t('devise.sessions.signed_in_as') %> <b><%= current_user.email %></b>.&nbsp;&nbsp;&nbsp;<%= link_to t('devise.sessions.Logout'), destroy_user_session_path %>&nbsp;&nbsp;&nbsp;<%= link_to t('devise.registrations.edit'), edit_user_registration_path %><%
5
+ else
6
+ %> <%= link_to( t('devise.registrations.link'), new_user_registration_path ) %> <%= t('devise.sessions.or') %> <%= link_to( t('devise.sessions.link'), new_user_session_path ) %><%
7
+ end
8
+
9
+ if I18n.locale == :en
10
+ %> [&nbsp;en&nbsp;|&nbsp;<%= link_to 'fr', url_for(:locale => 'fr') %>&nbsp;]<%
11
+ else
12
+ %> [&nbsp;<%= link_to 'en', url_for(:locale => 'en') %>&nbsp;|&nbsp;fr&nbsp;]<%
13
+ end
14
+ %>
15
+ </div>
@@ -0,0 +1,14 @@
1
+ <!-- TODO Ennder TRANSLATION "Resend unlock instructions" -->
2
+ <h2>Resend unlock instructions</h2>
3
+
4
+ <%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
5
+ <%= devise_error_messages! %>
6
+
7
+ <p><%= f.label :email %><br />
8
+ <%= f.email_field :email %></p>
9
+
10
+ <!-- TODO Ennder TRANSLATION "Resend unlock instructions" -->
11
+ <p><%= f.submit "Resend unlock instructions" %></p>
12
+ <% end %>
13
+
14
+ <%= render :partial => "devise/shared/links" %>
data/bin/.directory ADDED
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,3,24,16,51,5
3
+ ViewMode=1
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(
4
+ File.join(File.dirname(__FILE__), %w[.. lib devise_rails3_ennder]))
5
+
6
+ # Put your code here
data/config/.directory ADDED
@@ -0,0 +1,4 @@
1
+ [Dolphin]
2
+ SortOrder=1
3
+ Timestamp=2011,6,8,16,19,44
4
+ ViewMode=1
data/config/routes.rb ADDED
@@ -0,0 +1,25 @@
1
+ # -*- coding: utf-8 -*-
2
+ if Rails::VERSION::MAJOR >= 3
3
+ begin
4
+ # puts "Engine devise_rails3_ennder, config/routes.rb : [#{Rails.application.routes.routes.size}] route(s)"
5
+
6
+ _routes = Rails.application.routes
7
+ _nb_routes_avant = _routes.routes.size
8
+
9
+ _routes.draw do
10
+ devise_for :users
11
+ end
12
+
13
+ =begin
14
+ _routes.routes.each_with_index { |r, i|
15
+ puts "#{i}: #{r}"
16
+ }
17
+ =end
18
+
19
+ puts "Engine devise_rails3_ennder, config/routes.rb : route(s) #{_nb_routes_avant} -> #{_routes.routes.size}"
20
+ rescue
21
+ puts "Engine devise_rails3_ennder, config/routes.rb : exception \"#{$!}\""
22
+ end
23
+ else
24
+ puts 'Engine devise_rails3_ennder, Erreur le Gem devise_rails3_ennder est prévu pour Rails >= 3'
25
+ end
data/lib/.directory ADDED
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2010,11,23,15,52,23
3
+ ViewMode=1
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,6,7,17,6,1
3
+ ViewMode=1
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,6,7,17,14,59
3
+ ViewMode=1
@@ -0,0 +1,9 @@
1
+ class User < ActiveRecord::Base
2
+ # Include default devise modules. Others available are:
3
+ # :http_authenticatable, :token_authenticatable, :lockable, :timeoutable and :activatable
4
+ devise :registerable, :database_authenticatable, :confirmable, :recoverable,
5
+ :rememberable, :trackable, :validatable
6
+
7
+ # Setup accessible (or protected) attributes for your model
8
+ attr_accessible :email, :password, :password_confirmation
9
+ end
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,6,9,15,53,32
3
+ ViewMode=1
@@ -0,0 +1,3 @@
1
+ [Dolphin]
2
+ Timestamp=2011,6,9,15,50,32
3
+ ViewMode=1