app/controllers/application.rb
#
# Checks if the +client user+ is logged in and is active
# This method is present in before_filters in client section to authorize client
# This method sets up @current_client
# If client is not authorized, shows "no_permission" partial.
#

Checks if the +client user+ is logged in and is active
This method is present in before_filters in client section to authorize client
This method sets up @current_client
If client is not authorized, shows "no_permission" partial.
Checks if the + client user + is logged in and is active This method is present in before_filters in client section to authorize client This method sets up @current_client If client is not authorized shows " no_permission " partial .
def authorize_client   
    @current_client = nil
    unless session[:client_id]
      flash[:notice] = "Please log in"
      redirect_to(:controller => "clientsportal", :action => "login") and return false
    end
    @current_client=Client.find(session[:client_id]);
    if @current_client.is_inactive?
      render :partial => "users/inactive", :layout => "clientportal" and return false        
    end
  end
def authorize_client @current_client = nil unless session [ :client_id ] flash [ :notice ] = "Please log in" redirect_to ( :controller => "clientsportal" , :action => "login" ) and return false end @current_client = Client . find ( session [ :client_id ] ) ; if @current_client . is_inactive? render :partial => "users/inactive" , :layout => "clientportal" and return false end end
Checks if the +client user+ is logged in and is active
This method is present in before_filters in client section to authorize client
This method sets up @current_client
If client is not authorized, shows "no_permission" partial.
Checks if the + client user + is logged in and is active This method is present in before_filters in client section to authorize client This method sets up @current_client If client is not authorized shows " no_permission " partial .
# If client is not logged in - redirect him to login page.
 # Client is logged in, restore record
 # Check if client is inactive - redirect to 'inactive' page
