jam-cloud/web/app/controllers/clients_controller.rb

36 lines
928 B
Ruby

class ClientsController < ApplicationController
include ClientHelper
include UsersHelper
def index
# we want to enforce that /client is always the client view prefix
# this is a side effect of setting root path to '/'; soon we can remove this when we implement the new home page
if request.path == '/'
redirect_to client_url
return
end
render :layout => 'client'
end
AUTHED = %W{friend}
def auth_action
if current_user
session.delete(:return_to) if session[:return_to] =~ /authed/
# FIXME: implement auth-action on a per-case basis
redirect_to(client_url) and return
else
if AUTHED.include?(params[:authed])
session[:return_to] = auth_action_url(:authed => params[:authed], :data => params[:data])
else
session.delete(:return_to) if session[:return_to] =~ /authed/
end
redirect_to client_url
end
end
end