dougui_users 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +39 -0
  4. data/app/assets/javascripts/dougui_users/application.js +9 -0
  5. data/app/assets/stylesheets/dougui_users/application.css +7 -0
  6. data/app/assets/stylesheets/scaffold.css +56 -0
  7. data/app/controllers/dougui_users/application_controller.rb +27 -0
  8. data/app/controllers/dougui_users/user_activates_controller.rb +13 -0
  9. data/app/controllers/dougui_users/user_reset_passwords_controller.rb +41 -0
  10. data/app/controllers/dougui_users/user_sessions_controller.rb +34 -0
  11. data/app/controllers/dougui_users/users_controller.rb +51 -0
  12. data/app/helpers/dougui_users/user_mailer_helper.rb +13 -0
  13. data/app/mailers/dougui_users/user_mailer.rb +15 -0
  14. data/app/models/dougui_users/user.rb +16 -0
  15. data/app/models/dougui_users/user_session.rb +11 -0
  16. data/app/models/user_session.rb +2 -0
  17. data/app/views/dougui_users/user_mailer/activation.html.erb +1 -0
  18. data/app/views/dougui_users/user_mailer/reset_password.html.erb +1 -0
  19. data/app/views/dougui_users/user_reset_passwords/edit.html.erb +16 -0
  20. data/app/views/dougui_users/user_reset_passwords/new.html.erb +11 -0
  21. data/app/views/dougui_users/user_sessions/new.html.erb +22 -0
  22. data/app/views/dougui_users/users/edit.html.erb +16 -0
  23. data/app/views/dougui_users/users/new.html.erb +25 -0
  24. data/app/views/layouts/dougui_users/application.html.erb +12 -0
  25. data/config/cucumber.yml +8 -0
  26. data/config/locales/en.yml +5 -0
  27. data/config/locales/fr.yml +50 -0
  28. data/config/routes.rb +13 -0
  29. data/db/migrate/20110916144049_create_dougui_users_users.rb +20 -0
  30. data/features/step_definitions/custom_web_steps.rb +3 -0
  31. data/features/step_definitions/email_steps.rb +206 -0
  32. data/features/step_definitions/user_steps.rb +90 -0
  33. data/features/step_definitions/web_steps.rb +211 -0
  34. data/features/support/env.rb +88 -0
  35. data/features/support/paths.rb +49 -0
  36. data/features/support/selectors.rb +39 -0
  37. data/features/user.feature +86 -0
  38. data/features/user_activates.feature +13 -0
  39. data/features/user_reset_passwords.feature +56 -0
  40. data/features/user_session.feature +35 -0
  41. data/lib/dougui_users/engine.rb +5 -0
  42. data/lib/dougui_users/version.rb +3 -0
  43. data/lib/dougui_users.rb +7 -0
  44. data/lib/tasks/cucumber.rake +65 -0
  45. data/lib/tasks/dougui_users_tasks.rake +4 -0
  46. data/spec/controllers/dougui_users/user_activates_controller_spec.rb +32 -0
  47. data/spec/controllers/dougui_users/user_reset_passwords_controller_spec.rb +59 -0
  48. data/spec/controllers/dougui_users/user_sessions_controller_spec.rb +57 -0
  49. data/spec/controllers/dougui_users/users_controller_spec.rb +98 -0
  50. data/spec/dummy/Rakefile +7 -0
  51. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  52. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  53. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  54. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  55. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  56. data/spec/dummy/config/application.rb +45 -0
  57. data/spec/dummy/config/boot.rb +10 -0
  58. data/spec/dummy/config/database.yml +25 -0
  59. data/spec/dummy/config/environment.rb +5 -0
  60. data/spec/dummy/config/environments/development.rb +30 -0
  61. data/spec/dummy/config/environments/production.rb +60 -0
  62. data/spec/dummy/config/environments/test.rb +42 -0
  63. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  64. data/spec/dummy/config/initializers/inflections.rb +10 -0
  65. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  66. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  67. data/spec/dummy/config/initializers/session_store.rb +8 -0
  68. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  69. data/spec/dummy/config/locales/en.yml +5 -0
  70. data/spec/dummy/config/locales/fr.yml +269 -0
  71. data/spec/dummy/config/routes.rb +4 -0
  72. data/spec/dummy/config.ru +4 -0
  73. data/spec/dummy/db/development.sqlite3 +0 -0
  74. data/spec/dummy/db/schema.rb +28 -0
  75. data/spec/dummy/db/test.sqlite3 +0 -0
  76. data/spec/dummy/log/development.log +1340 -0
  77. data/spec/dummy/log/test.log +15056 -0
  78. data/spec/dummy/public/404.html +26 -0
  79. data/spec/dummy/public/422.html +26 -0
  80. data/spec/dummy/public/500.html +26 -0
  81. data/spec/dummy/public/favicon.ico +0 -0
  82. data/spec/dummy/script/rails +6 -0
  83. data/spec/dummy/tmp/cache/assets/D0B/620/sprockets%2F5fe8057c4691686098ead34f79e79e8f +0 -0
  84. data/spec/factories/dougui_users/user_factory.rb +9 -0
  85. data/spec/models/dougui_users/user_spec.rb +30 -0
  86. data/spec/spec_helper.rb +65 -0
  87. metadata +326 -0
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 YOURNAME
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.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = DouguiUsers
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'DouguiUsers'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+ Bundler::GemHelper.install_tasks
28
+
29
+ require 'rake/testtask'
30
+
31
+ Rake::TestTask.new(:test) do |t|
32
+ t.libs << 'lib'
33
+ t.libs << 'test'
34
+ t.pattern = 'test/**/*_test.rb'
35
+ t.verbose = false
36
+ end
37
+
38
+
39
+ task :default => :test
@@ -0,0 +1,9 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require_tree .
@@ -0,0 +1,7 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *= require_self
6
+ *= require_tree .
7
+ */
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,27 @@
1
+ module DouguiUsers
2
+ class ApplicationController < ActionController::Base
3
+
4
+ def current_user_session
5
+ return @current_user_session if defined?(@current_user_session)
6
+ @current_user_session = UserSession.find
7
+ end
8
+
9
+ def current_user
10
+ return @current_user if defined?(@current_user)
11
+ @current_user = current_user_session && current_user_session.record
12
+ end
13
+
14
+ def restrict_access
15
+ unless current_user
16
+ redirect_to login_path, :notice => t('access_denied', :scope => 'application_controller')
17
+ end
18
+ end
19
+
20
+ def load_user_using_perishable_token
21
+ @user = User.find_by_perishable_token(params[:id])
22
+ unless @user
23
+ redirect_to root_url, :notice => t('perishabletoken_not_valid', :scope => 'application_controller')
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,13 @@
1
+ module DouguiUsers
2
+ class UserActivatesController < ApplicationController
3
+
4
+ def edit
5
+ @user = DouguiUsers::User.find_by_perishable_token(params[:id])
6
+
7
+ @user.active = true
8
+ @user.save
9
+ redirect_to(login_path, :notice => t("user_activated", :scope => "user_activates.controller"))
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,41 @@
1
+ module DouguiUsers
2
+ class UserResetPasswordsController < ApplicationController
3
+
4
+ before_filter :restrict_access, :only => [:edit, :update]
5
+
6
+ def new
7
+ end
8
+
9
+ def create
10
+ @user = DouguiUsers::User.find_by_email(params[:user][:email])
11
+ if @user
12
+ @user.reset_perishable_token!
13
+ DouguiUsers::UserMailer.reset_password(@user).deliver
14
+ redirect_to(login_path, :notice => t("successfully_created", :scope => 'user_reset_passwords.controller'))
15
+ else
16
+ @user = DouguiUsers::User.new(:email => params[:user][:email])
17
+ @user.valid?
18
+ unless @user.errors[:email].any?
19
+ @user.errors[:email] = t("unknown_email", :scope => 'user_reset_passwords.controller')
20
+ end
21
+ render :new
22
+ end
23
+ end
24
+
25
+ def edit
26
+ @user = DouguiUsers::User.find_by_perishable_token params[:id]
27
+ end
28
+
29
+ def update
30
+ @user = DouguiUsers::User.find_by_perishable_token params[:id]
31
+ @user.password = params[:user][:password]
32
+ @user.password_confirmation = params[:user][:password_confirmation]
33
+ if @user.save
34
+ redirect_to(root_path, :notice => t("successfully_updated", :scope => 'user_reset_passwords.controller'))
35
+ else
36
+ render :edit
37
+ end
38
+ end
39
+
40
+ end
41
+ end
@@ -0,0 +1,34 @@
1
+ module DouguiUsers
2
+ class UserSessionsController < ApplicationController
3
+
4
+ before_filter :restrict_access, :only => [:destroy]
5
+
6
+ # GET /user_sessions/new
7
+ # GET /user_sessions/new.xml
8
+ def new
9
+ @user_session = UserSession.new
10
+ end
11
+
12
+ # POST /user_sessions
13
+ # POST /user_sessions.xml
14
+ def create
15
+ @user_session = UserSession.new(params[:user_session])
16
+ @user_session.remember_me = true
17
+ if @user_session.save
18
+ redirect_to(root_path)
19
+ else
20
+ render :action => "new"
21
+ end
22
+ end
23
+
24
+ # DELETE /user_sessions/1
25
+ # DELETE /user_sessions/1.xml
26
+ def destroy
27
+ @user_session = UserSession.find
28
+ if @user_session
29
+ @user_session.destroy
30
+ end
31
+ redirect_to root_path
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,51 @@
1
+ module DouguiUsers
2
+ class UsersController < ApplicationController
3
+
4
+ before_filter :restrict_access, :only => [:edit, :update, :destroy]
5
+
6
+ # GET /users/new
7
+ # GET /users/new.xml
8
+ def new
9
+ @user = User.new
10
+ end
11
+
12
+ # GET /users/1/edit
13
+ def edit
14
+ @user = User.find(params[:id])
15
+ end
16
+
17
+ # POST /users
18
+ # POST /users.xml
19
+ def create
20
+ @user = User.new(params[:user])
21
+ if @user.save
22
+ DouguiUsers::UserMailer.activation(@user).deliver
23
+ redirect_to(login_path, :notice => t("successfully_created", :scope => 'users.controller'))
24
+ else
25
+ render :action => "new"
26
+ end
27
+ end
28
+
29
+ # PUT /users/1
30
+ # PUT /users/1.xml
31
+ def update
32
+ @user = User.find(params[:id])
33
+
34
+
35
+ if @user.update_attributes(params[:user])
36
+ redirect_to(root_path, :notice => t("successfully_updated", :scope => 'users.controller'))
37
+ else
38
+ render :action => "edit"
39
+ end
40
+ end
41
+
42
+ # DELETE /users/1
43
+ # DELETE /users/1.xml
44
+ def destroy
45
+ @user = User.find(params[:id])
46
+ @user.destroy
47
+ redirect_to(root_path, :notice => t("successfully_destroyed", :scope => 'users.controller'))
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,13 @@
1
+ module DouguiUsers
2
+ module UserMailerHelper
3
+ def link_for_activate(user)
4
+ url = edit_user_activate_path(user)
5
+ link_to(url, url)
6
+ end
7
+
8
+ def link_for_reset_password(user)
9
+ url = edit_user_reset_password_path(user)
10
+ link_to(url, url)
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ module DouguiUsers
2
+ class UserMailer < ActionMailer::Base
3
+ default :from => "guirec.corbel@gmail.com"
4
+
5
+ def activation(user)
6
+ @user = user
7
+ mail(:to => user.email, :subject => t(".title", :scope => 'user_mailer.activation'))
8
+ end
9
+
10
+ def reset_password(user)
11
+ @user = user
12
+ mail(:to => user.email, :subject => t(".title", :scope => 'user_mailer.reset_password'))
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ module DouguiUsers
2
+ class User < ActiveRecord::Base
3
+ acts_as_authentic
4
+
5
+ validate :password, :presence => true
6
+
7
+ acts_as_authentic do |config|
8
+ config.ignore_blank_passwords = false
9
+ config.maintain_sessions = false
10
+ end
11
+
12
+ def to_s
13
+ username
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ module DouguiUsers
2
+ class UserSession < Authlogic::Session::Base
3
+ def to_key
4
+ new_record? ? nil : [ self.send(self.class.primary_key) ]
5
+ end
6
+
7
+ def persisted?
8
+ false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,2 @@
1
+ class UserSession < Authlogic::Session::Base
2
+ end
@@ -0,0 +1 @@
1
+ <%= raw t(".message", :user => @user, :link_for_activate => link_for_activate(@user) ) %>
@@ -0,0 +1 @@
1
+ <%= raw t(".message", :user => @user.username, :link_for_password_reset => link_for_reset_password(@user) ) %>
@@ -0,0 +1,16 @@
1
+ <%= form_for(@user, :url => url_for(:action=> :update, :controller => :user_reset_passwords, :id => @user.perishable_token)) do |f| %>
2
+ <div class="field">
3
+ <%= f.label :password %><br />
4
+ <%= f.password_field :password %>
5
+ <%= f.error_message_on :password %>
6
+ </div>
7
+ <div class="field">
8
+ <%= f.label :password_confirmation %><br />
9
+ <%= f.password_field :password_confirmation %>
10
+ <%= f.error_message_on :password_confirmation %>
11
+ </div>
12
+ <div class="actions">
13
+ <%= f.submit t(".submit") %>
14
+ </div>
15
+ <% end %>
16
+
@@ -0,0 +1,11 @@
1
+ <%= form_for(:user, :url => url_for(:action=>:create, :controller=> :user_reset_passwords)) do |f| %>
2
+ <div class="field">
3
+ <%= f.label :email, t("activerecord.attributes.user.email") %><br />
4
+ <%= f.text_field :email %>
5
+ <%= f.error_message_on :email %>
6
+ </div>
7
+ <div class="actions">
8
+ <%= f.submit t(".submit") %>
9
+ </div>
10
+ <% end %>
11
+
@@ -0,0 +1,22 @@
1
+ <%= form_for(@user_session, :url => user_sessions_path) do |f| %>
2
+ <% if @user_session.errors[:base].any? %>
3
+ <div id="error_explanation">
4
+ <% @user_session.errors[:base].each do |message| %>
5
+ <%= message %>
6
+ <% end %>
7
+ </div>
8
+ <% end %>
9
+ <div class="field">
10
+ <%= f.label :username %><br />
11
+ <%= f.text_field :username %>
12
+ <%= f.error_message_on :username %>
13
+ </div>
14
+ <div class="field">
15
+ <%= f.label :password %><br />
16
+ <%= f.password_field :password %>
17
+ <%= f.error_message_on :password %>
18
+ </div>
19
+ <div class="actions">
20
+ <%= f.submit t(".submit") %>
21
+ </div>
22
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <%= link_to t(".change_password_link"), :controller => :user_reset_passwords, :action => :edit, :id => @user.perishable_token %>
2
+ <%= form_for(@user) do |f| %>
3
+ <div class="field">
4
+ <%= f.label :username %><br />
5
+ <%= f.text_field :username %>
6
+ <%= f.error_message_on :username %>
7
+ </div>
8
+ <div class="field">
9
+ <%= f.label :email %><br />
10
+ <%= f.text_field :email %>
11
+ <%= f.error_message_on :email %>
12
+ </div>
13
+ <div class="actions">
14
+ <%= f.submit t(".submit") %>
15
+ </div>
16
+ <% end %>
@@ -0,0 +1,25 @@
1
+ <%= form_for(@user) do |f| %>
2
+ <div class="field">
3
+ <%= f.label :username %><br />
4
+ <%= f.text_field :username %>
5
+ <%= f.error_message_on :username %>
6
+ </div>
7
+ <div class="field">
8
+ <%= f.label :email %><br />
9
+ <%= f.text_field :email %>
10
+ <%= f.error_message_on :email %>
11
+ </div>
12
+ <div class="field">
13
+ <%= f.label :password %><br />
14
+ <%= f.password_field :password %>
15
+ <%= f.error_message_on :password %>
16
+ </div>
17
+ <div class="field">
18
+ <%= f.label :password_confirmation %><br />
19
+ <%= f.password_field :password_confirmation %>
20
+ <%= f.error_message_on :password_confirmation %>
21
+ </div>
22
+ <div class="actions">
23
+ <%= f.submit t(".submit") %>
24
+ </div>
25
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>DouguiUsers</title>
5
+ <%= csrf_meta_tags %>
6
+ </head>
7
+ <body>
8
+
9
+ <%= yield %>
10
+
11
+ </body>
12
+ </html>
@@ -0,0 +1,8 @@
1
+ <%
2
+ rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3
+ rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4
+ std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
5
+ %>
6
+ default: <%= std_opts %> features --drb
7
+ wip: --tags @wip:3 --drb --wip features
8
+ rerun: <%= rerun_opts %> --drb --format rerun --out rerun.txt --strict --tags ~@wip
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,50 @@
1
+ # French translations for Ruby on Rails
2
+ # by Christian Lescuyer (christian@flyingcoders.com)
3
+ # contributors:
4
+ # - Sebastien Grosjean - ZenCocoon.com
5
+ # - Bruno Michel - http://github.com/nono
6
+ # - Tsutomu Kuroda - http://github.com/kuroda (t-kuroda@oiax.jp)
7
+
8
+ fr:
9
+ dougui_users:
10
+ application_controller:
11
+ perishabletoken_not_valid: "Désolé, nous n'avons pu trouver votre compte.<br/> Veuillez effectuer un copier/coller depuis le courriel vers votre navigateur.<br/> Vous pouvez égaelement recommencer la procédure de réinitialisation de mot de passe."
12
+
13
+
14
+ user_mailer:
15
+ activation:
16
+ title: Activation de votre compte
17
+ message: "Bonjour %{user}, <br/><br/>Pour activer votre compte vous devez vous rendre à l'adresse : %{link_for_activate}"
18
+
19
+ reset_password:
20
+ title: Activation de votre compte
21
+ message: "Bonjour %{user}, <br/><br/>Pour modifier votre mot de passe vous devez vous rendre à cette adresse : %{link_for_password_reset}"
22
+
23
+ users:
24
+ controller:
25
+ successfully_created: "Vous avez été enregistré. Un courriel de confirmation vous a été envoyé. Vous devez confirmer votre inscription pour continuer."
26
+ successfully_updated: "Votre compte a été modifié"
27
+ successfully_destroyed: "Votre compte a été supprimé"
28
+ new:
29
+ submit: "S'inscrire"
30
+ edit:
31
+ change_password_link: "Modifier le mot de passe"
32
+ submit: "Valider"
33
+
34
+ user_sessions:
35
+ new:
36
+ submit: "Se connecter"
37
+ user_reset_passwords:
38
+ controller:
39
+ successfully_updated: "Votre mot de passe a été modifié"
40
+ successfully_created: "Un courriel de confirmation vous a été envoyé. Vous devez suivre les étapes indquées pour continuer."
41
+ unknown_email : "Cette adresse de courriel n'est pas enregistrée."
42
+
43
+ new:
44
+ submit: "Valider"
45
+ edit:
46
+ submit: "Valider"
47
+
48
+ user_activates:
49
+ controller:
50
+ user_activated: "Votre compte a été activé. Vous pouvez vous connecter."
data/config/routes.rb ADDED
@@ -0,0 +1,13 @@
1
+ DouguiUsers::Engine.routes.draw do
2
+
3
+
4
+ # get "dashboards/index"
5
+
6
+ match 'login' => 'user_sessions#new', :as => :login
7
+ match 'logout' => 'user_sessions#destroy', :as => :logout
8
+
9
+ root :to => "user_sessions#new"
10
+
11
+ resources :users, :user_sessions, :user_activates, :user_reset_passwords
12
+ # root :to => "dashboards#index"
13
+ end
@@ -0,0 +1,20 @@
1
+ class CreateDouguiUsersUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :dougui_users_users do |t|
4
+ t.string :username, :null => false
5
+ t.string :email, :null => false
6
+ t.string :crypted_password
7
+ t.string :password_salt
8
+ t.string :persistence_token
9
+ t.boolean :active, :default => false, :null => false
10
+ t.string :perishable_token, :default => "", :null => false
11
+
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+
17
+ def self.down
18
+ drop_table :dougui_users_users
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ Then /^show me the html$/ do
2
+ puts page.html
3
+ end