lobby 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/lobby/auth_user.rb +0 -10
- data/app/models/lobby/auth_user.rb~ +2 -8
- data/config/locales/de.yml +3 -9
- data/config/locales/de.yml~ +12 -0
- data/config/locales/en.yml +3 -9
- data/config/locales/en.yml~ +129 -58
- data/config/routes.rb +0 -2
- data/lib/generators/templates/db/migrate/create_users.rb +0 -2
- data/lib/generators/templates/db/migrate/create_users.rb~ +16 -0
- data/lib/lobby/version.rb +1 -1
- data/lib/lobby/version.rb~ +1 -1
- metadata +2 -1
@@ -47,11 +47,6 @@ module Lobby
|
|
47
47
|
update_attribute(:active, true)
|
48
48
|
end
|
49
49
|
|
50
|
-
def confirm_new_email!
|
51
|
-
update_attribute(:email, new_email)
|
52
|
-
update_attribute(:new_email_token, nil)
|
53
|
-
end
|
54
|
-
|
55
50
|
def confirmed?
|
56
51
|
!self.confirmed.nil?
|
57
52
|
end
|
@@ -102,11 +97,6 @@ module Lobby
|
|
102
97
|
tokenmail(:resend_signup_token)
|
103
98
|
end
|
104
99
|
|
105
|
-
def send_new_email_request
|
106
|
-
return unless (confirmed? && generate_token(:new_email_token))
|
107
|
-
tokenmail(:new_email_request)
|
108
|
-
end
|
109
|
-
|
110
100
|
|
111
101
|
private
|
112
102
|
|
@@ -6,7 +6,7 @@ module Lobby
|
|
6
6
|
|
7
7
|
base.validates :email, presence: true
|
8
8
|
base.validates :email, format: {with: EMAIL_REGEX, multiline: true}, if: Proc.new { |u| u.email.present? }
|
9
|
-
base.validates :email, uniqueness: true, :unless => :
|
9
|
+
base.validates :email, uniqueness: true, :unless => :confirmed_duplicate_email, :on => :create, if: Proc.new { |u| u.email.present? }
|
10
10
|
base.validates :password, length: { minimum: 5 }, :on => :create, if: Proc.new { |u| u.password.present? }
|
11
11
|
|
12
12
|
base.validates :username, presence: true
|
@@ -32,12 +32,11 @@ module Lobby
|
|
32
32
|
end
|
33
33
|
|
34
34
|
|
35
|
-
def
|
35
|
+
def confirmed_duplicate_email(test_mail = self.email)
|
36
36
|
if ((self.class.name.constantize.confirmed.with_email(test_mail).count == 0) ||
|
37
37
|
(self.class.name.constantize.with_email(test_mail).count == 0))
|
38
38
|
true
|
39
39
|
else
|
40
|
-
#self.id = self.class.name.constantize.confirmed.with_email(test_mail).first.id
|
41
40
|
false
|
42
41
|
end
|
43
42
|
end
|
@@ -103,11 +102,6 @@ module Lobby
|
|
103
102
|
tokenmail(:resend_signup_token)
|
104
103
|
end
|
105
104
|
|
106
|
-
def send_new_email_request
|
107
|
-
return unless (confirmed? && generate_token(:new_email_token))
|
108
|
-
tokenmail(:new_email_request)
|
109
|
-
end
|
110
|
-
|
111
105
|
|
112
106
|
private
|
113
107
|
|
data/config/locales/de.yml
CHANGED
@@ -80,6 +80,9 @@ de:
|
|
80
80
|
link2: "Anmelden?"
|
81
81
|
|
82
82
|
confirmation:
|
83
|
+
new_email:
|
84
|
+
flash:
|
85
|
+
success: "Deine E-Mail-Adresse wurde geändert."
|
83
86
|
registration:
|
84
87
|
title: "Token"
|
85
88
|
resend_signup_token_link: "oder den Token nochmal senden."
|
@@ -107,15 +110,6 @@ de:
|
|
107
110
|
|
108
111
|
confirmation_mailer:
|
109
112
|
|
110
|
-
new_email_request:
|
111
|
-
subject: 'Neue E-Mail bestätigen'
|
112
|
-
body: "Hallo,
|
113
|
-
um die Änderung Deiner E-Mail-Adress bei XYZ abzuschließen klicke bitte auf folgenden Link:
|
114
|
-
|
115
|
-
%{url}
|
116
|
-
|
117
|
-
Vielen Dank"
|
118
|
-
|
119
113
|
registration:
|
120
114
|
subject: 'Bitte Anmeldung bestätigen'
|
121
115
|
body: "Hallo,
|
data/config/locales/de.yml~
CHANGED
@@ -80,6 +80,9 @@ de:
|
|
80
80
|
link2: "Anmelden?"
|
81
81
|
|
82
82
|
confirmation:
|
83
|
+
new_email:
|
84
|
+
flash:
|
85
|
+
success: "Deine E-Mail-Adresse wurde geändert."
|
83
86
|
registration:
|
84
87
|
title: "Token"
|
85
88
|
resend_signup_token_link: "oder den Token nochmal senden."
|
@@ -107,6 +110,15 @@ de:
|
|
107
110
|
|
108
111
|
confirmation_mailer:
|
109
112
|
|
113
|
+
new_email_request:
|
114
|
+
subject: 'Neue E-Mail bestätigen'
|
115
|
+
body: "Hallo,
|
116
|
+
um die Änderung Deiner E-Mail-Adress bei XYZ abzuschließen klicke bitte auf folgenden Link:
|
117
|
+
|
118
|
+
%{url}
|
119
|
+
|
120
|
+
Vielen Dank"
|
121
|
+
|
110
122
|
registration:
|
111
123
|
subject: 'Bitte Anmeldung bestätigen'
|
112
124
|
body: "Hallo,
|
data/config/locales/en.yml
CHANGED
@@ -80,6 +80,9 @@ en:
|
|
80
80
|
link2: "Log in?"
|
81
81
|
|
82
82
|
confirmation:
|
83
|
+
new_email:
|
84
|
+
flash:
|
85
|
+
success: "Your e-mail was updated."
|
83
86
|
registration:
|
84
87
|
title: "Token"
|
85
88
|
resend_signup_token_link: "or send token again."
|
@@ -107,15 +110,6 @@ en:
|
|
107
110
|
|
108
111
|
confirmation_mailer:
|
109
112
|
|
110
|
-
new_email_request:
|
111
|
-
subject: 'Confirm new email'
|
112
|
-
body: "Hallo,
|
113
|
-
to complete the change of your e-mail address at XYZ please click on the following link:
|
114
|
-
|
115
|
-
%{url}
|
116
|
-
|
117
|
-
Thank you very much"
|
118
|
-
|
119
113
|
registration:
|
120
114
|
subject: 'Please confirm registration'
|
121
115
|
body: "Hello,
|
data/config/locales/en.yml~
CHANGED
@@ -8,73 +8,144 @@ en:
|
|
8
8
|
form:
|
9
9
|
error: "error"
|
10
10
|
|
11
|
+
activerecord:
|
12
|
+
errors:
|
13
|
+
full_messages:
|
14
|
+
format: "{{message}}"
|
15
|
+
messages:
|
16
|
+
confirmation: "Repeat Password is incorrect."
|
17
|
+
models:
|
18
|
+
user:
|
19
|
+
attributes:
|
20
|
+
password:
|
21
|
+
blank: "Please enter a password."
|
22
|
+
too_short: "Password is too short."
|
23
|
+
password_confirmation:
|
24
|
+
blank: "Please verify the password."
|
25
|
+
email:
|
26
|
+
taken: 'This e-mail is already in the system.'
|
27
|
+
blank: "Please enter an e-mail."
|
28
|
+
invalid: "The e-mail has an incorrect format."
|
29
|
+
password_digest:
|
30
|
+
blank: "Please enter a password"
|
31
|
+
username:
|
32
|
+
blank: "Please enter a user name."
|
33
|
+
taken: 'This username is already in the system.'
|
11
34
|
activemodel:
|
12
35
|
errors:
|
13
36
|
models:
|
14
|
-
accountly:
|
15
|
-
change_email_form:
|
16
|
-
attributes:
|
17
|
-
new_email:
|
18
|
-
blank: 'Bitte eine neue E-Mail angeben'
|
19
|
-
invalid: "Die E-Mail hat ein falsches Format."
|
20
|
-
duplicate: 'Diese E-Mail kann nicht gewählt werden.'
|
21
|
-
new_email_confirmation:
|
22
|
-
confirmation: 'Die E-Mail-Bestätigung war falsch'
|
23
|
-
blank: 'Bitte die E-Mail bestätigen'
|
24
|
-
accountly:
|
25
|
-
username_form:
|
26
|
-
attributes:
|
27
|
-
new_username:
|
28
|
-
blank: 'Bitte einen Username angeben'
|
29
|
-
duplicate: 'Dieser Username kann nicht gewählt werden.'
|
30
|
-
new_username_confirmation:
|
31
|
-
confirmation: 'Die Bestätigung war falsch'
|
32
|
-
blank: 'Bitte den Username bestätigen'
|
33
|
-
original_password:
|
34
|
-
blank: 'Bitte auch das alte Passwort angeben.'
|
35
|
-
invalid: 'Das aktuelle Passwort war nicht korrekt'
|
36
37
|
password_forgotten_form:
|
37
38
|
attributes:
|
38
39
|
new_password:
|
39
|
-
too_short: '
|
40
|
+
too_short: 'The new password is too short (minimum 5 characters)'
|
40
41
|
new_password_confirmation:
|
41
|
-
confirmation: '
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
blank: 'Bitte auch das alte Passwort angeben.'
|
47
|
-
invalid: 'Das aktuelle Passwort war nicht korrekt'
|
48
|
-
new_password:
|
49
|
-
too_short: 'Das neue Passwort ist zu kurz (mind. 5 Zeichen)'
|
50
|
-
new_password_confirmation:
|
51
|
-
confirmation: 'Die Passwortbestätigung war falsch.'
|
52
|
-
|
53
|
-
accountly:
|
54
|
-
passwords:
|
55
|
-
new:
|
56
|
-
title: 'Passwort ändern'
|
57
|
-
label_original_password: 'aktuelles Passwort'
|
58
|
-
label_new_password: 'neues Passwort'
|
59
|
-
label_new_password_confirmation: 'neues Passwort wiederholen'
|
60
|
-
create:
|
61
|
-
notice:
|
62
|
-
success: "Dein Passwort wurde geändert."
|
63
|
-
usernames:
|
42
|
+
confirmation: 'Incorrect password confirmation.'
|
43
|
+
|
44
|
+
lobby:
|
45
|
+
|
46
|
+
users:
|
64
47
|
new:
|
65
|
-
title: '
|
66
|
-
|
67
|
-
|
68
|
-
|
48
|
+
title: 'Register'
|
49
|
+
label_email: 'e-mail'
|
50
|
+
label_username: 'Username'
|
51
|
+
label_password: 'Password'
|
52
|
+
label_password_confirmation: 'Password confirmation'
|
69
53
|
create:
|
70
|
-
|
71
|
-
|
72
|
-
|
54
|
+
success: "To complete the registration please click on the link we've just sent you."
|
55
|
+
|
56
|
+
sessions:
|
57
|
+
destroy:
|
58
|
+
success: "You logged out. Bye."
|
73
59
|
new:
|
74
|
-
title:
|
75
|
-
|
76
|
-
|
77
|
-
|
60
|
+
title: 'Login'
|
61
|
+
label_email: 'e-mail or username'
|
62
|
+
label_password: 'password'
|
63
|
+
link_password_forgotten: 'Forgot Password?'
|
78
64
|
create:
|
79
65
|
flash:
|
80
|
-
success: '
|
66
|
+
success: "You're in."
|
67
|
+
error:
|
68
|
+
not_active: "Your account has been disabled."
|
69
|
+
not_confirmed: "Please confirm the registration first."
|
70
|
+
wrong_password_or_email: "Incorrect email and / or password"
|
71
|
+
|
72
|
+
info:
|
73
|
+
login_status:
|
74
|
+
logged_in:
|
75
|
+
message_html: "You are logged in as: %{email}. %{logout_link}"
|
76
|
+
link1: "log off?"
|
77
|
+
logged_out:
|
78
|
+
message_html: "You are not logged in. %{signin_link} or %{signup_link}"
|
79
|
+
link1: "Sign up?"
|
80
|
+
link2: "Log in?"
|
81
|
+
|
82
|
+
confirmation:
|
83
|
+
new_email:
|
84
|
+
flash:
|
85
|
+
success: "Your e-mail was updated."
|
86
|
+
registration:
|
87
|
+
title: "Token"
|
88
|
+
resend_signup_token_link: "or send token again."
|
89
|
+
flash:
|
90
|
+
success: 'Your registration was successful. Now you can login'
|
91
|
+
error: 'Your registration could not be confirmed. Was the link incorrect? If your email program does not properly represent the confirmation link, so you can copy it to the field activation token below.'
|
92
|
+
resend_signup_token:
|
93
|
+
label_email: "E-mail"
|
94
|
+
label_password: "Password"
|
95
|
+
title: "Send activation token again"
|
96
|
+
flash:
|
97
|
+
success: "The activation token was again sent"
|
98
|
+
error: "You are already confirmed. This link is no longer valid."
|
99
|
+
|
100
|
+
|
101
|
+
password_forgotten:
|
102
|
+
recover_password_auth:
|
103
|
+
title: 'Create new password'
|
104
|
+
label_token: 'Token'
|
105
|
+
order_new_password:
|
106
|
+
title: "Generate new password"
|
107
|
+
label_email: "Your registered e-mail"
|
108
|
+
flash:
|
109
|
+
success: 'Please check your e-mails. There you will find a link to set your password.'
|
110
|
+
|
111
|
+
confirmation_mailer:
|
112
|
+
|
113
|
+
new_email_request:
|
114
|
+
subject: 'Confirm new email'
|
115
|
+
body: "Hello,
|
116
|
+
to complete the change of your e-mail address at XYZ please click on the following link:
|
117
|
+
|
118
|
+
%{url}
|
119
|
+
|
120
|
+
Thank you very much"
|
121
|
+
|
122
|
+
registration:
|
123
|
+
subject: 'Please confirm registration'
|
124
|
+
body: "Hello,
|
125
|
+
many Thanks for registering with XYZ. To complete your registration please click on the following link:
|
126
|
+
|
127
|
+
%{url}
|
128
|
+
|
129
|
+
Thank you very much"
|
130
|
+
|
131
|
+
|
132
|
+
send_password_reset:
|
133
|
+
subject: 'Requested new password'
|
134
|
+
body: "Hello.
|
135
|
+
This is an automatically generated message from XYZ for users who have forgotten their login details. Enclosed you will receive,
|
136
|
+
as requested, a link with which you can generate your new password:
|
137
|
+
|
138
|
+
%{url}
|
139
|
+
|
140
|
+
Thank you very much"
|
141
|
+
|
142
|
+
|
143
|
+
resend_signup_token:
|
144
|
+
subject: 'New registration token'
|
145
|
+
body: "Hello.
|
146
|
+
This is an automatically generated message from XYZ for users who have lost their registration email. Enclosed you will receive,
|
147
|
+
as requested, a link with which you can confirm your registration:
|
148
|
+
|
149
|
+
%{url}
|
150
|
+
|
151
|
+
VThank you very much"
|
data/config/routes.rb
CHANGED
@@ -15,8 +15,6 @@ Lobby::Engine.routes.draw do
|
|
15
15
|
post 'recover_password' => 'password_forgotten#create', as: 'recover_password'
|
16
16
|
match 'request_password' => 'password_forgotten#order_new_password', as: 'order_new_password', via: [:get, :post]
|
17
17
|
|
18
|
-
match 'new_email(/:token)' => 'confirmation#new_email', as: 'new_email', via: [:get, :post]
|
19
|
-
|
20
18
|
resources :sessions
|
21
19
|
|
22
20
|
default_url_options :host => 'localhost:3000'
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :users do |t|
|
4
|
+
t.string :email
|
5
|
+
t.string :password_digest
|
6
|
+
t.string :signup_token
|
7
|
+
t.string :password_token
|
8
|
+
# t.string :new_email
|
9
|
+
# t.string :new_email_token
|
10
|
+
t.boolean :active
|
11
|
+
t.string :username
|
12
|
+
t.datetime :confirmed, :null => true
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/lobby/version.rb
CHANGED
data/lib/lobby/version.rb~
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lobby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -266,6 +266,7 @@ files:
|
|
266
266
|
- lib/generators/lobby/lobby_generator.rb~
|
267
267
|
- lib/generators/lobby/install_generator.rb~
|
268
268
|
- lib/generators/templates/db/migrate/create_users.rb
|
269
|
+
- lib/generators/templates/db/migrate/create_users.rb~
|
269
270
|
- lib/generators/templates/config/initializers/constants.rb
|
270
271
|
- lib/generators/templates/config/initializers/action_mailer.rb
|
271
272
|
- lib/generators/templates/config/locales/de.yml
|