diff options
author | David Cabo <david@calibea.com> | 2011-08-22 22:51:54 +0200 |
---|---|---|
committer | David Cabo <david@calibea.com> | 2011-08-22 22:51:54 +0200 |
commit | 349163c4de2d0cfe52c12ef41dae62f8555cf9c3 (patch) | |
tree | eab8ec871290e9db117890ac4729e0484249644f /app/controllers/user_controller.rb | |
parent | 88b9e2c08526983fcf5985fdd2fcdf420f45f51c (diff) | |
parent | 6c692dea355ea2a057a01e795466a19f81b494aa (diff) |
Merge branch 'asktheeu' into asktheeu-new-design
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 d3c42c7f1..3e3913fae 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, @@ -106,7 +108,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 @@ -500,6 +507,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 |