Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
Details »»

Version: , by odell (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 05-03-2001 Last Update: Never Installs: 0
 
No support by the author.

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);
}

?>

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 09-11-2001, 10:51 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A simple method:

PHP Code:
/* get user auth information into an array ie $userpass['username'] = pass */

if($userpass[$PHP_AUTH_USER] == $PHP_AUTH_PW)
{
continue;
}
else
{
//send headers to cause browser to request user and pass from user
header("WWW-authenticate: Basic realm=\"realm name\"");
header("HTTP/1.0 401 Unauthorized");

print(
"notice that the user isnt authorised");

Reply With Quote
  #23  
Old 09-11-2001, 10:14 PM
fragbait fragbait is offline
 
Join Date: Mar 2002
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

heh i dont have access to editing apache modules for my server, but merk, i was actually look for a php method, do i just put that into a script, and it works, don i have to have any modules?
Reply With Quote
  #24  
Old 09-12-2001, 01:22 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see no need for this hack, but no, thats a simple bit

you would need to add more code.

Im really not going to bother because this hack is basically pointless
Reply With Quote
  #25  
Old 09-12-2001, 01:38 AM
fragbait fragbait is offline
 
Join Date: Mar 2002
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh ok thanks anyway, anybody think they can finish this?
Reply With Quote
  #26  
Old 09-12-2001, 01:39 AM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

fragbait,

Could you please enter your vB license info into your use profile? See my sig for details. Thanks.
Reply With Quote
  #27  
Old 09-12-2001, 04:30 AM
fragbait fragbait is offline
 
Join Date: Mar 2002
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry, im makin this script for the vbb board of someone else, ill try to ask him for his lisence, wait that wouldnt be right, ill try to get him to come post it i guess, k lemme mail him now....
Reply With Quote
Reply

Thread Tools

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 03:43 PM.


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.04718 seconds
  • Memory Usage 2,286KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_imicons
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete