devise_rails3_ennder 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.bnsignore +21 -0
- data/.rvmrc +2 -0
- data/CHANGELOG.rdoc +397 -0
- data/History.txt +3 -0
- data/INSTALL +93 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +272 -0
- data/Rakefile +17 -0
- data/TODO +2 -0
- data/app/.directory +3 -0
- data/app/views/.directory +3 -0
- data/app/views/devise/.directory +3 -0
- data/app/views/devise/confirmations/new.html.erb +14 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +7 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +12 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +10 -0
- data/app/views/devise/passwords/edit.html.erb +20 -0
- data/app/views/devise/passwords/new.html.erb +14 -0
- data/app/views/devise/registrations/.directory +3 -0
- data/app/views/devise/registrations/edit.html.erb +31 -0
- data/app/views/devise/registrations/new.html.erb +18 -0
- data/app/views/devise/sessions/new.html.erb +17 -0
- data/app/views/devise/shared/_links.erb +25 -0
- data/app/views/devise/shared/_user_nav.html.erb +15 -0
- data/app/views/devise/unlocks/new.html.erb +14 -0
- data/bin/.directory +3 -0
- data/bin/devise_rails3_ennder.rb +6 -0
- data/config/.directory +4 -0
- data/config/routes.rb +25 -0
- data/lib/.directory +3 -0
- data/lib/app/.directory +3 -0
- data/lib/app/models/.directory +3 -0
- data/lib/app/models/user.rb +9 -0
- data/lib/config/.directory +3 -0
- data/lib/config/initializers/.directory +3 -0
- data/lib/config/initializers/devise.rb +194 -0
- data/lib/db/.directory +3 -0
- data/lib/db/migrate/.directory +3 -0
- data/lib/db/migrate/SSAAMMJJHHMMSS_devise_create_users.rb +26 -0
- data/lib/devise_rails3_ennder/.directory +3 -0
- data/lib/devise_rails3_ennder/config/.directory +3 -0
- data/lib/devise_rails3_ennder/config/locales/.directory +3 -0
- data/lib/devise_rails3_ennder/config/locales/devise.en.yml +98 -0
- data/lib/devise_rails3_ennder/config/locales/devise.fr.yml +109 -0
- data/lib/devise_rails3_ennder/engine.rb +8 -0
- data/lib/devise_rails3_ennder/load_locales.rb +12 -0
- data/lib/devise_rails3_ennder.rb +64 -0
- data/lib/tasks/.directory +3 -0
- data/lib/tasks/devise_rails3_ennder_tasks.rake +30 -0
- data/version.txt +1 -0
- metadata +134 -0
data/.bnsignore
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# The list of files that should be ignored by Mr Bones.
|
2
|
+
# Lines that start with '#' are comments.
|
3
|
+
#
|
4
|
+
# A .gitignore file can be used instead by setting it as the ignore
|
5
|
+
# file in your Rakefile:
|
6
|
+
#
|
7
|
+
# Bones {
|
8
|
+
# ignore_file '.gitignore'
|
9
|
+
# }
|
10
|
+
#
|
11
|
+
# For a project with a C extension, the following would be a good set of
|
12
|
+
# exclude patterns (uncomment them if you want to use them):
|
13
|
+
# *.[oa]
|
14
|
+
# *~
|
15
|
+
announcement.txt
|
16
|
+
coverage
|
17
|
+
doc
|
18
|
+
pkg
|
19
|
+
|
20
|
+
#Kde (marche PAS)
|
21
|
+
.directory
|
data/.rvmrc
ADDED
data/CHANGELOG.rdoc
ADDED
@@ -0,0 +1,397 @@
|
|
1
|
+
== 1.0.9
|
2
|
+
|
3
|
+
* enhancements
|
4
|
+
* Extracted redirect path from Devise failure app to a new method, allowing override in custom failure apps
|
5
|
+
* Added sign_out_via
|
6
|
+
|
7
|
+
* bug fix
|
8
|
+
* Email is now case insensitive
|
9
|
+
* Avoid session fixation attacks
|
10
|
+
|
11
|
+
== 1.0.8
|
12
|
+
|
13
|
+
* enhancements
|
14
|
+
* Support for latest MongoMapper
|
15
|
+
* Added anybody_signed_in? helper (by github.com/SSDany)
|
16
|
+
|
17
|
+
* bug fix
|
18
|
+
* confirmation_required? is properly honored on active? calls. (by github.com/paulrosania)
|
19
|
+
|
20
|
+
== 1.0.7
|
21
|
+
|
22
|
+
* bug fix
|
23
|
+
* Ensure password confirmation is always required
|
24
|
+
|
25
|
+
* deprecations
|
26
|
+
* authenticatable was deprecated and renamed to database_authenticatable
|
27
|
+
* confirmable is not included by default on generation
|
28
|
+
|
29
|
+
== 1.0.6
|
30
|
+
|
31
|
+
* bug fix
|
32
|
+
* Do not allow unlockable strategies based on time to access a controller.
|
33
|
+
* Do not send unlockable email several times.
|
34
|
+
* Allow controller to upstram custom! failures to Warden.
|
35
|
+
|
36
|
+
== 1.0.5
|
37
|
+
|
38
|
+
* bug fix
|
39
|
+
* Use prepend_before_filter in require_no_authentication.
|
40
|
+
* require_no_authentication on unlockable.
|
41
|
+
* Fix a bug when giving an association proxy to devise.
|
42
|
+
* Do not use lock! on lockable since it's part of ActiveRecord API.
|
43
|
+
|
44
|
+
== 1.0.4
|
45
|
+
|
46
|
+
* bug fix
|
47
|
+
* Fixed a bug when deleting an account with rememberable
|
48
|
+
* Fixed a bug with custom controllers
|
49
|
+
|
50
|
+
== 1.0.3
|
51
|
+
|
52
|
+
* enhancements
|
53
|
+
* HTML e-mails now have proper formatting
|
54
|
+
* Do not remove MongoMapper options in find
|
55
|
+
|
56
|
+
== 1.0.2
|
57
|
+
|
58
|
+
* enhancements
|
59
|
+
* Allows you set mailer content type (by github.com/glennr)
|
60
|
+
|
61
|
+
* bug fix
|
62
|
+
* Uses the same content type as request on http authenticatable 401 responses
|
63
|
+
|
64
|
+
== 1.0.1
|
65
|
+
|
66
|
+
* enhancements
|
67
|
+
* HttpAuthenticatable is not added by default automatically.
|
68
|
+
* Avoid mass assignment error messages with current password.
|
69
|
+
|
70
|
+
* bug fix
|
71
|
+
* Fixed encryptors autoload
|
72
|
+
|
73
|
+
== 1.0.0
|
74
|
+
|
75
|
+
* deprecation
|
76
|
+
* :old_password in update_with_password is deprecated, use :current_password instead
|
77
|
+
|
78
|
+
* enhancements
|
79
|
+
* Added Registerable
|
80
|
+
* Added Http Basic Authentication support
|
81
|
+
* Allow scoped_views to be customized per controller/mailer class
|
82
|
+
* [#99] Allow authenticatable to used in change_table statements
|
83
|
+
* Add mailer_content_type configuration parameter (by github.com/glennr)
|
84
|
+
|
85
|
+
== 0.9.2
|
86
|
+
|
87
|
+
* bug fix
|
88
|
+
* Ensure inactive user cannot sign in
|
89
|
+
* Ensure redirect to proper url after sign up
|
90
|
+
|
91
|
+
* enhancements
|
92
|
+
* Added gemspec to repo
|
93
|
+
* Added token authenticatable (by github.com/grimen)
|
94
|
+
|
95
|
+
== 0.9.1
|
96
|
+
|
97
|
+
* bug fix
|
98
|
+
* Allow bigger salt size (by github.com/jgeiger)
|
99
|
+
* Fix relative url root
|
100
|
+
|
101
|
+
== 0.9.0
|
102
|
+
|
103
|
+
* deprecation
|
104
|
+
* devise :all is deprecated
|
105
|
+
* :success and :failure flash messages are now :notice and :alert
|
106
|
+
|
107
|
+
* enhancements
|
108
|
+
* Added devise lockable (by github.com/mhfs)
|
109
|
+
* Warden 0.9.0 compatibility
|
110
|
+
* Mongomapper 0.6.10 compatibility
|
111
|
+
* Added Devise.add_module as hooks for extensions (by github.com/grimen)
|
112
|
+
* Ruby 1.9.1 compatibility (by github.com/grimen)
|
113
|
+
|
114
|
+
* bug fix
|
115
|
+
* Accept path prefix not starting with slash
|
116
|
+
* url helpers should rely on find_scope!
|
117
|
+
|
118
|
+
== 0.8.2
|
119
|
+
|
120
|
+
* enhancements
|
121
|
+
* Allow Devise.mailer_sender to be a proc (by github.com/grimen)
|
122
|
+
|
123
|
+
* bug fix
|
124
|
+
* Fix bug with passenger, update is required to anyone deploying on passenger (by github.com/dvdpalm)
|
125
|
+
|
126
|
+
== 0.8.1
|
127
|
+
|
128
|
+
* enhancements
|
129
|
+
* Move salt to encryptors
|
130
|
+
* Devise::Lockable
|
131
|
+
* Moved view links into partial and I18n'ed them
|
132
|
+
|
133
|
+
* bug fix
|
134
|
+
* Bcrypt generator was not being loaded neither setting the proper salt
|
135
|
+
|
136
|
+
== 0.8.0
|
137
|
+
|
138
|
+
* enhancements
|
139
|
+
* Warden 0.8.0 compatibility
|
140
|
+
* Add an easy for map.connect "sign_in", :controller => "sessions", :action => "new" to work
|
141
|
+
* Added :bcrypt encryptor (by github.com/capotej)
|
142
|
+
|
143
|
+
* bug fix
|
144
|
+
* sign_in_count is also increased when user signs in via password change, confirmation, etc..
|
145
|
+
* More DataMapper compatibility (by github.com/lancecarlson)
|
146
|
+
|
147
|
+
* deprecation
|
148
|
+
* Removed DeviseMailer.sender
|
149
|
+
|
150
|
+
== 0.7.5
|
151
|
+
|
152
|
+
* enhancements
|
153
|
+
* Set a default value for mailer to avoid find_template issues
|
154
|
+
* Add models configuration to MongoMapper::EmbeddedDocument as well
|
155
|
+
|
156
|
+
== 0.7.4
|
157
|
+
|
158
|
+
* enhancements
|
159
|
+
* Extract Activatable from Confirmable
|
160
|
+
* Decouple Serializers from Devise modules
|
161
|
+
|
162
|
+
== 0.7.3
|
163
|
+
|
164
|
+
* bug fix
|
165
|
+
* Give scope to the proper model validation
|
166
|
+
|
167
|
+
* enhancements
|
168
|
+
* Mail views are scoped as well
|
169
|
+
* Added update_with_password for authenticatable
|
170
|
+
* Allow render_with_scope to accept :controller option
|
171
|
+
|
172
|
+
== 0.7.2
|
173
|
+
|
174
|
+
* deprecation
|
175
|
+
* Renamed reset_confirmation! to resend_confirmation!
|
176
|
+
* Copying locale is part of the installation process
|
177
|
+
|
178
|
+
* bug fix
|
179
|
+
* Fixed render_with_scope to work with all controllers
|
180
|
+
* Allow sign in with two different users in Devise::TestHelpers
|
181
|
+
|
182
|
+
== 0.7.1
|
183
|
+
|
184
|
+
* enhancements
|
185
|
+
* Small enhancements for other plugins compatibility (by github.com/grimen)
|
186
|
+
|
187
|
+
== 0.7.0
|
188
|
+
|
189
|
+
* deprecations
|
190
|
+
* :authenticatable is not included by default anymore
|
191
|
+
|
192
|
+
* enhancements
|
193
|
+
* Improve loading process
|
194
|
+
* Extract SessionSerializer from Authenticatable
|
195
|
+
|
196
|
+
== 0.6.3
|
197
|
+
|
198
|
+
* bug fix
|
199
|
+
* Added trackable to migrations
|
200
|
+
* Allow inflections to work
|
201
|
+
|
202
|
+
== 0.6.2
|
203
|
+
|
204
|
+
* enhancements
|
205
|
+
* More DataMapper compatibility
|
206
|
+
* Devise::Trackable - track sign in count, timestamps and ips
|
207
|
+
|
208
|
+
== 0.6.1
|
209
|
+
|
210
|
+
* enhancements
|
211
|
+
* Devise::Timeoutable - timeout sessions without activity
|
212
|
+
* DataMapper now accepts conditions
|
213
|
+
|
214
|
+
== 0.6.0
|
215
|
+
|
216
|
+
* deprecations
|
217
|
+
* :authenticatable is still included by default, but yields a deprecation warning
|
218
|
+
|
219
|
+
* enhancements
|
220
|
+
* Added DataMapper support
|
221
|
+
* Remove store_location from authenticatable strategy and add it to failure app
|
222
|
+
* Allow a strategy to be placed after authenticatable
|
223
|
+
* [#45] Do not rely attribute? methods, since they are not added on Datamapper
|
224
|
+
|
225
|
+
== 0.5.6
|
226
|
+
|
227
|
+
* enhancements
|
228
|
+
* [#42] Do not send nil to build (DataMapper compatibility)
|
229
|
+
* [#44] Allow to have scoped views
|
230
|
+
|
231
|
+
== 0.5.5
|
232
|
+
|
233
|
+
* enhancements
|
234
|
+
* Allow overwriting find for authentication method
|
235
|
+
* [#38] Remove Ruby 1.8.7 dependency
|
236
|
+
|
237
|
+
== 0.5.4
|
238
|
+
|
239
|
+
* deprecations
|
240
|
+
* Deprecate :singular in devise_for and use :scope instead
|
241
|
+
|
242
|
+
* enhancements
|
243
|
+
* [#37] Create after_sign_in_path_for and after_sign_out_path_for hooks to be
|
244
|
+
overwriten in ApplicationController
|
245
|
+
* Create sign_in_and_redirect and sign_out_and_redirect helpers
|
246
|
+
* Warden::Manager.default_scope is automatically configured to the first given scope
|
247
|
+
|
248
|
+
== 0.5.3
|
249
|
+
|
250
|
+
* bug fix
|
251
|
+
* MongoMapper now converts DateTime to Time
|
252
|
+
* Ensure all controllers are unloadable
|
253
|
+
|
254
|
+
* enhancements
|
255
|
+
* [#35] Moved friendly_token to Devise
|
256
|
+
* Added Devise.all, so you can freeze your app strategies
|
257
|
+
* Added Devise.apply_schema, so you can turn it to false in Datamapper or MongoMapper
|
258
|
+
in cases you don't want it be handlded automatically
|
259
|
+
|
260
|
+
== 0.5.2
|
261
|
+
|
262
|
+
* enhancements
|
263
|
+
* [#28] Improved sign_in and sign_out helpers to accepts resources
|
264
|
+
* [#28] Added stored_location_for as a helper
|
265
|
+
* [#20] Added test helpers
|
266
|
+
|
267
|
+
== 0.5.1
|
268
|
+
|
269
|
+
* enhancements
|
270
|
+
* Added serializers based on Warden ones
|
271
|
+
* Allow authentication keys to be set
|
272
|
+
|
273
|
+
== 0.5.0
|
274
|
+
|
275
|
+
* bug fix
|
276
|
+
* Fixed a bug where remember me module was not working properly
|
277
|
+
|
278
|
+
* enhancements
|
279
|
+
* Moved encryption strategy into the Encryptors module to allow several algorithms (by github.com/mhfs)
|
280
|
+
* Implemented encryptors for Clearance, Authlogic and Restful-Authentication (by github.com/mhfs)
|
281
|
+
* Added support for MongoMapper (by github.com/shingara)
|
282
|
+
|
283
|
+
== 0.4.3
|
284
|
+
|
285
|
+
* bug fix
|
286
|
+
* [#29] Authentication just fails if user cannot be serialized from session, without raising errors;
|
287
|
+
* Default configuration values should not overwrite user values;
|
288
|
+
|
289
|
+
== 0.4.2
|
290
|
+
|
291
|
+
* deprecations
|
292
|
+
* Renamed mail_sender to mailer_sender
|
293
|
+
|
294
|
+
* enhancements
|
295
|
+
* skip_before_filter added in Devise controllers
|
296
|
+
* Use home_or_root_path on require_no_authentication as well
|
297
|
+
* Added devise_controller?, useful to select or reject filters in ApplicationController
|
298
|
+
* Allow :path_prefix to be given to devise_for
|
299
|
+
* Allow default_url_options to be configured through devise (:path_prefix => "/:locale" is now supported)
|
300
|
+
|
301
|
+
== 0.4.1
|
302
|
+
|
303
|
+
* bug fix
|
304
|
+
* [#21] Ensure options can be set even if models were not loaded
|
305
|
+
|
306
|
+
== 0.4.0
|
307
|
+
|
308
|
+
* deprecations
|
309
|
+
* Notifier is deprecated, use DeviseMailer instead. Remember to rename
|
310
|
+
app/views/notifier to app/views/devise_mailer and I18n key from
|
311
|
+
devise.notifier to devise.mailer
|
312
|
+
* :authenticable calls are deprecated, use :authenticatable instead
|
313
|
+
|
314
|
+
* enhancements
|
315
|
+
* [#16] Allow devise to be more agnostic and do not require ActiveRecord to be loaded
|
316
|
+
* Allow Warden::Manager to be configured through Devise
|
317
|
+
* Created a generator which creates an initializer
|
318
|
+
|
319
|
+
== 0.3.0
|
320
|
+
|
321
|
+
* bug fix
|
322
|
+
* [#15] Allow yml messages to be configured by not using engine locales
|
323
|
+
|
324
|
+
* deprecations
|
325
|
+
* Renamed confirm_in to confirm_within
|
326
|
+
* [#14] Do not send confirmation messages when user changes his e-mail
|
327
|
+
* [#13] Renamed authenticable to authenticatable and added deprecation warnings
|
328
|
+
|
329
|
+
== 0.2.3
|
330
|
+
|
331
|
+
* enhancements
|
332
|
+
* Ensure fail! works inside strategies
|
333
|
+
* [#12] Make unauthenticated message (when you haven't signed in) different from invalid message
|
334
|
+
|
335
|
+
* bug fix
|
336
|
+
* Do not redirect on invalid authenticate
|
337
|
+
* Allow model configuration to be set to nil
|
338
|
+
|
339
|
+
== 0.2.2
|
340
|
+
|
341
|
+
* bug fix
|
342
|
+
* [#9] Fix a bug when using customized resources
|
343
|
+
|
344
|
+
== 0.2.1
|
345
|
+
|
346
|
+
* refactor
|
347
|
+
* Clean devise_views generator to use devise existing views
|
348
|
+
|
349
|
+
* enhancements
|
350
|
+
* [#7] Create instance variables (like @user) for each devise controller
|
351
|
+
* Use Devise::Controller::Helpers only internally
|
352
|
+
|
353
|
+
* bug fix
|
354
|
+
* [#6] Fix a bug with Mongrel and Ruby 1.8.6
|
355
|
+
|
356
|
+
== 0.2.0
|
357
|
+
|
358
|
+
* enhancements
|
359
|
+
* [#4] Allow option :null => true in authenticable migration
|
360
|
+
* [#3] Remove attr_accessible calls from devise modules
|
361
|
+
* Customizable time frame for rememberable with :remember_for config
|
362
|
+
* Customizable time frame for confirmable with :confirm_in config
|
363
|
+
* Generators for creating a resource and copy views
|
364
|
+
|
365
|
+
* optimize
|
366
|
+
* Do not load hooks or strategies if they are not used
|
367
|
+
|
368
|
+
* bug fixes
|
369
|
+
* [#2] Fixed requiring devise strategies
|
370
|
+
|
371
|
+
== 0.1.1
|
372
|
+
|
373
|
+
* bug fixes
|
374
|
+
* [#1] Fixed requiring devise mapping
|
375
|
+
|
376
|
+
== 0.1.0
|
377
|
+
|
378
|
+
* Devise::Authenticable
|
379
|
+
* Devise::Confirmable
|
380
|
+
* Devise::Recoverable
|
381
|
+
* Devise::Validatable
|
382
|
+
* Devise::Migratable
|
383
|
+
* Devise::Rememberable
|
384
|
+
|
385
|
+
* SessionsController
|
386
|
+
* PasswordsController
|
387
|
+
* ConfirmationsController
|
388
|
+
|
389
|
+
* Create an example app
|
390
|
+
* devise :all, :except => :rememberable
|
391
|
+
* Use sign_in and sign_out in SessionsController
|
392
|
+
|
393
|
+
* Mailer subjects namespaced by model
|
394
|
+
* Allow stretches and pepper per model
|
395
|
+
|
396
|
+
* Store session[:return_to] in session
|
397
|
+
* Sign user in automatically after confirming or changing it's password
|
data/History.txt
ADDED
data/INSTALL
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
Instructions d'installation du plugin Devise traduit par Ennder
|
2
|
+
---------------------------------------------------------------
|
3
|
+
|
4
|
+
1) Installation du Gem :
|
5
|
+
Le Gem warden correspondant à la version de devise pour rails 3 doit-être installé sur votre serveur.
|
6
|
+
Le Gem devise pour rails 3 doit-être installé sur votre serveur.
|
7
|
+
|
8
|
+
Pour installer devise rails3_ennder :
|
9
|
+
gem install devise_rails3_ennder
|
10
|
+
|
11
|
+
information à titre indicatif :
|
12
|
+
Ce Gem est généré par le Gem bones :
|
13
|
+
gem install bones
|
14
|
+
rake gem
|
15
|
+
|
16
|
+
2) Le modèle User :
|
17
|
+
1) Utiliser la tâche devise_rails3_ennder:sync_migrations pour installer le fichier de migration
|
18
|
+
Attention au nom du fichier de migration, par rapport à sa date.
|
19
|
+
|
20
|
+
2) Utiliser la tâche devise_rails3_ennder:sync_user_model pour installer le modèle User
|
21
|
+
Ce n'est qu'après que vous pourrez le personnaliser.
|
22
|
+
Notamment en y ajoutant vos relations, vos attributs additionnels.
|
23
|
+
|
24
|
+
Vous pouvez aussi sélectionner parmi les 12 sous-fonctionnalités de Devise,
|
25
|
+
mais attention, il peut y avoir des champs à rajouter dans le fichier de migration.
|
26
|
+
|
27
|
+
Le plugin apporte :
|
28
|
+
- Les vues traduites
|
29
|
+
- Un partiel _user_nav qui apporte les liens se connecter, s'inscrire etc...
|
30
|
+
|
31
|
+
- Un message d'erreur si l'on essaye de supprimer l'utilisateur administrateur
|
32
|
+
|
33
|
+
- Un modèle User pré-généré à recopier avec une tâche rake
|
34
|
+
- Un fichier de migration de la table users à recopier avec une tâche rake
|
35
|
+
|
36
|
+
- Un fichier .gitignore pour la génération du Gem
|
37
|
+
- Un guide d'installation (INSTALL)
|
38
|
+
- Les routes de devise
|
39
|
+
- Les traductions
|
40
|
+
|
41
|
+
3) Ensuite il y a des paramètres à fixer dans le fichier de configuration :
|
42
|
+
|
43
|
+
3.1) L'adresse qui envoie les mails d'enregistrement :
|
44
|
+
Ajouter un fichier config/initialiers/devise.rb, qui contient :
|
45
|
+
|
46
|
+
__________________________________________
|
47
|
+
Devise.setup do |config|
|
48
|
+
config.mailer_sender = 'mail@domaine.com'
|
49
|
+
|
50
|
+
# Ajout login par nom d'utilisateur : nécéssite un attribut attr_accessible username dans le modèle user
|
51
|
+
# config.authentication_keys = [ :email, :username ]
|
52
|
+
end
|
53
|
+
___________________________________________
|
54
|
+
|
55
|
+
|
56
|
+
3.2) En développement vous pouvez activer la remontée des erreurs dans l'interface en commentant la ligne suivante
|
57
|
+
config.action_mailer.raise_delivery_errors = false
|
58
|
+
|
59
|
+
3.3) Il vous faut aussi fixer l'URL suivante :
|
60
|
+
config.action_mailer.default_url_options = { :host => 'serveur.domaine.com:80' }
|
61
|
+
|
62
|
+
3.4) La configuration SMTP :
|
63
|
+
config.action_mailer.smtp_settings = {
|
64
|
+
:address => 'serveur_smtp.domaine_du_fai.com',
|
65
|
+
:port => 25,
|
66
|
+
:domain => "domaine_du_fai.com"
|
67
|
+
}
|
68
|
+
|
69
|
+
|
70
|
+
4) Ajouter un before_filter au Controlleur de l'application :
|
71
|
+
|
72
|
+
before_filter :authenticate_user!, :unless => :authenticate_user_exception?
|
73
|
+
|
74
|
+
#Méthode ajoutée qui permet de désactiver l'authentifications sur certains controlleurs
|
75
|
+
def authenticate_user_exception?
|
76
|
+
return (controller_name == "produits")
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
5) Enfin vous pouvez aussi surcharger les vues en les recopiant depuis le plugin :
|
81
|
+
|
82
|
+
|
83
|
+
Utilisation :
|
84
|
+
-------------
|
85
|
+
Pour savoir si l'utilisateur en cours est authentifié, vous pouvez utiliser :
|
86
|
+
user_signed_in?
|
87
|
+
|
88
|
+
Pour obtenir l'utilisateur courant :
|
89
|
+
current_user
|
90
|
+
|
91
|
+
Et sa session :
|
92
|
+
user_session
|
93
|
+
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2011 Ennder http://www.ennder.fr
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|