if user
token = user.tokens.create
Notifier.deliver_lost_password(user, token)
if user
token = user.tokens.create
Notifier.deliver_lost_password(user, token)
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
Friend.delete_all "user_id = #{@user.id} AND friend_user_id = #{friend.id}"
flash[:notice] = t 'user.remove_friend.success', :name => friend.display_name
else
Friend.delete_all "user_id = #{@user.id} AND friend_user_id = #{friend.id}"
flash[:notice] = t 'user.remove_friend.success', :name => friend.display_name
else
# and return them to the user page.
def require_administrator
unless @user.administrator?
# and return them to the user page.
def require_administrator
unless @user.administrator?