vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   HTaccess integration hack... a beginning ? (https://vborg.vbsupport.ru/showthread.php?t=15873)

odell 05-03-2001 02:01 PM

It would be great if there were some hack to integrate vbulletin's user database with htaccess...

that would do the following things:[list=1][*]Vbulletin would seamlessly control htaccess as well as vbulletin user databases (for example.. u change password in vbulletin it also changes htaccess pass, or when u reg new user in vbulletin it would also create necessary htaccess user, etc..)[*]When users login with htaccess vbb automatically logs them in using the information that the user inputed for htaccess login[/list=1]

I just came across this script written for phpNuke that checks to see if a user logs in with htaccess and if they login with htaccess it will automatically log them in to phpNuke. I thought that much of this could be reused to work with vbulletin. Its only a portion of what would be required for a full htaccess integration hack but its a start anyway.

Im am just starting to learn php and dont have the necessary time or knowledge to create this hack but Im sure alot of ppl would benefit from it, and would all be very appreciateive if someone would create one. :)

Here is the source:

PHP Code:

<?PHP

/************************************************************************/
/*  Automatic recognition and connection of a user who connects to a    */
/*  PHPNuke site with a htaccess file.                                  */
/* ==================================================================== */
/*                                                                      */
/* Copyright (c) 2001 by Thomas Rudant (thomas.rudant@grunk.net)        */
/* [url]http://www.grunk.net[/url]                                                 */
/* [url]http://www.securite-internet.org[/url]                                     */
/*                                    */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/


if(!isset($mainfile)) { include("mainfile.php"); }

function 
docookie($setuid$setuname$setpass$setstorynum$setumode$setuorder$setthold$setnoscore$setublockon$settheme$setcommentmax) {
    
$info base64_encode("$setuid:$setuname:$setpass:$setstorynum:$setumode:$setuorder:$setthold:$setnoscore:$setublockon:$settheme:$setcommentmax");
    
setcookie("user","$info",time()+15552000);
    
    global 
$user;
    
$user=$info;
    
}

function 
login($uname$pass) {
    global 
$setinfo,$system;
    
dbconnect();
    
$result mysql_query("select pass, uid, storynum, umode, uorder, thold, noscore, ublockon, theme, commentmax from users where uname='$uname'");
    if(
mysql_num_rows($result)==1) {
        
$setinfo mysql_fetch_array($result);
        
$dbpass=$setinfo[pass];
        
        if(!
$system)
             
$pass=crypt($pass,substr($dbpass,0,2));

        if (
strcmp($dbpass,$pass)) {
                        
Header("Location: user.php?stop=1");
                        return;
                }

        
docookie($setinfo[uid], $uname$pass$setinfo[storynum], $setinfo[umode], $setinfo[uorder], $setinfo[thold], $setinfo[noscore], $setinfo[ublockon], $setinfo[theme], $setinfo[commentmax]);
    }
}

if (
$user)
{
    global 
$cookie;
    
    
cookiedecode($user);
    
$username $cookie[1];

    if (
$PHP_AUTH_USER!=$username)
    {
        
setcookie("user");
        
login ($PHP_AUTH_USER,$PHP_AUTH_PW);
    }
}
else
{
    
login ($PHP_AUTH_USER,$PHP_AUTH_PW);
}

?>


Mitrofan 05-05-2001 06:51 PM

If you need to protect directory with the password and only allow registered users to access it and to compare their ID/password with the info from Vbulletin database this can be done with mod_auth_mysql for apache.

It just uses mySQL database for authentication, you can set it to use forum database and user table.

I have this module installed on one of me servers and it also works together with mod_cookies, so if you have your ID/Pass saved in cookies, it does not even prompt you for password.

adrianmak 05-06-2001 11:16 PM

where can I download the mod_auth_mysql ?

Mitrofan 05-06-2001 11:24 PM

Go to http://modules.apache.org and search for it

There are couple of different mod_auth_mysql modules make sure you use the one that works with your version of Apache.

Raptor 06-27-2001 10:10 PM

could someone actually write this hack for us ?

max 06-27-2001 11:16 PM

What I'd like to have is a separate control page within VB control panel, that would let you administer your HTACCESS accounts. Without having to telnet or edit those rediculious .htaccess/.htpassword/.htgroup files.
(Not sure if this is possible though..)

Ruth 07-04-2001 04:47 PM

anyone has this hack?

thanks

Ruth 07-06-2001 12:15 AM

my host doesnt support mod_auth_mysql, is there anyway around the hack?

please i need it badly :(

adrianmak 07-06-2001 06:24 AM

I have downloaded and compile with DSO
how to enable in apache conf httpd.conf ?

Polo 07-07-2001 08:19 AM

<a href="http://www.widexl.com/" target="_blank">http://www.widexl.com/</a>

go here and they have a cgi script called members admin. It will let you add, edit and remove members through cgi. So this modifies the ht access and other required files as it goes along. it's very very good.

no, i don't work for them.

Polo


All times are GMT. The time now is 11:20 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.02288 seconds
  • Memory Usage 1,762KB
  • 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
  • (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