Made messages shown on user profile pages more accurate based on who is viewing.

This commit is contained in:
Logan Fick
2017-11-10 14:29:19 -05:00
parent 34cb9e9dfc
commit b4af851ad0
2 changed files with 19 additions and 4 deletions

View File

@@ -19,7 +19,11 @@ class UsersController < ApplicationController
begin
@ban_json = JSON.parse(File.read("/etc/minecraft/redstoner/banned-players.json")).detect {|u| u["uuid"].tr("-", "") == @user.uuid}
rescue
flash.now[:alert] = "An error occured while checking if this user is banned from the server!"
if @user.is?(current_user)
flash.now[:alert] = "An error occured while checking if you are banned from the server!"
else
flash.now[:alert] = "An error occured while checking if this user is banned from the server!"
end
@ban_json = nil
end
end