tkh_authentication 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/app/controllers/password_resets_controller.rb +12 -4
- data/app/controllers/sessions_controller.rb +10 -4
- data/app/controllers/users_controller.rb +33 -9
- data/app/mailers/user_mailer.rb +8 -3
- data/app/models/newbie.rb +12 -0
- data/app/models/user.rb +10 -8
- data/app/views/password_resets/edit.html.erb +4 -1
- data/app/views/sessions/_form.html.erb +5 -6
- data/app/views/shared/_embedded_access_control.html.erb +4 -0
- data/app/views/shared/_login_info_for_navbar.html.erb +14 -6
- data/app/views/user_mailer/password_set.text.erb +1 -0
- data/app/views/users/_detect_user_existence_form.html.erb +11 -0
- data/app/views/users/index.html.erb +2 -0
- data/config/routes.rb +2 -1
- data/lib/generators/tkh_authentication/create_or_update_locales/templates/de.yml +5 -3
- data/lib/generators/tkh_authentication/create_or_update_locales/templates/en.yml +21 -19
- data/lib/generators/tkh_authentication/create_or_update_locales/templates/es.yml +7 -5
- data/lib/generators/tkh_authentication/create_or_update_locales/templates/fr.yml +21 -19
- data/lib/generators/tkh_authentication/create_or_update_locales/templates/it.yml +7 -5
- data/lib/tasks/tkh_authentication_tasks.rake +2 -2
- data/lib/tkh_authentication/version.rb +1 -1
- metadata +31 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6447b44c0f5ec6faf90612f3aa9f2699c0e5d367
|
4
|
+
data.tar.gz: 5a096e8728434da167fd31c8a0ac1b74e17ab9ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f4bf1b128d359322d248c5a9f4c9038e0b3f86d869f40b357221dc22091d76f78b3f24f5a251290926492a2a9f3266b496168a636c8297e305304c1d8832bf2
|
7
|
+
data.tar.gz: 1b74b75b06caaab4aa8d81d37cc825fd36ea7808ee9bf6e9a429f9dbbe5f72c959879db090bc89d8d107aa76a630306b1d0e06d713493b31a26c4fc6be64c52d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## 0.9.3
|
6
|
+
|
7
|
+
* Various fixes and tweaks related to the Rails 4 upgrade
|
8
|
+
* Added other_name attribute to user model
|
9
|
+
* Added edit feature to user resource
|
10
|
+
* Started to change the flow of user creation. Will eventually confirm email and be ajaxified.
|
11
|
+
|
12
|
+
|
5
13
|
## 0.9
|
6
14
|
|
7
15
|
* Upgraded gem to Rails 4
|
@@ -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,13 +16,21 @@ 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 <
|
19
|
+
if @user.password_reset_sent_at < 2.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
|
-
|
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
|
23
25
|
else
|
24
26
|
render :edit
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
28
|
-
|
30
|
+
private
|
31
|
+
|
32
|
+
def destroy_target_page
|
33
|
+
session[:target_page] = nil
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
@@ -1,12 +1,13 @@
|
|
1
1
|
class SessionsController < ApplicationController
|
2
2
|
|
3
3
|
def new
|
4
|
+
set_target_page
|
4
5
|
redirect_to root_path if current_user
|
5
6
|
end
|
6
7
|
|
7
8
|
def create
|
8
|
-
user = User.find_by_email(params[:email])
|
9
9
|
set_target_page
|
10
|
+
user = User.find_by_email(params[:email])
|
10
11
|
if user && user.authenticate(params[:password])
|
11
12
|
if params[:remember_me]
|
12
13
|
cookies.permanent[:auth_token] = user.auth_token
|
@@ -14,7 +15,7 @@ class SessionsController < ApplicationController
|
|
14
15
|
cookies[:auth_token] = user.auth_token
|
15
16
|
end
|
16
17
|
redirect_to (session[:target_page] || safe_root_url), notice: t('authentication.login_confirmation')
|
17
|
-
|
18
|
+
destroy_target_page
|
18
19
|
else
|
19
20
|
flash.now.alert = t('authentication.warning.email_or_password_invalid')
|
20
21
|
render "new"
|
@@ -23,13 +24,18 @@ class SessionsController < ApplicationController
|
|
23
24
|
|
24
25
|
def destroy
|
25
26
|
cookies.delete(:auth_token)
|
27
|
+
destroy_target_page
|
26
28
|
redirect_to safe_root_url, notice: t('authentication.logout_confirmation')
|
27
29
|
end
|
28
|
-
|
30
|
+
|
29
31
|
private
|
30
|
-
|
32
|
+
|
31
33
|
def set_target_page
|
32
34
|
session[:target_page] = request.referer unless session[:target_page] # && !request.referer.nil?
|
33
35
|
end
|
34
36
|
|
37
|
+
def destroy_target_page
|
38
|
+
session[:target_page] = nil
|
39
|
+
end
|
40
|
+
|
35
41
|
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']
|
5
|
-
|
4
|
+
before_filter :authenticate_with_admin, except: ['new', 'create', 'detect_existence']
|
5
|
+
|
6
6
|
def index
|
7
7
|
@users = User.by_recent
|
8
8
|
render layout: 'admin'
|
@@ -13,7 +13,7 @@ class UsersController < ApplicationController
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def create
|
16
|
-
@user = User.new(
|
16
|
+
@user = User.new(user_params)
|
17
17
|
set_target_page
|
18
18
|
if @user.save
|
19
19
|
cookies[:auth_token] = @user.auth_token # logging in the user
|
@@ -23,25 +23,49 @@ class UsersController < ApplicationController
|
|
23
23
|
render "new"
|
24
24
|
end
|
25
25
|
end
|
26
|
-
|
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
|
+
|
27
46
|
def make_admin
|
28
47
|
user = User.find(params[:id])
|
29
48
|
user.admin = true
|
30
49
|
user.save
|
31
50
|
redirect_to users_path, notice: t('authentication.admin_enabled_confirmation')
|
32
51
|
end
|
33
|
-
|
52
|
+
|
34
53
|
def remove_admin
|
35
54
|
user = User.find(params[:id])
|
36
55
|
user.admin = false
|
37
56
|
user.save
|
38
57
|
redirect_to users_path, notice: t('authentication.admin_disabled_confirmation')
|
39
58
|
end
|
40
|
-
|
59
|
+
|
41
60
|
private
|
42
|
-
|
61
|
+
|
43
62
|
def set_target_page
|
44
63
|
session[:target_page] = request.referer unless session[:target_page] # && !request.referer.nil?
|
45
64
|
end
|
46
|
-
|
65
|
+
|
66
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
67
|
+
def user_params
|
68
|
+
params.require(:user).permit :email, :password, :password_confirmation, :first_name, :last_name, :other_name
|
69
|
+
end
|
70
|
+
|
47
71
|
end
|
data/app/mailers/user_mailer.rb
CHANGED
@@ -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,9 +7,14 @@ 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
|
-
|
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
|
@@ -0,0 +1,12 @@
|
|
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
|
data/app/models/user.rb
CHANGED
@@ -4,19 +4,22 @@ 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
|
7
|
+
has_many :comments, :dependent => :destroy, foreign_key: 'author_id'
|
8
8
|
|
9
9
|
# not allowed are :admin:boolean, :auth_token:string, password_reset_token:string, password_reset_sent_at:datetime
|
10
|
-
attr_accessible :email, :password, :password_confirmation, :first_name, :last_name, :other_name
|
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
|
-
validates_presence_of :first_name
|
16
|
-
validates_presence_of :last_name
|
14
|
+
# validates_presence_of :password, on: :create
|
17
15
|
|
18
|
-
|
19
|
-
|
16
|
+
# TODO - this needs to be somehow integrated in the click flow
|
17
|
+
# validates_presence_of :first_name
|
18
|
+
# validates_presence_of :last_name
|
19
|
+
|
20
|
+
scope :alphabetically, -> { order('last_name, first_name') }
|
21
|
+
scope :administrators, -> { where('admin = ?', true) }
|
22
|
+
scope :by_recent, -> { order('updated_at desc') }
|
20
23
|
|
21
24
|
before_create { generate_token(:auth_token) }
|
22
25
|
|
@@ -25,7 +28,6 @@ class User < ActiveRecord::Base
|
|
25
28
|
"#{id}-#{name.to_url}"
|
26
29
|
end
|
27
30
|
|
28
|
-
scope :by_recent, :order => 'updated_at desc'
|
29
31
|
|
30
32
|
def name
|
31
33
|
"#{first_name} #{last_name}".strip
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<%= form_tag sessions_path, class: 'simple_form form-horizontal' do %>
|
2
2
|
|
3
3
|
<div class="form-inputs">
|
4
|
-
|
5
4
|
<div class="control-group email required">
|
6
5
|
<%= label_tag :email, t('activerecord.attributes.user.email'), class: "email required control-label" %>
|
7
6
|
<div class="controls">
|
@@ -9,7 +8,7 @@
|
|
9
8
|
<p class="help-block"><%= link_to t('authentication.not_registered'), signup_path %></p>
|
10
9
|
</div>
|
11
10
|
</div>
|
12
|
-
|
11
|
+
|
13
12
|
<div class="control-group password required">
|
14
13
|
<%= label_tag :password, t('activerecord.attributes.user.password'), class: "password required control-label" %>
|
15
14
|
<div class="controls">
|
@@ -23,11 +22,11 @@
|
|
23
22
|
<label class="checkbox"><input class="boolean optional" id="remember_me" name="remember_me" type="checkbox" value="1" /><%= t('authentication.remember_me') %></label>
|
24
23
|
</div>
|
25
24
|
</div>
|
26
|
-
|
25
|
+
|
27
26
|
</div>
|
28
|
-
|
27
|
+
|
29
28
|
<div class="form-actions">
|
30
29
|
<%= submit_tag t('authentication.login_now'), class: 'btn btn-primary' %>
|
31
30
|
</div>
|
32
|
-
|
33
|
-
<% end %>
|
31
|
+
|
32
|
+
<% end %>
|
@@ -1,6 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
<% if current_user %>
|
2
|
+
<ul class="nav navbar-nav navbar-right">
|
3
|
+
<li class='dropdown'>
|
4
|
+
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%= current_user.email %> <b class="caret"></b></a>
|
5
|
+
<ul class="dropdown-menu">
|
6
|
+
<%= content_tag :li, link_to(t('logout'), logout_path) %>
|
7
|
+
</ul>
|
8
|
+
</li>
|
9
|
+
</ul>
|
10
|
+
<% else %>
|
11
|
+
<ul class="nav navbar-nav navbar-right">
|
12
|
+
<%= content_tag :li, link_to(t('authentication.login_now'), login_path) %>
|
13
|
+
</ul>
|
14
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= t 'authentication.email_validation_instructions', reset_url: edit_password_reset_url(@user.password_reset_token, locale: I18n.locale) %>
|
@@ -0,0 +1,11 @@
|
|
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 %>
|
@@ -8,6 +8,7 @@
|
|
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>
|
11
12
|
</tr>
|
12
13
|
</thead>
|
13
14
|
|
@@ -23,6 +24,7 @@
|
|
23
24
|
<span class="label label-success">✓</span> <%= link_to t('authentication.disable_admin'), remove_admin_user_path(user), class: 'btn btn-mini', method: :post %>
|
24
25
|
<% end -%>
|
25
26
|
</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>
|
26
28
|
</tr>
|
27
29
|
<% end %>
|
28
30
|
</tbody>
|
data/config/routes.rb
CHANGED
@@ -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,6 +20,8 @@ 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."
|
23
25
|
forgot_password: "Kennwort vergessen?"
|
24
26
|
login_confirmation: "Du bist eingelogged!"
|
25
27
|
login_now: "einloggen"
|
@@ -46,5 +48,5 @@ de:
|
|
46
48
|
email_or_password_invalid: "Email oder Kennwort ungültig"
|
47
49
|
login_needed: "Du musst dich einloggen um auf diese Seite zuzugreifen. Du wurdest zum Login umgeleitet."
|
48
50
|
no_such_email: "Es gibt kein Nutzerkonto mit dieser Email-Adresse."
|
49
|
-
password_reset_expired: "Das Zurücksetzen des Kennworts ist abgelaufen. Dies war nur für
|
51
|
+
password_reset_expired: "Das Zurücksetzen des Kennworts ist abgelaufen. Dies war nur für 2 Stunden möglich"
|
50
52
|
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,7 +19,9 @@ 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'
|
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."
|
23
25
|
forgot_password: "forgot your password?"
|
24
26
|
login_confirmation: "You have been logged in!"
|
25
27
|
login_now: "log in"
|
@@ -46,33 +48,33 @@ en:
|
|
46
48
|
email_or_password_invalid: "Email or password is invalid"
|
47
49
|
login_needed: "You must be logged in to access this page. You have been redirected to the login form."
|
48
50
|
no_such_email: "We do not have any accounts with the email you have provided."
|
49
|
-
password_reset_expired: "Password reset has expired. There was a
|
51
|
+
password_reset_expired: "Password reset has expired. There was a 2 hours grace period"
|
50
52
|
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."
|
51
|
-
|
52
|
-
|
53
|
+
|
54
|
+
|
53
55
|
# leaving these until I have used up all the ones I need.
|
54
|
-
access_control:
|
55
|
-
already_signed_up_message: "You already have a La Source account. Please login to your existing account."
|
56
|
+
access_control:
|
57
|
+
already_signed_up_message: "You already have a La Source account. Please login to your existing account."
|
56
58
|
email_hint: This address will be used as your login id
|
57
59
|
email_must_be_valid: Please enter a valid email address before submitting
|
58
|
-
|
59
|
-
|
60
|
+
|
61
|
+
|
60
62
|
have_an_account: 'have an account?'
|
61
63
|
hello: hello
|
62
64
|
hello_name: "Hi %{name},"
|
63
65
|
invalid_email_or_password: "Invalid email or password. Please double check your data, modify it, and resubmit the form"
|
64
66
|
login: "log in"
|
65
|
-
|
66
|
-
|
67
|
+
|
68
|
+
|
67
69
|
login_now_in_text: log in here
|
68
|
-
|
69
|
-
|
70
|
+
|
71
|
+
|
70
72
|
my_profile: 'my profile'
|
71
73
|
new_password: New Password
|
72
74
|
new_password_confirmation: New Password confirmation
|
73
75
|
|
74
76
|
not_authorized_alert: "You are not authorized to access this page. You have been redirected to the home page."
|
75
|
-
|
77
|
+
|
76
78
|
or: "or"
|
77
79
|
password: password
|
78
80
|
password_confirmation: password confirmation
|
@@ -84,10 +86,10 @@ en:
|
|
84
86
|
phone_entry_request: "If enrolling in a course, we would appreciate at least one phone number."
|
85
87
|
please_log_in: Please log in to see your personal information.
|
86
88
|
remember_me: "stay logged in"
|
87
|
-
|
88
|
-
|
89
|
+
|
90
|
+
|
89
91
|
signup: "create an account"
|
90
|
-
|
92
|
+
|
91
93
|
signup_now: "create an account"
|
92
94
|
|
93
|
-
valid_email_needed: 'Please enter a valid email address'
|
95
|
+
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,13 +12,15 @@ 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."
|
22
24
|
forgot_password: '¿olvidaste tu contraseña?'
|
23
25
|
login_confirmation: 'Conectado con éxito'
|
24
26
|
login_now: "conectar"
|
@@ -45,5 +47,5 @@ es:
|
|
45
47
|
email_or_password_invalid: 'Correo electrónico o contraseña no válidos'
|
46
48
|
login_needed: 'Tienes que estar conectado para acceder a esta pagina. Te redirijimos al formulario para conectar.'
|
47
49
|
no_such_email: 'No existe ninguna cuenta con el correo electronico que nos has proporcionado.'
|
48
|
-
password_reset_expired: 'El reestablecimiento de la contraseña ha caducado. Tienes
|
49
|
-
restricted_access: "Esta parte del sitio está reservado para los administradores. Por favor, pedir permiso al propietario del sitio."
|
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."
|
@@ -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,13 +13,15 @@ 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."
|
23
25
|
forgot_password: "avez vous oublié votre mot de passe ?"
|
24
26
|
login_confirmation: "Merci de vous être identifié !"
|
25
27
|
login_now: "identifiez-vous"
|
@@ -47,40 +49,40 @@ fr:
|
|
47
49
|
no_such_email: "Désolé nous n'avons pas d'utilisateur avec cette adresse email"
|
48
50
|
password_reset_expired: "Votre mot de passe n'a pu être réinitialisé car votre demande date de plus de 24 heures."
|
49
51
|
restricted_access: "Cette partie du site est réservée aux administrateurs. Veuillez demander l'autorisation au propriétaire du site."
|
50
|
-
|
51
|
-
|
52
|
-
|
52
|
+
|
53
|
+
|
54
|
+
|
53
55
|
# leaving these until I have used up all the ones I need.
|
54
|
-
access_control:
|
56
|
+
access_control:
|
55
57
|
already_signed_up_message: "Vous avez déjà un compte La Source. Veuillez vous identifier avec ce compte existant."
|
56
|
-
|
58
|
+
|
57
59
|
email_hint: Cette adresse sera votre identifiant
|
58
60
|
email_must_be_valid: Vous devez entrer une adresse courriel avant d'envoyer votre demande
|
59
61
|
|
60
|
-
|
62
|
+
|
61
63
|
have_an_account: 'vous avez un compte ?'
|
62
64
|
hello: bonjour
|
63
65
|
hello_name: "Bonjour %{name} ,"
|
64
66
|
invalid_email_or_password: "Erreur d'email ou de mot de passe. Veuillez vérifier vos données, les corriger et essayer à nouveau."
|
65
67
|
login: "s'identifier"
|
66
|
-
|
67
|
-
|
68
|
+
|
69
|
+
|
68
70
|
login_now_in_text: vous identifier
|
69
71
|
|
70
|
-
|
72
|
+
|
71
73
|
my_profile: 'mon profil'
|
72
74
|
new_password: Nouveau mot de passe
|
73
75
|
new_password_confirmation: Confirmation du nouveau mot de passe
|
74
|
-
|
76
|
+
|
75
77
|
not_authorized_alert: "Vous n'avez pas l'autorization d'acceder cette page. Vous avez été redirigé sur la page d'accueil."
|
76
|
-
|
78
|
+
|
77
79
|
or: ou
|
78
80
|
password: mot de passe
|
79
81
|
password_confirmation: confirmation du mot de passe
|
80
82
|
|
81
|
-
|
83
|
+
|
82
84
|
password_must_match_confirmation: 'Le mot de passe et sa confirmation doivent être identiques'
|
83
|
-
password_on_its_way: "Nous avons crée votre nouveau mot de passe et vous devriez le recevoir dans les
|
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}."
|
84
86
|
password_reset: Réinitialisation du mot de passe
|
85
87
|
please_log_in: Veuillez vous identifier pour voir votre information personnalisée.
|
86
88
|
phone_entry_request: "Si vous joignez un cours, nous vous serions reconnaissant de nous fournir au moins un numéro de téléphone."
|
@@ -88,7 +90,7 @@ fr:
|
|
88
90
|
reset_instructions: "Pour réinitialiser votre mot de passe, cliquez sur le lien en-dessous :"
|
89
91
|
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."
|
90
92
|
signup: "créer un compte"
|
91
|
-
|
93
|
+
|
92
94
|
signup_now: "créez un compte"
|
93
|
-
|
94
|
-
valid_email_needed: 'Veuillez nous fournir votre adresse email'
|
95
|
+
|
96
|
+
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,7 +18,9 @@ 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'
|
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."
|
22
24
|
forgot_password: "forgot your password?"
|
23
25
|
login_confirmation: "You have been logged in!"
|
24
26
|
login_now: "log in"
|
@@ -45,6 +47,6 @@ it:
|
|
45
47
|
email_or_password_invalid: "Email or password is invalid"
|
46
48
|
login_needed: "You must be logged in to access this page. You have been redirected to the login form."
|
47
49
|
no_such_email: "We do not have any accounts with the email you have provided."
|
48
|
-
password_reset_expired: "Password reset has expired. There was a
|
50
|
+
password_reset_expired: "Password reset has expired. There was a 2 hours grace period"
|
49
51
|
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."
|
50
|
-
|
52
|
+
|
@@ -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
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tkh_authentication
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swami Atma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
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
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.1.
|
33
|
+
version: 3.1.2
|
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.1.
|
40
|
+
version: 3.1.2
|
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: 3.0.
|
47
|
+
version: 3.0.1
|
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: 3.0.
|
54
|
+
version: 3.0.1
|
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
|
@@ -88,20 +88,28 @@ executables: []
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
+
- CHANGELOG.md
|
92
|
+
- MIT-LICENSE
|
93
|
+
- README.md
|
94
|
+
- Rakefile
|
91
95
|
- app/controllers/password_resets_controller.rb
|
92
96
|
- app/controllers/sessions_controller.rb
|
93
97
|
- app/controllers/users_controller.rb
|
94
98
|
- app/mailers/user_mailer.rb
|
99
|
+
- app/models/newbie.rb
|
95
100
|
- app/models/user.rb
|
96
101
|
- app/views/password_resets/edit.html.erb
|
97
102
|
- app/views/password_resets/new.html.erb
|
98
103
|
- app/views/sessions/_form.html.erb
|
99
104
|
- app/views/sessions/new.html.erb
|
105
|
+
- app/views/shared/_embedded_access_control.html.erb
|
100
106
|
- app/views/shared/_embedded_login_module.html.erb
|
101
107
|
- app/views/shared/_login_info.html.erb
|
102
108
|
- app/views/shared/_login_info_for_navbar.html.erb
|
103
109
|
- app/views/shared/_login_info_for_sidebar.html.erb
|
104
110
|
- app/views/user_mailer/password_reset.text.erb
|
111
|
+
- app/views/user_mailer/password_set.text.erb
|
112
|
+
- app/views/users/_detect_user_existence_form.html.erb
|
105
113
|
- app/views/users/_form.html.erb
|
106
114
|
- app/views/users/index.html.erb
|
107
115
|
- app/views/users/new.html.erb
|
@@ -116,19 +124,18 @@ files:
|
|
116
124
|
- lib/generators/tkh_authentication/create_or_update_migrations/templates/add_other_name_to_users.rb
|
117
125
|
- lib/generators/tkh_authentication/create_or_update_migrations/templates/create_users.rb
|
118
126
|
- lib/tasks/tkh_authentication_tasks.rake
|
127
|
+
- lib/tkh_authentication.rb
|
119
128
|
- lib/tkh_authentication/tkh_authentication_action_controller_extension.rb
|
120
129
|
- lib/tkh_authentication/tkh_authentication_helper.rb
|
121
130
|
- lib/tkh_authentication/version.rb
|
122
|
-
-
|
123
|
-
-
|
124
|
-
- Rakefile
|
125
|
-
- README.md
|
126
|
-
- CHANGELOG.md
|
131
|
+
- test/dummy/README.rdoc
|
132
|
+
- test/dummy/Rakefile
|
127
133
|
- test/dummy/app/assets/javascripts/application.js
|
128
134
|
- test/dummy/app/assets/stylesheets/application.css
|
129
135
|
- test/dummy/app/controllers/application_controller.rb
|
130
136
|
- test/dummy/app/helpers/application_helper.rb
|
131
137
|
- test/dummy/app/views/layouts/application.html.erb
|
138
|
+
- test/dummy/config.ru
|
132
139
|
- test/dummy/config/application.rb
|
133
140
|
- test/dummy/config/boot.rb
|
134
141
|
- test/dummy/config/database.yml
|
@@ -144,13 +151,10 @@ files:
|
|
144
151
|
- test/dummy/config/initializers/wrap_parameters.rb
|
145
152
|
- test/dummy/config/locales/en.yml
|
146
153
|
- test/dummy/config/routes.rb
|
147
|
-
- test/dummy/config.ru
|
148
154
|
- test/dummy/public/404.html
|
149
155
|
- test/dummy/public/422.html
|
150
156
|
- test/dummy/public/500.html
|
151
157
|
- test/dummy/public/favicon.ico
|
152
|
-
- test/dummy/Rakefile
|
153
|
-
- test/dummy/README.rdoc
|
154
158
|
- test/dummy/script/rails
|
155
159
|
- test/test_helper.rb
|
156
160
|
- test/tkh_authentication_test.rb
|
@@ -163,17 +167,17 @@ require_paths:
|
|
163
167
|
- lib
|
164
168
|
required_ruby_version: !ruby/object:Gem::Requirement
|
165
169
|
requirements:
|
166
|
-
- -
|
170
|
+
- - ">="
|
167
171
|
- !ruby/object:Gem::Version
|
168
172
|
version: '0'
|
169
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
174
|
requirements:
|
171
|
-
- -
|
175
|
+
- - ">="
|
172
176
|
- !ruby/object:Gem::Version
|
173
177
|
version: '0'
|
174
178
|
requirements: []
|
175
179
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.0
|
180
|
+
rubygems_version: 2.2.0
|
177
181
|
signing_key:
|
178
182
|
specification_version: 4
|
179
183
|
summary: Simple authentication Rails engine.
|