41 lines
988 B
Ruby
41 lines
988 B
Ruby
class ClientsController < ApplicationController
|
|
|
|
include ClientHelper
|
|
include UsersHelper
|
|
|
|
|
|
AUTHED = %W{friend}
|
|
|
|
|
|
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
|
|
|
|
def latency_tester
|
|
render :layout => 'client'
|
|
end
|
|
|
|
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
|