diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5dc0e80..702d1e3 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -30,6 +30,8 @@ class UsersController < ApplicationController end def show + user = User.find(params[:id]) + @ban_json = JSON.parse(File.read("/etc/minecraft/redstoner/banned-players.json")).detect {|u| u["uuid"] == user.uuid} end # SIGNUP diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index e371a09..eb14575 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -15,11 +15,12 @@

<%= @user.name %>

- - <% if @user.banned? %> - This user is banned! + <% if @ban_json %> + This used is banned for "<%=@ban_json["reason"]%>"<%=" until #{@ban_json["expires"]}" unless @ban_json["expires"] == "forever"%> + <% elsif @user.banned? %> + This user is banned! <% end %> - +
<% if !@user.confirmed? %> <% if @user.is?(current_user) || mod? %> Please confirm your email <%= @user.email %> !