diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-09-05 12:32:17 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-09-05 12:32:17 +0100 |
commit | 7f0ae82d44873b53cc87c659b42415ce4866c7b4 (patch) | |
tree | fdce14b0658bb05aef087dd4e09dc25c9a79ea8c /app/controllers/user_controller.rb | |
parent | 2926ee877bcf8974c529e1271ded42971fe0d632 (diff) | |
parent | 96c4dd912083edcd0c9eda76bd2301bb4a1a6d53 (diff) |
Merge branch 'develop' of github.com:sebbacon/alaveteli into develop, fix conflicts
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r-- | app/controllers/user_controller.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 47a133135..96dbfba74 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -8,6 +8,8 @@ class UserController < ApplicationController + layout :select_layout + protect_from_forgery :only => [ :contact, :set_profile_photo, :signchangeemail, @@ -113,7 +115,12 @@ class UserController < ApplicationController session[:user_id] = @user_signin.id session[:user_circumstance] = nil session[:remember_me] = params[:remember_me] ? true : false - do_post_redirect @post_redirect + + if is_modal_dialog + render :action => 'signin_successful' + else + do_post_redirect @post_redirect + end else send_confirmation_mail @user_signin end @@ -511,6 +518,15 @@ class UserController < ApplicationController private + def is_modal_dialog + (params[:modal].to_i != 0) + end + + # when logging in through a modal iframe, don't display chrome around the content + def select_layout + is_modal_dialog ? 'no_chrome' : 'default' + end + # Decide where we are going to redirect back to after signin/signup, and record that def work_out_post_redirect # Redirect to front page later if nothing else specified |