tkh_authentication 0.1.11 → 0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ODU5ZDNhMDM0ZmQ0ZDI4MzhmYjRhODZhZDUzNWY4ZjJlNDk0YzFlMg==
5
- data.tar.gz: !binary |-
6
- MTkxMmM0ZDZlMmE0MWE2YmVhN2MwYWY5ZDcwMzgyMzBhM2EwMjNjYw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MWE5MTk3MjMzNThjYTNlNDliMTJiYTU0OGQ5NmY1OWQwYmJkOTczMjMzOTRi
10
- MGQzMDk2MTlmOWE0NDBhYjI3OGQ3ODg3NjY0ZTZjMzZiODI5OWM5YjM4ZWVj
11
- MmRiNWU2OWMyZTdkZjg0MGM4NTQ0YmY4NGY5NTQwZmMzNzQyMGY=
12
- data.tar.gz: !binary |-
13
- M2NjZTNmZTliMTMwZDJlZTkxZjMyZTcwNTNmNGYxNzFiOTJkN2ZjNzNhNDE5
14
- NmViNzQzZmNmODNjNGRjNTc4MGRkZDBkNDg1Yjc2ODhmNDdmOWVkNDFiNGIw
15
- MTg2YjRjZWRhMTYyYTNmZTg2MjU3ZTljZDg1OTBlN2FkNTUwZGE=
2
+ SHA1:
3
+ metadata.gz: 28f316a8faa632209bc5e7f61180ecb2c76a3f86
4
+ data.tar.gz: 023273ab775e3da2e1cb678b9a263c90e1244390
5
+ SHA512:
6
+ metadata.gz: 49474f311038313c261440bb93b2c5566c4a26478fa410573642ae21e336738d6c9e2edc9202467a827e7a764242926d222577b8bdb32495d3e9bc01de37dcf4
7
+ data.tar.gz: 4830d31d0172958a5c75abb2ba57433b243375a3d9ca31db087ed4412c056bf13413243973880f6ad2722b3ce676d993c53b2bed601b62c23dacfb4fcf454e2e
data/CHANGELOG.md CHANGED
@@ -1,30 +1,6 @@
1
1
  # TKH Authentication
2
2
 
3
3
 
4
- ## 0.1.11
5
-
6
- * Ensure the target page is always set and removed when needed to improve the click-flow of users signing in or creating an account.
7
- * When user is redirected to login page from the detect address view, his entered email address follows with.
8
-
9
-
10
- ## 0.1.10
11
-
12
- * Debugged the user has comments dependent destroy bug
13
- * Added a user delete button to the index view. Connected with tkh_mailing_list gem details controller.
14
-
15
-
16
- ## 0.1.9
17
-
18
- * Change click flow for new users to sign up
19
- * Signup and login routine are now aware of the tkh_mailing_list gem and its records
20
- * Email address must be validated before creating an account
21
-
22
-
23
- ## 0.1.8
24
-
25
- * Added other name attribute to user model
26
- * Integrated views and functionality with the new tkh-mailing-list gem. tkh-authentication handles the user model and creation of records by user and tkh-mailing-list will handle all additions/modifications/deletions by the admin.
27
-
28
4
 
29
5
  ## 0.1.7
30
6
 
@@ -71,7 +47,7 @@
71
47
 
72
48
  * Styled login form the simple_form way
73
49
  * Changed some text and translations in login form
74
- * Worked on text and translation in signup form
50
+ * Worked on text and translation in signup form
75
51
  * The shared/menus partial is called from all authentication pages
76
52
 
77
53
 
@@ -1,5 +1,5 @@
1
1
  class PasswordResetsController < ApplicationController
2
-
2
+
3
3
  def create
4
4
  user = User.find_by_email(params[:email])
5
5
  if user
@@ -16,21 +16,13 @@ class PasswordResetsController < ApplicationController
16
16
 
17
17
  def update
18
18
  @user = User.find_by_password_reset_token!(params[:id])
19
- if @user.password_reset_sent_at < 2.hours.ago
19
+ if @user.password_reset_sent_at < 24.hours.ago
20
20
  redirect_to new_password_reset_path, :alert => t('authentication.warning.password_reset_expired')
21
21
  elsif @user.update_attributes(params[:user])
22
- cookies[:auth_token] = @user.auth_token # logging in the user
23
- redirect_to session[:target_page] || safe_root_url, notice: t('authentication.password_reset_confirmation')
24
- destroy_target_page
22
+ redirect_to root_url, :notice => t('authentication.password_reset_confirmation')
25
23
  else
26
24
  render :edit
27
25
  end
28
26
  end
29
27
 
30
- private
31
-
32
- def destroy_target_page
33
- session[:target_page] = nil
34
- end
35
-
36
- end
28
+ end
@@ -1,13 +1,12 @@
1
1
  class SessionsController < ApplicationController
2
2
 
3
3
  def new
4
- set_target_page
5
4
  redirect_to root_path if current_user
6
5
  end
7
6
 
8
7
  def create
9
- set_target_page
10
8
  user = User.find_by_email(params[:email])
9
+ set_target_page
11
10
  if user && user.authenticate(params[:password])
12
11
  if params[:remember_me]
13
12
  cookies.permanent[:auth_token] = user.auth_token
@@ -15,7 +14,7 @@ class SessionsController < ApplicationController
15
14
  cookies[:auth_token] = user.auth_token
16
15
  end
17
16
  redirect_to (session[:target_page] || safe_root_url), notice: t('authentication.login_confirmation')
18
- destroy_target_page
17
+ session[:target_page] = nil
19
18
  else
20
19
  flash.now.alert = t('authentication.warning.email_or_password_invalid')
21
20
  render "new"
@@ -24,18 +23,13 @@ class SessionsController < ApplicationController
24
23
 
25
24
  def destroy
26
25
  cookies.delete(:auth_token)
27
- destroy_target_page
28
26
  redirect_to safe_root_url, notice: t('authentication.logout_confirmation')
29
27
  end
30
-
28
+
31
29
  private
32
-
30
+
33
31
  def set_target_page
34
32
  session[:target_page] = request.referer unless session[:target_page] # && !request.referer.nil?
35
33
  end
36
34
 
37
- def destroy_target_page
38
- session[:target_page] = nil
39
- end
40
-
41
35
  end
@@ -1,8 +1,8 @@
1
1
  class UsersController < ApplicationController
2
-
2
+
3
3
  before_filter :authenticate, only: 'index'
4
- before_filter :authenticate_with_admin, except: ['new', 'create', 'detect_existence']
5
-
4
+ before_filter :authenticate_with_admin, except: ['new', 'create']
5
+
6
6
  def index
7
7
  @users = User.by_recent
8
8
  render layout: 'admin'
@@ -23,44 +23,25 @@ class UsersController < ApplicationController
23
23
  render "new"
24
24
  end
25
25
  end
26
-
27
- def detect_existence
28
- set_target_page
29
- @detected_email = params[:user][:email]
30
- user = User.where('email = ?',@detected_email).first
31
- if user && !user.password_digest.blank? && user.password != 'temporary'
32
- flash[:notice] = "Our records show you have an account with us. Please login."
33
- redirect_to login_path(email: @detected_email)
34
- else
35
- if user
36
- newbie = Newbie.where('email = ?', params[:user][:email]).first
37
- else
38
- newbie = Newbie.create(email: params[:user][:email])
39
- end
40
- newbie.send_password_set
41
- flash[:notice] = "Our records show you do not have an account with us. We need to verify your email address. Please check your email inbox (or spam filter if you have nothing after several minutes) and click on the confirmation link."
42
- redirect_to safe_root_url
43
- end
44
- end
45
-
26
+
46
27
  def make_admin
47
28
  user = User.find(params[:id])
48
29
  user.admin = true
49
30
  user.save
50
31
  redirect_to users_path, notice: t('authentication.admin_enabled_confirmation')
51
32
  end
52
-
33
+
53
34
  def remove_admin
54
35
  user = User.find(params[:id])
55
36
  user.admin = false
56
37
  user.save
57
38
  redirect_to users_path, notice: t('authentication.admin_disabled_confirmation')
58
39
  end
59
-
40
+
60
41
  private
61
-
42
+
62
43
  def set_target_page
63
44
  session[:target_page] = request.referer unless session[:target_page] # && !request.referer.nil?
64
45
  end
65
-
46
+
66
47
  end
@@ -1,5 +1,5 @@
1
1
  class UserMailer < ActionMailer::Base
2
-
2
+
3
3
  default :from => Setting.first.try(:contact_email) ? Setting.first.try(:contact_email) : 'info@tenthousandhours.eu'
4
4
 
5
5
  # Subject can be set in your I18n file at config/locales/en.yml
@@ -7,14 +7,9 @@ class UserMailer < ActionMailer::Base
7
7
  #
8
8
  # en.user_mailer.password_reset.subject
9
9
  #
10
- def password_reset(user)
10
+ def password_reset(user)
11
11
  @user = user
12
12
  mail :to => user.email, :subject => t('authentication.password_reset_email_subject') + ' | ' + Setting.first.try(:site_name)
13
13
  end
14
14
 
15
- def password_set(user)
16
- @user = user
17
- mail :to => user.email, :subject => t('authentication.email_validation_subject') + ' | ' + Setting.first.try(:site_name)
18
- end
19
-
20
- end
15
+ end
data/app/models/user.rb CHANGED
@@ -4,18 +4,16 @@ class User < ActiveRecord::Base
4
4
 
5
5
  # associations connected to tkh_content gem. Any page or comment model will do
6
6
  has_many :pages
7
- has_many :comments, :dependent => :destroy, foreign_key: 'author_id'
7
+ has_many :comments, :dependent => :destroy
8
8
 
9
9
  # not allowed are :admin:boolean, :auth_token:string, password_reset_token:string, password_reset_sent_at:datetime
10
10
  attr_accessible :email, :password, :password_confirmation, :first_name, :last_name, :other_name
11
11
 
12
12
  validates_presence_of :email
13
13
  validates_uniqueness_of :email, :case_sensitive => false
14
- # validates_presence_of :password, on: :create
15
-
16
- # TODO - this needs to be somehow integrated in the click flow
17
- # validates_presence_of :first_name
18
- # validates_presence_of :last_name
14
+ validates_presence_of :password, on: :create
15
+ validates_presence_of :first_name
16
+ validates_presence_of :last_name
19
17
 
20
18
  scope :alphabetically, order('last_name, first_name')
21
19
  scope :administrators, where('admin = ?', true)
@@ -8,7 +8,4 @@
8
8
  <%= f.input :password_confirmation %>
9
9
  </div>
10
10
  <div class="actions"><%= f.submit t('authentication.update_password') %></div>
11
- <% end %>
12
-
13
- <%# partial in tkh_menus gem or has to be added in host app %>
14
- <%= render './shared/menus' %>
11
+ <% end %>
@@ -1,6 +1,7 @@
1
1
  <%= form_tag sessions_path, class: 'simple_form form-horizontal' do %>
2
2
 
3
3
  <div class="form-inputs">
4
+
4
5
  <div class="control-group email required">
5
6
  <%= label_tag :email, t('activerecord.attributes.user.email'), class: "email required control-label" %>
6
7
  <div class="controls">
@@ -8,7 +9,7 @@
8
9
  <p class="help-block"><%= link_to t('authentication.not_registered'), signup_path %></p>
9
10
  </div>
10
11
  </div>
11
-
12
+
12
13
  <div class="control-group password required">
13
14
  <%= label_tag :password, t('activerecord.attributes.user.password'), class: "password required control-label" %>
14
15
  <div class="controls">
@@ -22,11 +23,11 @@
22
23
  <label class="checkbox"><input class="boolean optional" id="remember_me" name="remember_me" type="checkbox" value="1" /><%= t('authentication.remember_me') %></label>
23
24
  </div>
24
25
  </div>
25
-
26
+
26
27
  </div>
27
-
28
+
28
29
  <div class="form-actions">
29
30
  <%= submit_tag t('authentication.login_now'), class: 'btn btn-primary' %>
30
31
  </div>
31
-
32
- <% end %>
32
+
33
+ <% end %>
@@ -8,7 +8,6 @@
8
8
  <th><%= t 'authentication.name' %></th>
9
9
  <th><%= t 'activerecord.attributes.user.email' %></th>
10
10
  <th><%= t('question_mark_inverted') %><%= t('activerecord.attributes.user.admin') %><%= t('question_mark') %></th>
11
- <th><%= t('actions') %></th>
12
11
  </tr>
13
12
  </thead>
14
13
 
@@ -24,7 +23,6 @@
24
23
  <span class="label label-success">✓</span> <%= link_to t('authentication.disable_admin'), remove_admin_user_path(user), class: 'btn btn-mini', method: :post %>
25
24
  <% end -%>
26
25
  </td>
27
- <td><%= link_to t('edit'), edit_detail_path(user), class: 'btn btn-mini' %><%= link_to t('delete'), Detail.find(user.id), method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-mini btn-danger' %></td>
28
26
  </tr>
29
27
  <% end %>
30
28
  </tbody>
data/config/routes.rb CHANGED
@@ -9,9 +9,8 @@ Rails.application.routes.draw do
9
9
  post :make_admin
10
10
  post :remove_admin
11
11
  end
12
- collection { post :detect_existence }
13
12
  end
14
13
  resources :sessions
15
14
  resources :password_resets
16
15
  end
17
- end
16
+ end
@@ -1,10 +1,10 @@
1
1
  de:
2
-
2
+
3
3
  activerecord:
4
4
  models:
5
5
  user: 'Benutzer'
6
6
  users: 'Benutzer'
7
-
7
+
8
8
  attributes:
9
9
  user:
10
10
  admin: 'Administrator'
@@ -20,8 +20,6 @@ de:
20
20
  create_account: 'Nutzerkonto erstellen'
21
21
  disable_admin: 'löschen'
22
22
  enable_admin: 'erstellen'
23
- email_validation_subject: "Email validation"
24
- email_validation_instructions: "To confirm your email address, please visit this link: %{reset_url} and create your password \n\nIf you did not wish to create a new account with us, please ignore this email."
25
23
  forgot_password: "Kennwort vergessen?"
26
24
  login_confirmation: "Du bist eingelogged!"
27
25
  login_now: "einloggen"
@@ -48,5 +46,5 @@ de:
48
46
  email_or_password_invalid: "Email oder Kennwort ungültig"
49
47
  login_needed: "Du musst dich einloggen um auf diese Seite zuzugreifen. Du wurdest zum Login umgeleitet."
50
48
  no_such_email: "Es gibt kein Nutzerkonto mit dieser Email-Adresse."
51
- password_reset_expired: "Das Zurücksetzen des Kennworts ist abgelaufen. Dies war nur für 2 Stunden möglich"
49
+ password_reset_expired: "Das Zurücksetzen des Kennworts ist abgelaufen. Dies war nur für 24 Stunden möglich"
52
50
  restricted_access: "Diese Sektion ist nur für Administratoren zugänglich. Kontaktiere den Inhaber der Webseite, wenn du Administrator-Rechte erhalten möchtest."
@@ -1,10 +1,10 @@
1
1
  en:
2
-
2
+
3
3
  activerecord:
4
4
  models:
5
5
  user: 'user'
6
6
  users: 'users'
7
-
7
+
8
8
  attributes:
9
9
  user:
10
10
  admin: 'admin' # admin is short for administrator. put full word if necessary
@@ -19,9 +19,7 @@ en:
19
19
  admin_enabled_confirmation: 'you have empowered this user to be an administrator'
20
20
  create_account: 'create an account'
21
21
  disable_admin: 'disable'
22
- enable_admin: 'enable'
23
- email_validation_subject: "Email validation"
24
- email_validation_instructions: "To confirm your email address, please visit this link: %{reset_url} and create your password \n\nIf you did not wish to create a new account with us, please ignore this email."
22
+ enable_admin: 'enable'
25
23
  forgot_password: "forgot your password?"
26
24
  login_confirmation: "You have been logged in!"
27
25
  login_now: "log in"
@@ -48,33 +46,33 @@ en:
48
46
  email_or_password_invalid: "Email or password is invalid"
49
47
  login_needed: "You must be logged in to access this page. You have been redirected to the login form."
50
48
  no_such_email: "We do not have any accounts with the email you have provided."
51
- password_reset_expired: "Password reset has expired. There was a 2 hours grace period"
49
+ password_reset_expired: "Password reset has expired. There was a 24 hours grace period"
52
50
  restricted_access: "This section is reserved to the site's administrators. Contact the site owner if you would like access to be granted to you."
53
-
54
-
51
+
52
+
55
53
  # leaving these until I have used up all the ones I need.
56
- access_control:
57
- already_signed_up_message: "You already have a La Source account. Please login to your existing account."
54
+ access_control:
55
+ already_signed_up_message: "You already have a La Source account. Please login to your existing account."
58
56
  email_hint: This address will be used as your login id
59
57
  email_must_be_valid: Please enter a valid email address before submitting
60
-
61
-
58
+
59
+
62
60
  have_an_account: 'have an account?'
63
61
  hello: hello
64
62
  hello_name: "Hi %{name},"
65
63
  invalid_email_or_password: "Invalid email or password. Please double check your data, modify it, and resubmit the form"
66
64
  login: "log in"
67
-
68
-
65
+
66
+
69
67
  login_now_in_text: log in here
70
-
71
-
68
+
69
+
72
70
  my_profile: 'my profile'
73
71
  new_password: New Password
74
72
  new_password_confirmation: New Password confirmation
75
73
 
76
74
  not_authorized_alert: "You are not authorized to access this page. You have been redirected to the home page."
77
-
75
+
78
76
  or: "or"
79
77
  password: password
80
78
  password_confirmation: password confirmation
@@ -86,10 +84,10 @@ en:
86
84
  phone_entry_request: "If enrolling in a course, we would appreciate at least one phone number."
87
85
  please_log_in: Please log in to see your personal information.
88
86
  remember_me: "stay logged in"
89
-
90
-
87
+
88
+
91
89
  signup: "create an account"
92
-
90
+
93
91
  signup_now: "create an account"
94
92
 
95
- valid_email_needed: 'Please enter a valid email address'
93
+ valid_email_needed: 'Please enter a valid email address'
@@ -1,10 +1,10 @@
1
1
  es:
2
-
2
+
3
3
  activerecord:
4
4
  models:
5
5
  user: 'user'
6
6
  users: 'users'
7
-
7
+
8
8
  attributes:
9
9
  user:
10
10
  first_name: "nombre de pila"
@@ -12,15 +12,13 @@ es:
12
12
  email: "email"
13
13
  password: 'contraseña'
14
14
  password_confirmation: 'confirmar contraseña'
15
-
15
+
16
16
  authentication:
17
17
  admin_disabled_confirmation: "Este usuario no es un administrador"
18
18
  admin_enabled_confirmation: 'Este usuario es ahora un administrador'
19
19
  create_account: 'crea tu cuenta'
20
20
  disable_admin: 'eliminar el poder'
21
21
  enable_admin: 'autorizar'
22
- email_validation_subject: "Email validation"
23
- email_validation_instructions: "To confirm your email address, please visit this link: %{reset_url} and create your password \n\nIf you did not wish to create a new account with us, please ignore this email."
24
22
  forgot_password: '¿olvidaste tu contraseña?'
25
23
  login_confirmation: 'Conectado con éxito'
26
24
  login_now: "conectar"
@@ -47,5 +45,5 @@ es:
47
45
  email_or_password_invalid: 'Correo electrónico o contraseña no válidos'
48
46
  login_needed: 'Tienes que estar conectado para acceder a esta pagina. Te redirijimos al formulario para conectar.'
49
47
  no_such_email: 'No existe ninguna cuenta con el correo electronico que nos has proporcionado.'
50
- password_reset_expired: 'El reestablecimiento de la contraseña ha caducado. Tienes 2 horas para intentarlo otra vez.'
51
- restricted_access: "Esta parte del sitio está reservado para los administradores. Por favor, pedir permiso al propietario del sitio."
48
+ password_reset_expired: 'El reestablecimiento de la contraseña ha caducado. Tienes 24 horas para intentarlo otra vez.'
49
+ restricted_access: "Esta parte del sitio está reservado para los administradores. Por favor, pedir permiso al propietario del sitio."
@@ -1,10 +1,10 @@
1
1
  fr:
2
-
2
+
3
3
  activerecord:
4
4
  models:
5
5
  user: 'utilisateur'
6
6
  users: 'les utilisateurs'
7
-
7
+
8
8
  attributes:
9
9
  user:
10
10
  admin: 'administrateur' # admin is short for administrator. put full word if necessary
@@ -13,15 +13,13 @@ fr:
13
13
  email: "courriel"
14
14
  password: 'mot de passe'
15
15
  password_confirmation: 'confirmation de mot de passe'
16
-
16
+
17
17
  authentication:
18
18
  admin_disabled_confirmation: "cet utilisateur n'est plus un administrateur"
19
19
  admin_enabled_confirmation: 'cet utilisateur est maintenant un administrateur'
20
20
  create_account: 'créez un compte'
21
21
  disable_admin: 'enlever le pouvoir'
22
22
  enable_admin: 'donner le pouvoir'
23
- email_validation_subject: "Vérification de votre adresse email"
24
- email_validation_instructions: "Pour confirmer votre adresse email, veuillez accéder cette page web et créer un mot de passe : %{reset_url}\n\nSi vous ne désirez pas créer un compte sur notre site, veuillez ignorer cet email."
25
23
  forgot_password: "avez vous oublié votre mot de passe ?"
26
24
  login_confirmation: "Merci de vous être identifié !"
27
25
  login_now: "identifiez-vous"
@@ -49,40 +47,40 @@ fr:
49
47
  no_such_email: "Désolé nous n'avons pas d'utilisateur avec cette adresse email"
50
48
  password_reset_expired: "Votre mot de passe n'a pu être réinitialisé car votre demande date de plus de 24 heures."
51
49
  restricted_access: "Cette partie du site est réservée aux administrateurs. Veuillez demander l'autorisation au propriétaire du site."
52
-
53
-
54
-
50
+
51
+
52
+
55
53
  # leaving these until I have used up all the ones I need.
56
- access_control:
54
+ access_control:
57
55
  already_signed_up_message: "Vous avez déjà un compte La Source. Veuillez vous identifier avec ce compte existant."
58
-
56
+
59
57
  email_hint: Cette adresse sera votre identifiant
60
58
  email_must_be_valid: Vous devez entrer une adresse courriel avant d'envoyer votre demande
61
59
 
62
-
60
+
63
61
  have_an_account: 'vous avez un compte ?'
64
62
  hello: bonjour
65
63
  hello_name: "Bonjour %{name} ,"
66
64
  invalid_email_or_password: "Erreur d'email ou de mot de passe. Veuillez vérifier vos données, les corriger et essayer à nouveau."
67
65
  login: "s'identifier"
68
-
69
-
66
+
67
+
70
68
  login_now_in_text: vous identifier
71
69
 
72
-
70
+
73
71
  my_profile: 'mon profil'
74
72
  new_password: Nouveau mot de passe
75
73
  new_password_confirmation: Confirmation du nouveau mot de passe
76
-
74
+
77
75
  not_authorized_alert: "Vous n'avez pas l'autorization d'acceder cette page. Vous avez été redirigé sur la page d'accueil."
78
-
76
+
79
77
  or: ou
80
78
  password: mot de passe
81
79
  password_confirmation: confirmation du mot de passe
82
80
 
83
-
81
+
84
82
  password_must_match_confirmation: 'Le mot de passe et sa confirmation doivent être identiques'
85
- password_on_its_way: "Nous avons crée votre nouveau mot de passe et vous devriez le recevoir dans les 2 heures qui suivent à cette adresse : %{email_address}."
83
+ password_on_its_way: "Nous avons crée votre nouveau mot de passe et vous devriez le recevoir dans les 24 heures qui suivent à cette adresse : %{email_address}."
86
84
  password_reset: Réinitialisation du mot de passe
87
85
  please_log_in: Veuillez vous identifier pour voir votre information personnalisée.
88
86
  phone_entry_request: "Si vous joignez un cours, nous vous serions reconnaissant de nous fournir au moins un numéro de téléphone."
@@ -90,7 +88,7 @@ fr:
90
88
  reset_instructions: "Pour réinitialiser votre mot de passe, cliquez sur le lien en-dessous :"
91
89
  reset_instructions2: "Si vous n’avez pas demandé la réinitialisation de votre mot de passe, veuillez ignorer ce courriel. Votre mot de passe restera le même."
92
90
  signup: "créer un compte"
93
-
91
+
94
92
  signup_now: "créez un compte"
95
-
96
- valid_email_needed: 'Veuillez nous fournir votre adresse email'
93
+
94
+ valid_email_needed: 'Veuillez nous fournir votre adresse email'
@@ -1,10 +1,10 @@
1
1
  it:
2
-
2
+
3
3
  activerecord:
4
4
  models:
5
5
  user: 'user'
6
6
  users: 'users'
7
-
7
+
8
8
  attributes:
9
9
  user:
10
10
  first_name: "first name"
@@ -18,9 +18,7 @@ it:
18
18
  admin_enabled_confirmation: 'you have empowered this user to be an administrator'
19
19
  create_account: 'create an account'
20
20
  disable_admin: 'disable'
21
- enable_admin: 'enable'
22
- email_validation_subject: "Email validation"
23
- email_validation_instructions: "To confirm your email address, please visit this link: %{reset_url} and create your password \n\nIf you did not wish to create a new account with us, please ignore this email."
21
+ enable_admin: 'enable'
24
22
  forgot_password: "forgot your password?"
25
23
  login_confirmation: "You have been logged in!"
26
24
  login_now: "log in"
@@ -47,6 +45,6 @@ it:
47
45
  email_or_password_invalid: "Email or password is invalid"
48
46
  login_needed: "You must be logged in to access this page. You have been redirected to the login form."
49
47
  no_such_email: "We do not have any accounts with the email you have provided."
50
- password_reset_expired: "Password reset has expired. There was a 2 hours grace period"
48
+ password_reset_expired: "Password reset has expired. There was a 24 hours grace period"
51
49
  restricted_access: "This section is reserved to the site's administrators. Contact the site owner if you would like access to be granted to you."
52
-
50
+
@@ -4,10 +4,10 @@ namespace :tkh_authentication do
4
4
  system 'rails g tkh_authentication:create_or_update_migrations'
5
5
  system 'rails g tkh_authentication:create_or_update_locales -f'
6
6
  end
7
-
7
+
8
8
  desc "Update files. Skip existing migrations. Force overwrite locales"
9
9
  task :update do
10
10
  system 'rails g tkh_authentication:create_or_update_migrations -s'
11
11
  system 'rails g tkh_authentication:create_or_update_locales -f'
12
12
  end
13
- end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module TkhAuthentication
2
- VERSION = "0.1.11"
2
+ VERSION = "0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: '0.9'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swami Atma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-05 00:00:00.000000000 Z
11
+ date: 2013-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,68 +16,68 @@ dependencies:
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '3.2'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bcrypt-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: 3.1.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '3.0'
40
+ version: 3.1.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: simple_form
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: 3.0.0.rc
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: 3.0.0.rc
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: stringex
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sqlite3
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: A Rails engine for access control authentication customized for Ten Thousand
@@ -92,20 +92,16 @@ files:
92
92
  - app/controllers/sessions_controller.rb
93
93
  - app/controllers/users_controller.rb
94
94
  - app/mailers/user_mailer.rb
95
- - app/models/newbie.rb
96
95
  - app/models/user.rb
97
96
  - app/views/password_resets/edit.html.erb
98
97
  - app/views/password_resets/new.html.erb
99
98
  - app/views/sessions/_form.html.erb
100
99
  - app/views/sessions/new.html.erb
101
- - app/views/shared/_embedded_access_control.html.erb
102
100
  - app/views/shared/_embedded_login_module.html.erb
103
101
  - app/views/shared/_login_info.html.erb
104
102
  - app/views/shared/_login_info_for_navbar.html.erb
105
103
  - app/views/shared/_login_info_for_sidebar.html.erb
106
104
  - app/views/user_mailer/password_reset.text.erb
107
- - app/views/user_mailer/password_set.text.erb
108
- - app/views/users/_detect_user_existence_form.html.erb
109
105
  - app/views/users/_form.html.erb
110
106
  - app/views/users/index.html.erb
111
107
  - app/views/users/new.html.erb
@@ -167,12 +163,12 @@ require_paths:
167
163
  - lib
168
164
  required_ruby_version: !ruby/object:Gem::Requirement
169
165
  requirements:
170
- - - ! '>='
166
+ - - '>='
171
167
  - !ruby/object:Gem::Version
172
168
  version: '0'
173
169
  required_rubygems_version: !ruby/object:Gem::Requirement
174
170
  requirements:
175
- - - ! '>='
171
+ - - '>='
176
172
  - !ruby/object:Gem::Version
177
173
  version: '0'
178
174
  requirements: []
data/app/models/newbie.rb DELETED
@@ -1,12 +0,0 @@
1
- class Newbie < User
2
-
3
- def send_password_set
4
- generate_token(:password_reset_token)
5
- self.password_reset_sent_at = Time.zone.now
6
- # necessary to pass has_secure_password validations
7
- self.password, self.password_confirmation = 'temporary', 'temporary'
8
- save!
9
- UserMailer.password_set(self).deliver
10
- end
11
-
12
- end
@@ -1,4 +0,0 @@
1
- <div class="embedded-access-control">
2
- <%= render 'users/detect_user_existence_form', user: (current_user || User.new) %>
3
- </div>
4
-
@@ -1 +0,0 @@
1
- <%= t 'authentication.email_validation_instructions', reset_url: edit_password_reset_url(@user.password_reset_token, locale: I18n.locale) %>
@@ -1,11 +0,0 @@
1
- <%= simple_form_for user, url: detect_existence_users_path do |f| %>
2
- <%= f.error_notification %>
3
-
4
- <div class="form-inputs">
5
- <%= f.input :email %>
6
- </div>
7
-
8
- <div class="form-actions">
9
- <%= f.button :submit, value: 'proceed', :class => 'btn btn-primary' %>
10
- </div>
11
- <% end %>