BigW Consortium Gitlab

sessions_controller.rb 907 Bytes
Newer Older
1 2 3
class SessionsController < Devise::SessionsController

  def new
4
    redirect_path = if request.referer.present? && (params['redirect_to_referer'] == 'yes')
5 6 7 8 9 10 11 12 13 14
                     referer_uri = URI(request.referer)
                     if referer_uri.host == Gitlab.config.gitlab.host
                       referer_uri.path
                     else
                       request.fullpath
                     end
                   else
                     request.fullpath
                   end

15 16 17 18 19
    # Prevent a 'you are already signed in' message directly after signing:
    # we should never redirect to '/users/sign_in' after signing in successfully.
    unless redirect_path == '/users/sign_in'
      store_location_for(:redirect, redirect_path)
    end
20

21
    if Gitlab.config.ldap.enabled
22
      @ldap_servers = Gitlab::LDAP::Config.servers
23 24
    end

25 26 27 28 29 30 31
    super
  end

  def create
    super
  end
end