mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-14 05:41:00 +00:00
Remove IP address data from users plugin
This commit is contained in:
parent
5a3be391f3
commit
6dfcc0114f
2 changed files with 80 additions and 52 deletions
|
@ -2,7 +2,6 @@ class PluginController < ApplicationController
|
||||||
def user
|
def user
|
||||||
buffer = []
|
buffer = []
|
||||||
out = []
|
out = []
|
||||||
|
|
||||||
if ban = Ban.first(:conditions => ["expiry > UTC_TIMESTAMP() AND steamid = ? AND ban_type = ?", params[:id], Ban::TYPE_SERVER])
|
if ban = Ban.first(:conditions => ["expiry > UTC_TIMESTAMP() AND steamid = ? AND ban_type = ?", params[:id], Ban::TYPE_SERVER])
|
||||||
out << "#USER#"
|
out << "#USER#"
|
||||||
out << "BANNED"
|
out << "BANNED"
|
||||||
|
@ -31,7 +30,7 @@ class PluginController < ApplicationController
|
||||||
|
|
||||||
buffer << user.steamid
|
buffer << user.steamid
|
||||||
buffer << user.username
|
buffer << user.username
|
||||||
buffer << user.lastip
|
buffer << '0.0.0.0'
|
||||||
buffer << (user.team ? Verification.uncrap(user.team.to_s) : "No Team")
|
buffer << (user.team ? Verification.uncrap(user.team.to_s) : "No Team")
|
||||||
buffer << user.id
|
buffer << user.id
|
||||||
buffer << user.team_id
|
buffer << user.team_id
|
||||||
|
|
29
spec/controllers/plugin/plugin_controller_spec.rb
Normal file
29
spec/controllers/plugin/plugin_controller_spec.rb
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe PluginController do
|
||||||
|
render_views
|
||||||
|
|
||||||
|
describe '#user' do
|
||||||
|
before do
|
||||||
|
create :group, :donors
|
||||||
|
create :group, :champions
|
||||||
|
end
|
||||||
|
|
||||||
|
let!(:user) { create :user_with_team }
|
||||||
|
|
||||||
|
it 'returns user data' do
|
||||||
|
get :user, id: user.steamid
|
||||||
|
expect(response).to be_success
|
||||||
|
expect(response.body).to include(user.username)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'definitely does not return IP address' do
|
||||||
|
last_ip = '127.0.0.1'
|
||||||
|
user.lastip = last_ip
|
||||||
|
user.save!
|
||||||
|
get :user, id: user.steamid
|
||||||
|
expect(response).to be_success
|
||||||
|
expect(response).to_not include(last_ip)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue