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)

Oldfart 05-26-2004 12:00 AM

Ok I am trying this hack on my site but I seem to be getting a Sql error. The password logon comes up on the screen but when you hit the ok button after putting your logins in I get this Sql error message.

Warning: mysql_connect(): Unknown MySQL Server Host 'u' (1) in /home/xxxxxx/public_html/vwar/includes/classes/class_db.php on line 95

-> Database Error: Link-ID == false, connect failed
-> MySQL Error:
-> MySQL Error Number: 0
-> Date: 25.05.2004 @ 20:56
-> Script: /vwar/war.php
-> Referer:

Any help would be appreciated.

Are we supposed to run any Sql querries installing this?

if (isset( $PHP_AUTH_USER ) && isset($PHP_AUTH_PW)) {
mysql_connect( $checkservername, $dbcheckusername, $dbcheckpassword )
or die ( 'Unable to connect to server.' );
mysql_select_db( $dbcheckbase )
or die ( 'Unable to select database.' );

maximux1 05-26-2004 12:56 AM

Quote:

Originally Posted by Oldfart
Ok I am trying this hack on my site but I seem to be getting a Sql error. The password logon comes up on the screen but when you hit the ok button after putting your logins in I get this Sql error message.

Warning: mysql_connect(): Unknown MySQL Server Host 'u' (1) in /home/xxxxxx/public_html/vwar/includes/classes/class_db.php on line 95

-> Database Error: Link-ID == false, connect failed
-> MySQL Error:
-> MySQL Error Number: 0
-> Date: 25.05.2004 @ 20:56
-> Script: /vwar/war.php
-> Referer:

Any help would be appreciated.

Are we supposed to run any Sql querries installing this? It looks like you have the server set to "u" when more likely you want to set it to localhost.

if (isset( $PHP_AUTH_USER ) && isset($PHP_AUTH_PW)) {
mysql_connect( $checkservername, $dbcheckusername, $dbcheckpassword )
or die ( 'Unable to connect to server.' );
mysql_select_db( $dbcheckbase )
or die ( 'Unable to select database.' );

Whats the hostname of your mySQL server? Looks like it is currently set to "u" when you more likely want this to be "localhost".

Oldfart 05-26-2004 01:27 AM

My db is set to "localhost"

I have no idea why this happens. I must be doing something wrong.

I put my db settings in the authvb.php and put the require('./authvb.php');
in the page I want to secure but whenever I try and access that page I keep getting the same MySql error.

Oldfart 05-26-2004 06:03 PM

anyone have any ideas... I would like to get this to work on my site. ANy help would be appreciated. :)

Rafe 05-26-2004 07:22 PM

Quote:

Originally Posted by evilTone
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

I'll look into this for the next version (sorry a bit busy right now), but I haven't forgotten this.

TheRayden 05-29-2004 07:40 PM

Installed it, but I can't even access the page I protected. I've set to it allow 2 usergroups to enter, admins being one of them.

When i try to access the page, I get the username/password popup, but it doesn't reconise me.

ogetbilo 05-29-2004 11:05 PM

what advantage does this hack have over an .htaccess password?

xeonkiller711 07-23-2004 03:05 PM

Make sure on the authtest.php you change the authvb3 to authvb.php just in case you guys didnt change that. Thats the only thing I saw wrong with the hack :D Thanks for the hack!

misterfade 08-13-2004 11:14 AM

I can't believe how easy this hack looks! I just installed it and it looks fantastic. I did add a few extra usergroups (for my purposes), so it would be like this:

Code:

usergroupid = '2' or usergroupid = '5' or usergroupid = '6' or usergroupid = '7'
Just in case anyone wanted to know how to add extra usergroups.

*clicks install

Code Monkey 08-15-2004 11:56 PM

If you have a newer version of PHP which disables global var tracking (a good thing) then replace $PHP_AUTH_USER with $_SERVER['PHP_AUTH_USER'] and $PHP_AUTH_PW with $_SERVER['PHP_AUTH_PW'] and you should be good to go.


All times are GMT. The time now is 09:22 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.01449 seconds
  • Memory Usage 1,740KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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