vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Password protect non vb pages (e.g. for admin pages) (https://vborg.vbsupport.ru/showthread.php?t=64914)

Rafe 05-08-2004 10:00 PM

Password protect non vb pages (e.g. for admin pages)
 
This is not really a hack just a handy piece of code. You can use this to password protect individual pages. The username and passwords are taken from the vBulletin database.

Currently this is set to allow only usergroupsid 5 and 6 (admin and super moderators) through [example use as admin area protection]. This could be changed though to allow anyone through if registered, or for specific usergroups etc.

The code is in authvb.php
An example is give in authtest.php

Hope this is of use to some people. If there's some interest I'll tidy it up a bit.

!!!cyr0n_k0r 05-09-2004 05:38 PM

suppose I have a directory of my site with videos in it.

would putting this hack on the page to download the videos prevent people from direct linking to them or downloading them in any other way?

Rafe 05-09-2004 08:15 PM

Quote:

Originally Posted by !!!cyr0n_k0r
suppose I have a directory of my site with videos in it.

would putting this hack on the page to download the videos prevent people from direct linking to them or downloading them in any other way?

No it wouldn't prevent that. This really only protects individual pages.

Zachariah 05-10-2004 01:08 AM

thank you ! Great idea to make static pages w/ content seen by usergroups.

:banana:

/me Installs ..

dcevoclub 05-10-2004 12:15 PM

i'm using it for this now... if i could only integrate all this stuff into vb

http://video.dcevoclub.com

maximux1 05-13-2004 02:32 AM

This is beautiful in its simplicity.

I have integrated your vbauth hack into my Automated vBNews Programming Interface (AvPI) to allow only front page Administrators to be able to access the programmed articles administration page.

I was delightfully surprised to find that I was able to populate most of my fields based on the HTTP auth entry. Changed those text fields to hidden fields and greeted the user by name upon entry.

Great administrative tool - I can see lots more uses for this!

Thanks!

The Watcher 05-16-2004 10:49 AM

Hi there

If a user logs into the HTTP auth protected area, is there a way to make them appear in the Online users list in vb?

Perhaps adding a superscript E at the end of their name to signfy that they are logged into an external page/area?

!!!cyr0n_k0r 05-20-2004 12:13 AM

Quote:

Originally Posted by dcevoclub
i'm using it for this now... if i could only integrate all this stuff into vb

http://video.dcevoclub.com

so it seems you have adapted this to do exactly what I want to.
The only problem is.. what is the people know the exact path on the server?
Will the htaccess STILL prevent them from accessing the directory?

!!!cyr0n_k0r 05-20-2004 12:38 AM

rafe, Im not a php guru.. give some better instructions on how to install this hack.

evilTone 05-20-2004 09:08 AM

Code:

// Check whether user belongs to certain usergroup 5 for supermoderators 6 for admins

$sql = "SELECT * FROM user WHERE username = '$PHP_AUTH_USER' AND (usergroupid = '6' or usergroupid = '5') "; $result = mysql_query( $sql ) or die ( 'Unable to execute query.' ); $num = mysql_numrows( $result ); if ( $num != 0 ) { $auth = true;    }

anyone have a way to make this check for secondary groups like
(membergroupids = '5' or membergroupids ='16')

the above seems to work ONLY if the user is in 5 or 16 as their only secondary group, ie, if users secondary groups are = 5,11,13 then it fails


All times are GMT. The time now is 12:19 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.01875 seconds
  • Memory Usage 1,738KB
  • 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_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete