Commit bec2b3cddd5d502cabd35b2d30452afceb188db4
1 parent
b461081b
Exists in
master
and in
28 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 | 397 | end |
| 398 | 398 | else |
| 399 | 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 | 414 | else |
| 402 | 415 | redirect_back_or_default(:controller => 'home') |
| 403 | 416 | end | ... | ... |
features/signup.feature
| ... | ... | @@ -111,7 +111,7 @@ Feature: signup |
| 111 | 111 | |
| 112 | 112 | @selenium |
| 113 | 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 | 115 | And feature "skip_new_user_email_confirmation" is enabled on environment |
| 116 | 116 | And I am on /search/people |
| 117 | 117 | When I follow "Sign up" |
| ... | ... | @@ -145,7 +145,6 @@ Feature: signup |
| 145 | 145 | Scenario: user should stay on same page after following confirmation link |
| 146 | 146 | Given the environment is configured to stay on the same page after login |
| 147 | 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 | 148 | And I am on /search/people |
| 150 | 149 | When I follow "Sign up" |
| 151 | 150 | And I fill in the following within ".no-boxes": |
| ... | ... | @@ -166,7 +165,6 @@ Feature: signup |
| 166 | 165 | Scenario: user should go to his homepage after following confirmation link |
| 167 | 166 | Given the environment is configured to redirect to profile homepage after login |
| 168 | 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 | 168 | And I am on /search/people |
| 171 | 169 | When I follow "Sign up" |
| 172 | 170 | And I fill in the following within ".no-boxes": |
| ... | ... | @@ -187,7 +185,6 @@ Feature: signup |
| 187 | 185 | Scenario: user should go to his control panel after following confirmation link |
| 188 | 186 | Given the environment is configured to redirect to profile control panel after login |
| 189 | 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 | 188 | And I am on /search/people |
| 192 | 189 | When I follow "Sign up" |
| 193 | 190 | And I fill in the following within ".no-boxes": |
| ... | ... | @@ -206,9 +203,8 @@ Feature: signup |
| 206 | 203 | |
| 207 | 204 | @selenium |
| 208 | 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 | 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 | 208 | And I am on /search/people |
| 213 | 209 | When I follow "Sign up" |
| 214 | 210 | And I fill in the following within ".no-boxes": |
| ... | ... | @@ -229,7 +225,6 @@ Feature: signup |
| 229 | 225 | Scenario: user should go to the environment homepage after following confirmation link |
| 230 | 226 | Given the environment is configured to redirect to site homepage after login |
| 231 | 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 | 228 | And I am on /search/people |
| 234 | 229 | When I follow "Sign up" |
| 235 | 230 | And I fill in the following within ".no-boxes": | ... | ... |