summaryrefslogtreecommitdiff
path: root/app/controllers/users_controller.rb
diff options
context:
space:
mode:
authorLogan Fick <logaldeveloper@protonmail.com>2017-10-31 22:19:34 -0400
committerLogan Fick <logaldeveloper@protonmail.com>2017-10-31 22:19:34 -0400
commit52e32808b5b0f1550c3cb3a5f6082dbaabd2ae60 (patch)
tree13dafc78d7ab46bcb0326be04b09462243e16fc7 /app/controllers/users_controller.rb
parent06467477803715b11e5c5267e4dba819b21133a7 (diff)
parent7ed1c2ac57038127ba95f5ef940a3ea7f7e042f7 (diff)
Merge pull request #41.
Diffstat (limited to 'app/controllers/users_controller.rb')
-rw-r--r--app/controllers/users_controller.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 4c854ea..f6d9a71 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -6,6 +6,8 @@ class UsersController < ApplicationController
before_filter :set_user, except: [:index, :new, :create, :lost_password, :reset_password, :suggestions]
+ caches_action :show, expires_in: 10.seconds, layout: false
+
def index
role = Role.find_by(name: params[:role])
badge = Badge.find_by(name: params[:badge])
@@ -16,6 +18,12 @@ class UsersController < ApplicationController
end
def show
+ 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!"
+ @ban_json = nil
+ end
end
# SIGNUP