molten-trunk/molten5_withgrid/app/controllers/admin/contacts_controller.rb
# Authenicates the user with id +params[:id]+ and redirects to the default
# home page.
Authenicates the user with id +params[:id]+ and redirects to the default
home page.
Authenicates the user with id + params [ : id ] + and redirects to the default home page .
def authenticate
    if @contact = Sfcontact.find_by_sf_id(params[:id])
      cookies[:contact_id] = @contact.id
      cookies[:token] = { :value => @contact.token, :expires => AppConstants::COOKIE_TIME_LIMIT }
      flash[:notice] = "Now authenticated as #{@contact.name}"
      return redirect_to(home_url)
    else
      flash[:warning] = "couldn't find the contact."
      return redirect_to(:back)
    end
  end
def authenticate if @contact = Sfcontact . find_by_sf_id ( params [ :id ] ) cookies [ :contact_id ] = @contact . id cookies [ :token ] = { :value => @contact . token , :expires => AppConstants :: COOKIE_TIME_LIMIT } flash [ :notice ] = "Now authenticated as #{@contact.name}" return redirect_to ( home_url ) else flash [ :warning ] = "couldn't find the contact." return redirect_to ( :back ) end end
Authenicates the user with id +params[:id]+ and redirects to the default
home page.
Authenicates the user with id + params [ : id ] + and redirects to the default home page .