@@ -209,7 +209,11 private | |||
|
209 | 209 | end |
|
210 | 210 | else |
|
211 | 211 | # Existing record |
|
212 | successful_authentication(user) | |
|
212 | if user.active? | |
|
213 | successful_authentication(user) | |
|
214 | else | |
|
215 | account_pending | |
|
216 | end | |
|
213 | 217 | end |
|
214 | 218 | end |
|
215 | 219 | end |
@@ -269,10 +273,14 private | |||
|
269 | 273 | if user.save |
|
270 | 274 | # Sends an email to the administrators |
|
271 | 275 | Mailer.deliver_account_activation_request(user) |
|
272 |
|
|
|
273 | redirect_to :action => 'login' | |
|
276 | account_pending | |
|
274 | 277 | else |
|
275 | 278 | yield if block_given? |
|
276 | 279 | end |
|
277 | 280 | end |
|
281 | ||
|
282 | def account_pending | |
|
283 | flash[:notice] = l(:notice_account_pending) | |
|
284 | redirect_to :action => 'login' | |
|
285 | end | |
|
278 | 286 | end |
@@ -80,6 +80,21 class AccountControllerTest < Test::Unit::TestCase | |||
|
80 | 80 | assert_redirected_to 'my/page' |
|
81 | 81 | end |
|
82 | 82 | |
|
83 | def test_login_with_openid_for_existing_non_active_user | |
|
84 | Setting.self_registration = '2' | |
|
85 | Setting.openid = '1' | |
|
86 | existing_user = User.new(:firstname => 'Cool', | |
|
87 | :lastname => 'User', | |
|
88 | :mail => 'user@somedomain.com', | |
|
89 | :identity_url => 'http://openid.example.com/good_user', | |
|
90 | :status => User::STATUS_REGISTERED) | |
|
91 | existing_user.login = 'cool_user' | |
|
92 | assert existing_user.save! | |
|
93 | ||
|
94 | post :login, :openid_url => existing_user.identity_url | |
|
95 | assert_redirected_to 'login' | |
|
96 | end | |
|
97 | ||
|
83 | 98 | def test_login_with_openid_with_new_user_created |
|
84 | 99 | Setting.self_registration = '3' |
|
85 | 100 | Setting.openid = '1' |
General Comments 0
You need to be logged in to leave comments.
Login now