vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Ban Browser (https://vborg.vbsupport.ru/showthread.php?t=53259)

DelFDgfd_gT 05-23-2003 01:16 AM

Ban Browser
 
Im sessions table in PHPMyAdmin You can view browsers. I wanted to know, How can I can a certain browser from my forums?
Seems small and easy, can anyone help?

Erwin 05-23-2003 01:28 AM

Are you sure?

You can add this to the bottom of your "phpinclude" template:

To allow IE only:

PHP Code:

if (!eregi("MSIE",$HTTP_USER_AGENT)) show_nopermission(); 

To allow Netscape only:

PHP Code:

if (!eregi("Netscape",$HTTP_USER_AGENT)) show_nopermission(); 

To allow Mozilla only:

PHP Code:

if (!eregi("Mozilla",$HTTP_USER_AGENT)) show_nopermission(); 


filburt1 05-23-2003 01:59 AM

:eek: For shame, using the ereg functions!

Better (according to php.net):
PHP Code:

if (preg_match("/.*MSIE.*/siU"$_SERVER['HTTP_USER_AGENT'])) show_nopermission(); 

Faster (according to my completely untested theories):
PHP Code:

if (strpos("MSIE"$_SERVER['HTTP_USER_AGENT']) != falseshow_nopermission(); 


DelFDgfd_gT 05-23-2003 11:31 PM

Actually, I didnt wanna "allow IE only" or "allow mozilla only" thats completely irrelevant to what I asked.

What I want is to BAN a user using the browser:
Quote:

Internet Explorer V Hohoh , i bet you wish you knew :) ++++ you though.
Block browsers. :)

Linux 08-30-2003 08:49 PM

Hi

I am not sure but this is a pseuocode if some one can recheck it will be grateful


PHP Code:

$agent $_SERVER['HTTP_USER_AGENT'];
    if(
$agent == "AGENT_NAME"){
        
header("Location:htt p : //url_to_e-direct_the_user");
        exit();
    } 

change AGENT_NAME to whatever brower you want to ban

for ex : IE = Mozilla/4.0

NTLDR 08-30-2003 08:58 PM

Provided that AGENT_NAME is the full name and not a subsring of it like Mozilla/4.0 then that will work fine.

Linux 08-31-2003 03:20 AM

yes

You must Provided the full name of the AGENT

for example you cannot just add WebCopier

it must be WebCopier v3.5


All times are GMT. The time now is 10:54 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.00987 seconds
  • Memory Usage 1,739KB
  • 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
  • (6)bbcode_php_printable
  • (1)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