checking for banned user, better banned msg style
This commit is contained in:
@@ -438,16 +438,7 @@ and (min-width: 0px) //TODO
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-banned {
|
.user-unconfirmed, .user-banned {
|
||||||
background: #AB0000;
|
|
||||||
color: white;
|
|
||||||
font-weight: bold;
|
|
||||||
padding: 4px;
|
|
||||||
display: block;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-unconfirmed {
|
|
||||||
background: #AB0000;
|
background: #AB0000;
|
||||||
color: white;
|
color: white;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -455,7 +446,6 @@ and (min-width: 0px) //TODO
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
box-shadow: 0 0 10px #000;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
protect_from_forgery
|
protect_from_forgery
|
||||||
before_filter :update_ip, :update_seen
|
before_filter :update_ip, :update_seen, :check_banned
|
||||||
# force_ssl
|
# force_ssl
|
||||||
|
|
||||||
http_basic_authenticate_with name: "redstone", password: "sheep_"
|
http_basic_authenticate_with name: "redstone", password: "sheep_"
|
||||||
@@ -18,6 +18,8 @@ class ApplicationController < ActionController::Base
|
|||||||
helper_method :superadmin?
|
helper_method :superadmin?
|
||||||
helper_method :donor?
|
helper_method :donor?
|
||||||
helper_method :confirmed?
|
helper_method :confirmed?
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def update_ip
|
def update_ip
|
||||||
@@ -32,6 +34,15 @@ class ApplicationController < ActionController::Base
|
|||||||
@current_user ||= User.find_by_id(session[:user_id])
|
@current_user ||= User.find_by_id(session[:user_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_banned
|
||||||
|
if current_user && current_user.banned?
|
||||||
|
session.delete(:user_id)
|
||||||
|
flash[:alert] = "You are banned!"
|
||||||
|
redirect_to login_path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
#roles
|
#roles
|
||||||
def disabled?
|
def disabled?
|
||||||
!!(current_user && current_user.disabled?)
|
!!(current_user && current_user.disabled?)
|
||||||
|
|||||||
Reference in New Issue
Block a user