before_filter :check_database_readable, :except => [:api_details, :api_gpx_files]
before_filter :check_database_writable, :only => [:login, :new, :set_home, :account, :go_public, :make_friend, :remove_friend, :upload_image, :delete_image]
before_filter :check_api_readable, :only => [:api_details, :api_gpx_files]
before_filter :check_database_readable, :except => [:api_details, :api_gpx_files]
before_filter :check_database_writable, :only => [:login, :new, :set_home, :account, :go_public, :make_friend, :remove_friend, :upload_image, :delete_image]
before_filter :check_api_readable, :only => [:api_details, :api_gpx_files]
Notifier.deliver_signup_confirm(@user, @user.tokens.create)
redirect_to :action => 'login'
else
Notifier.deliver_signup_confirm(@user, @user.tokens.create)
redirect_to :action => 'login'
else
if params[:user] and params[:user][:display_name] and params[:user][:description]
if params[:user][:email] != @user.email
@user.new_email = params[:user][:email]
if params[:user] and params[:user][:display_name] and params[:user][:description]
if params[:user][:email] != @user.email
@user.new_email = params[:user][:email]
if params[:user] and params[:user][:email]
user = User.find_by_email(params[:user][:email], :conditions => {:visible => true})
if user
token = user.tokens.create
Notifier.deliver_lost_password(user, token)
if params[:user] and params[:user][:email]
user = User.find_by_email(params[:user][:email], :conditions => {:visible => true})
if user
token = user.tokens.create
Notifier.deliver_lost_password(user, token)
# The user is logged in already, so don't show them the signup page, instead
# send them to the home page
redirect_to :controller => 'site', :action => 'index' if session[:user]
# The user is logged in already, so don't show them the signup page, instead
# send them to the home page
redirect_to :controller => 'site', :action => 'index' if session[:user]
session[:user] = @user.id
redirect_to :action => 'account', :display_name => @user.display_name
else
session[:user] = @user.id
redirect_to :action => 'account', :display_name => @user.display_name
else
session[:user] = @user.id
redirect_to :action => 'account', :display_name => @user.display_name
else
session[:user] = @user.id
redirect_to :action => 'account', :display_name => @user.display_name
else
@not_found_user = params[:display_name]
render :action => 'no_such_user', :status => :not_found
end
@not_found_user = params[:display_name]
render :action => 'no_such_user', :status => :not_found
end
friend = User.find_by_display_name(name, :conditions => {:visible => true})
if @user.is_friends_with?(friend)
Friend.delete_all "user_id = #{@user.id} AND friend_user_id = #{friend.id}"
friend = User.find_by_display_name(name, :conditions => {:visible => true})
if @user.is_friends_with?(friend)
Friend.delete_all "user_id = #{@user.id} AND friend_user_id = #{friend.id}"