vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   remove ip address block (https://vborg.vbsupport.ru/showthread.php?t=280634)

hgb 03-25-2012 01:55 PM

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.

hgb 03-26-2012 04:34 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2313411)
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?

hgb 03-26-2012 08:53 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2313580)
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 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 Code:

<?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.

hgb 03-26-2012 11:33 PM

that works perfect.... Thank you very much for taking the time to help me out.

top of the day to you


All times are GMT. The time now is 03:37 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01290 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete