lobby 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,10 +21,5 @@ module Lobby
21
21
  mail( :to => user.email, :subject => t( '.subject' ))
22
22
  end
23
23
 
24
- def new_email_request( user )
25
- @user = user
26
- @confirmation_url = new_email_url( @user.new_email_token )
27
- mail( :to => @user.new_email, :subject => t( '.subject' ))
28
- end
29
24
  end
30
25
  end
@@ -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 => :confirmed_duplicate, :on => :create, if: Proc.new { |u| u.email.present? }
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 confirmed_duplicate(test_mail = self.email)
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
@@ -25,6 +25,10 @@ module Lobby
25
25
  where(:email => email)
26
26
  end
27
27
 
28
+ def with_username(username)
29
+ where(:username => username)
30
+ end
31
+
28
32
  end
29
33
 
30
34
 
@@ -68,10 +72,6 @@ module Lobby
68
72
  end
69
73
  end
70
74
 
71
- def self.with_username(username)
72
- where(:username => username)
73
- end
74
-
75
75
  # Wenn der User sich registriert, dann wird ein signup_token für ihn hinterlegt.
76
76
  # Dieser Token wird per Mail verschickt. Der User kann sich nun per Klick auf den
77
77
  # Tokenlink verifizieren. Sollte die Mail nicht mehr erreichbar sein, so kann der User
@@ -8,141 +8,73 @@ 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.'
34
11
  activemodel:
35
12
  errors:
36
13
  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'
37
36
  password_forgotten_form:
38
37
  attributes:
39
38
  new_password:
40
- too_short: 'The new password is too short (minimum 5 characters)'
39
+ too_short: 'Das neue Passwort ist zu kurz (mind. 5 Zeichen)'
41
40
  new_password_confirmation:
42
- confirmation: 'Incorrect password confirmation.'
43
-
44
- lobby:
45
-
46
- users:
41
+ confirmation: 'Die Passwortbestätigung war falsch.'
42
+ accountly:
43
+ password_form:
44
+ attributes:
45
+ original_password:
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:
47
55
  new:
48
- title: 'Register'
49
- label_email: 'e-mail'
50
- label_username: 'Username'
51
- label_password: 'Password'
52
- label_password_confirmation: 'Password confirmation'
56
+ title: 'Passwort ändern'
57
+ label_original_password: 'aktuelles Passwort'
58
+ label_new_password: 'neues Passwort'
59
+ label_new_password_confirmation: 'neues Passwort wiederholen'
53
60
  create:
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."
61
+ notice:
62
+ success: "Dein Passwort wurde geändert."
63
+ usernames:
59
64
  new:
60
- title: 'Login'
61
- label_email: 'e-mail or username'
62
- label_password: 'password'
63
- link_password_forgotten: 'Forgot Password?'
65
+ title: 'Username ändern'
66
+ label_original_password: 'aktuelles Passwort'
67
+ label_new_username: 'neuer Username'
68
+ label_new_username_confirmation: 'neuen Username wiederholen'
69
+ create:
70
+ notice:
71
+ success: "Dein Username wurde geändert."
72
+ emails:
73
+ new:
74
+ title: "E-Mail ändern"
75
+ label_new_email: "Neue E-Mail"
76
+ label_new_email_confirmation: "E-Mail bestätigen"
77
+ label_password: "Passwort"
64
78
  create:
65
79
  flash:
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
- registration:
84
- title: "Token"
85
- resend_signup_token_link: "or send token again."
86
- flash:
87
- success: 'Your registration was successful. Now you can login'
88
- 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.'
89
- resend_signup_token:
90
- label_email: "E-mail"
91
- label_password: "Password"
92
- title: "Send activation token again"
93
- flash:
94
- success: "The activation token was again sent"
95
- error: "You are already confirmed. This link is no longer valid."
96
-
97
-
98
- password_forgotten:
99
- recover_password_auth:
100
- title: 'Create new password'
101
- label_token: 'Token'
102
- order_new_password:
103
- title: "Generate new password"
104
- label_email: "Your registered e-mail"
105
- flash:
106
- success: 'Please check your e-mails. There you will find a link to set your password.'
107
-
108
- confirmation_mailer:
109
-
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
- registration:
120
- subject: 'Please confirm registration'
121
- body: "Hello,
122
- many Thanks for registering with XYZ. To complete your registration please click on the following link:
123
-
124
- %{url}
125
-
126
- Thank you very much"
127
-
128
-
129
- send_password_reset:
130
- subject: 'Requested new password'
131
- body: "Hello.
132
- This is an automatically generated message from XYZ for users who have forgotten their login details. Enclosed you will receive,
133
-    as requested, a link with which you can generate your new password:
134
-
135
- %{url}
136
-
137
- Thank you very much"
138
-
139
-
140
- resend_signup_token:
141
- subject: 'New registration token'
142
- body: "Hello.
143
- This is an automatically generated message from XYZ for users who have lost their registration email. Enclosed you will receive,
144
-    as requested, a link with which you can confirm your registration:
145
-
146
- %{url}
147
-
148
- VThank you very much"
80
+ success: 'Ein Bestätigungslink wurde an die neue E-Mail-Adresse versendet.'
data/config/routes.rb CHANGED
@@ -15,5 +15,9 @@ 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
+ resources :sessions
21
+
18
22
  default_url_options :host => 'localhost:3000'
19
23
  end
data/config/routes.rb~ CHANGED
@@ -15,7 +15,9 @@ 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
- # new email confirmation
19
18
  match 'new_email(/:token)' => 'confirmation#new_email', as: 'new_email', via: [:get, :post]
19
+
20
+ resources :sessions
21
+
20
22
  default_url_options :host => 'localhost:3000'
21
23
  end
data/lib/lobby/engine.rb CHANGED
@@ -2,14 +2,6 @@ module Lobby
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace Lobby
4
4
 
5
- # initializer :append_migrations do |app|
6
- # unless app.root.to_s.match root.to_s
7
- # config.paths["db/migrate"].expanded.each do |expanded_path|
8
- # app.config.paths["db/migrate"] << expanded_path
9
- # end
10
- # end
11
- # end
12
-
13
5
  config.generators do |g|
14
6
  g.test_framework :rspec, :view_specs => false
15
7
  g.integration_tool :rspec
data/lib/lobby/engine.rb~ CHANGED
@@ -2,13 +2,13 @@ module Lobby
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace Lobby
4
4
 
5
- initializer :append_migrations do |app|
6
- unless app.root.to_s.match root.to_s
7
- config.paths["db/migrate"].expanded.each do |expanded_path|
8
- app.config.paths["db/migrate"] << expanded_path
9
- end
10
- end
11
- end
5
+ # initializer :append_migrations do |app|
6
+ # unless app.root.to_s.match root.to_s
7
+ # config.paths["db/migrate"].expanded.each do |expanded_path|
8
+ # app.config.paths["db/migrate"] << expanded_path
9
+ # end
10
+ # end
11
+ # end
12
12
 
13
13
  config.generators do |g|
14
14
  g.test_framework :rspec, :view_specs => false
data/lib/lobby/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lobby
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module Lobby
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
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.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-09 00:00:00.000000000 Z
12
+ date: 2013-12-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 4.0.0.rc2
21
+ version: 4.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: 4.0.0.rc2
29
+ version: 4.0.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: haml
32
32
  requirement: !ruby/object:Gem::Requirement