Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 03-25-2012, 01:55 PM
hgb hgb is offline
 
Join Date: Nov 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 03-26-2012, 09:41 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 03-26-2012, 04:34 PM
hgb hgb is offline
 
Join Date: Nov 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
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
Reply With Quote
  #4  
Old 03-26-2012, 07:48 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 03-26-2012, 08:53 PM
hgb hgb is offline
 
Join Date: Nov 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
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
Reply With Quote
  #6  
Old 03-26-2012, 10:26 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 03-26-2012, 11:33 PM
hgb hgb is offline
 
Join Date: Nov 2005
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

top of the day to you
Reply With Quote
Благодарность от:
BirdOPrey5
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:16 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07192 seconds
  • Memory Usage 2,232KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (1)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete