Commit bec2b3cddd5d502cabd35b2d30452afceb188db4
1 parent
b461081b
Exists in
master
and in
29 other branches
bug_fix: redirection_after_login feature now works when
allow_change_of_redirection is disabled. (ActionItem2998)
Showing
2 changed files
with
16 additions
and
8 deletions
Show diff stats
app/controllers/public/account_controller.rb
@@ -397,7 +397,20 @@ class AccountController < ApplicationController | @@ -397,7 +397,20 @@ class AccountController < ApplicationController | ||
397 | end | 397 | end |
398 | else | 398 | else |
399 | if environment == current_user.environment | 399 | if environment == current_user.environment |
400 | - redirect_back_or_default(user.admin_url) | 400 | + case environment.redirection_after_login |
401 | + when 'keep_on_same_page' | ||
402 | + redirect_back_or_default(user.admin_url) | ||
403 | + when 'site_homepage' | ||
404 | + redirect_to :controller => :home | ||
405 | + when 'user_profile_page' | ||
406 | + redirect_to user.public_profile_url | ||
407 | + when 'user_homepage' | ||
408 | + redirect_to user.url | ||
409 | + when 'user_control_panel' | ||
410 | + redirect_to user.admin_url | ||
411 | + else | ||
412 | + redirect_back_or_default(user.admin_url) | ||
413 | + end | ||
401 | else | 414 | else |
402 | redirect_back_or_default(:controller => 'home') | 415 | redirect_back_or_default(:controller => 'home') |
403 | end | 416 | end |
features/signup.feature
@@ -111,7 +111,7 @@ Feature: signup | @@ -111,7 +111,7 @@ Feature: signup | ||
111 | 111 | ||
112 | @selenium | 112 | @selenium |
113 | Scenario: user should go to his profile page after signup | 113 | Scenario: user should go to his profile page after signup |
114 | - Given the environment is configured to redirect to profile page after signup | 114 | + Given the environment is configured to redirect to user profile page after signup |
115 | And feature "skip_new_user_email_confirmation" is enabled on environment | 115 | And feature "skip_new_user_email_confirmation" is enabled on environment |
116 | And I am on /search/people | 116 | And I am on /search/people |
117 | When I follow "Sign up" | 117 | When I follow "Sign up" |
@@ -145,7 +145,6 @@ Feature: signup | @@ -145,7 +145,6 @@ Feature: signup | ||
145 | Scenario: user should stay on same page after following confirmation link | 145 | Scenario: user should stay on same page after following confirmation link |
146 | Given the environment is configured to stay on the same page after login | 146 | Given the environment is configured to stay on the same page after login |
147 | And feature "skip_new_user_email_confirmation" is disabled on environment | 147 | And feature "skip_new_user_email_confirmation" is disabled on environment |
148 | - And feature "allow_change_of_redirection_after_login" is enabled on environment | ||
149 | And I am on /search/people | 148 | And I am on /search/people |
150 | When I follow "Sign up" | 149 | When I follow "Sign up" |
151 | And I fill in the following within ".no-boxes": | 150 | And I fill in the following within ".no-boxes": |
@@ -166,7 +165,6 @@ Feature: signup | @@ -166,7 +165,6 @@ Feature: signup | ||
166 | Scenario: user should go to his homepage after following confirmation link | 165 | Scenario: user should go to his homepage after following confirmation link |
167 | Given the environment is configured to redirect to profile homepage after login | 166 | Given the environment is configured to redirect to profile homepage after login |
168 | And feature "skip_new_user_email_confirmation" is disabled on environment | 167 | And feature "skip_new_user_email_confirmation" is disabled on environment |
169 | - And feature "allow_change_of_redirection_after_login" is enabled on environment | ||
170 | And I am on /search/people | 168 | And I am on /search/people |
171 | When I follow "Sign up" | 169 | When I follow "Sign up" |
172 | And I fill in the following within ".no-boxes": | 170 | And I fill in the following within ".no-boxes": |
@@ -187,7 +185,6 @@ Feature: signup | @@ -187,7 +185,6 @@ Feature: signup | ||
187 | Scenario: user should go to his control panel after following confirmation link | 185 | Scenario: user should go to his control panel after following confirmation link |
188 | Given the environment is configured to redirect to profile control panel after login | 186 | Given the environment is configured to redirect to profile control panel after login |
189 | And feature "skip_new_user_email_confirmation" is disabled on environment | 187 | And feature "skip_new_user_email_confirmation" is disabled on environment |
190 | - And feature "allow_change_of_redirection_after_login" is enabled on environment | ||
191 | And I am on /search/people | 188 | And I am on /search/people |
192 | When I follow "Sign up" | 189 | When I follow "Sign up" |
193 | And I fill in the following within ".no-boxes": | 190 | And I fill in the following within ".no-boxes": |
@@ -206,9 +203,8 @@ Feature: signup | @@ -206,9 +203,8 @@ Feature: signup | ||
206 | 203 | ||
207 | @selenium | 204 | @selenium |
208 | Scenario: user should go to his profile page after following confirmation link | 205 | Scenario: user should go to his profile page after following confirmation link |
209 | - Given the environment is configured to redirect to profile page after login | 206 | + Given the environment is configured to redirect to user profile page after login |
210 | And feature "skip_new_user_email_confirmation" is disabled on environment | 207 | And feature "skip_new_user_email_confirmation" is disabled on environment |
211 | - And feature "allow_change_of_redirection_after_login" is enabled on environment | ||
212 | And I am on /search/people | 208 | And I am on /search/people |
213 | When I follow "Sign up" | 209 | When I follow "Sign up" |
214 | And I fill in the following within ".no-boxes": | 210 | And I fill in the following within ".no-boxes": |
@@ -229,7 +225,6 @@ Feature: signup | @@ -229,7 +225,6 @@ Feature: signup | ||
229 | Scenario: user should go to the environment homepage after following confirmation link | 225 | Scenario: user should go to the environment homepage after following confirmation link |
230 | Given the environment is configured to redirect to site homepage after login | 226 | Given the environment is configured to redirect to site homepage after login |
231 | And feature "skip_new_user_email_confirmation" is disabled on environment | 227 | And feature "skip_new_user_email_confirmation" is disabled on environment |
232 | - And feature "allow_change_of_redirection_after_login" is enabled on environment | ||
233 | And I am on /search/people | 228 | And I am on /search/people |
234 | When I follow "Sign up" | 229 | When I follow "Sign up" |
235 | And I fill in the following within ".no-boxes": | 230 | And I fill in the following within ".no-boxes": |