View Full Version : remove ip address block
vb 4.1.11
could someone point me to the template and code to remove to remove the ip address block in the user info in the admincp.
thanks
BirdOPrey5
03-26-2012, 09:41 AM
IP addresses are available in a number of places on the forum, not just the "user" page in admincp which I assume you are asking about.
What are you really trying to accomplish- maybe there is something better/easier then editing a file that will stop it in one spot but otherwise be useless as a security measure if that is the goal.
IP addresses are available in a number of places on the forum, not just the "user" page in admincp which I assume you are asking about.
What are you really trying to accomplish- maybe there is something better/easier then editing a file that will stop it in one spot but otherwise be useless as a security measure if that is the goal.
My goal is to stop all ip numbers from coming thru to the forum but for starters I would atleast like to remove the ip block on the user page in the admincp.
thanks
BirdOPrey5
03-26-2012, 07:48 PM
The forum needs ips to track bad login attemps, not sure what else it may be necessary for...
What about a scheduled task that runs every 10 minutes and deletes all saved ip addresses?
The forum needs ips to track bad login attemps, not sure what else it may be necessary for...
What about a scheduled task that runs every 10 minutes and deletes all saved ip addresses?
That might work but have never found a way to run a SQL querie via a cron job/scheduled task I have used THIS (https://vborg.vbsupport.ru/showpost.php?p=2074343&postcount=4) in the past via phpmyadmin but would love to hear your thoughts/input on the scheduled task option.
thanks
BirdOPrey5
03-26-2012, 10:26 PM
Well I haven't tested this because I like my IP addresses but I pulled code from my other working mods so i expect it should work.
Save this to a php file and upload it to your includes/cron/ directory.
In scheduled task manager make a new one and point it to this file, set what options you want.
Manually run it first to be sure it works, if it does set it to run every 10 minutes...
I'm not sure what other side effects this will have... User's shouldn't get locked out because they will still have their unique IP for a few minutes.
<?php
/*================================================= ===========================*\
|| # Basic Cron Script # ||
\*================================================ ============================*/
error_reporting(E_ALL & ~ E_NOTICE);
global $vbulletin;
//Main Script
$log = "";
//Erase all post ip addresses
$SQL = "UPDATE " . TABLE_PREFIX . "post
SET ipaddress = ''
WHERE ipaddress != '' ";
//RUn query above
$vbulletin->db->query_write($SQL);
$aff = $vbulletin->db->affected_rows();
$log .= "$aff Post IP Addresses Cleared. <br />";
//Erase all user ip addresses
$SQL = "UPDATE " . TABLE_PREFIX . "user
SET ipaddress = ''
WHERE ipaddress != '' ";
//RUn query above
$vbulletin->db->query_write($SQL);
$aff = $vbulletin->db->affected_rows();
$log .= "$aff User IP Addresses Cleared. <br />";
$log .= "IP purge Complete.";
log_cron_action($log, $nextitem);
?>
Obviously you should backup your database before running any untested code, especially database queries.
I assume this is for the site in your profile which is still very small (< 1000 posts) so I don't see this being a problem.
If you had a big site, like hundreds of thousands of posts and users or more this probably wouldn't run very efficiently trying to clear hundreds of thousands of records. But you should have no issue running it every 10 minutes.
This takes care of posts and user tables... if you have blogs or cms they would probably need to be included in separate queries.
that works perfect.... Thank you very much for taking the time to help me out.
top of the day to you
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.