Archived
Merge pull request #41.
This commit is contained in:
@@ -6,6 +6,8 @@ class UsersController < ApplicationController
|
|||||||
|
|
||||||
before_filter :set_user, except: [:index, :new, :create, :lost_password, :reset_password, :suggestions]
|
before_filter :set_user, except: [:index, :new, :create, :lost_password, :reset_password, :suggestions]
|
||||||
|
|
||||||
|
caches_action :show, expires_in: 10.seconds, layout: false
|
||||||
|
|
||||||
def index
|
def index
|
||||||
role = Role.find_by(name: params[:role])
|
role = Role.find_by(name: params[:role])
|
||||||
badge = Badge.find_by(name: params[:badge])
|
badge = Badge.find_by(name: params[:badge])
|
||||||
@@ -16,6 +18,12 @@ class UsersController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
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
|
end
|
||||||
|
|
||||||
# SIGNUP
|
# SIGNUP
|
||||||
|
|||||||
@@ -15,11 +15,13 @@
|
|||||||
<h1><%= @user.name %></h1>
|
<h1><%= @user.name %></h1>
|
||||||
|
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
<% if @ban_json %>
|
||||||
<% if @user.banned? %>
|
<span class="user-banned">This user is banned on the server for "<%=@ban_json["reason"]%>"<%=" until #{@ban_json["expires"]}" unless @ban_json["expires"] == "forever"%></span>
|
||||||
<span class="user-banned">This user is banned!</span>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if @user.banned? %>
|
||||||
|
<span class="user-banned">This user is banned on the website!</span>
|
||||||
|
<% end %>
|
||||||
|
<br>
|
||||||
<% if !@user.confirmed? %>
|
<% if !@user.confirmed? %>
|
||||||
<% if @user.is?(current_user) || mod? %>
|
<% if @user.is?(current_user) || mod? %>
|
||||||
<span class="user-unconfirmed">Please confirm your email <u><%= @user.email %></u> !</span>
|
<span class="user-unconfirmed">Please confirm your email <u><%= @user.email %></u> !</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user