Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 07-29-2002, 05:09 PM
C.Birch C.Birch is offline
 
Join Date: Apr 2002
Posts: 459
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help big time

Right i have no idea how to go about this but basicy i want to password some areas of my site useing my vb database info.

The site and board are on same host server but not the same domain.

i want to make it so if you try to get to a page that you needed to be signed in for its shows you a login page but if your loged in it takes you right to the real page, also if your logged out and you login on that page i want it so it takes you to that page and not back to the main index page.

I already have it working useing a php/mysql login i found but it does not use my vb database where has thats who i want it working save people having to sign up 2 times.

code im useing right now on a page that needs you to be logged in to view is this:

PHP Code:

<?php
include "auth.php";  // always include this, always.
$USER=new user('',$user_name,$id_hash,'','','','');
if (
$USER->islogged_in()) {
  
site_header('Welcome back!');

?> 

//Main page html code goes here

<?
  account_links(); // shows account links from functions.inc
  site_footer();
} else {
  site_header('Welcome');
  login_form();  // displays login form if not logged in
  site_footer();
 }
?>
Reply With Quote
  #2  
Old 07-30-2002, 05:41 AM
JulianD's Avatar
JulianD JulianD is offline
 
Join Date: Jan 2002
Posts: 455
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can include the global.php file from your VB installation, and then use a simple IF to determine the usergroupid of the logged user:

PHP Code:
<?php

require("path/to/vbulletin/global.php");

if (
$bbuserinfo["usergroupid"]==6) { // is admin
  //misc stuff
} elseif ($bbuserinfo["usergroupid"]==1) { // a guest
  //stuff only for guests
}
something like that... Just sneak into the vbulletin files, and you will learn how to identify an user!

Hope this helps!
Reply With Quote
  #3  
Old 07-30-2002, 08:37 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you may want to take a look at this hack too, if your secured pages are HTML, not PHP..
Reply With Quote
  #4  
Old 07-30-2002, 03:53 PM
C.Birch C.Birch is offline
 
Join Date: Apr 2002
Posts: 459
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hehe i already found that hack deep down the lists last night after this post it works great thanx just what i wanted but is there a way to edit it so the templates pages can be called for from a address out side of the boards?

because my site is at www.ultimatesteps.com and my boards at www.ultimate-forums.co.uk? this way i can still keep the same address showing.

i guess i could use a mysql database to hide the address's but there most be a easyer way. that takes less time.
Reply With Quote
  #5  
Old 07-30-2002, 04:25 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well I can't think an easy way. BTW how do you plan to use "mysql database" to hide the address, I didnt get it?
Reply With Quote
  #6  
Old 07-30-2002, 04:39 PM
C.Birch C.Birch is offline
 
Join Date: Apr 2002
Posts: 459
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you can set up a data base and some php code to call from the data base and basicy you can turn a address in to the domain address with just a id number, its used to make long page address's short but it could be used to hide the address.

eg:

https://vborg.vbsupport.ru/hdhd/dhdh...howthread.php?

could get turn it to

http://www.vbulletin.org/yourphp.php=id1

im not up to speed with the full codeing but i know it can be done.
Reply With Quote
  #7  
Old 07-31-2002, 11:55 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You dont need a database to do it, it's a little .htaccess redirect trick. However AFAIK .htaccess redirect changes the URL to the latter after the redirection. So for example if in your address bar you write:

https://vborg.vbsupport.ru/hdhd...showthread.php?

you are automatically moved to

http://www.vbulletin.org/yourphp.php=id1

if set in .htaccess, but right after the redirection, your URL line will be read as:

http://www.vbulletin.org/yourphp.php=id1

as well..I'm not aware if there is an advanced tip to prevent this behaviour..
Reply With Quote
Reply

Thread Tools
Display Modes

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 12:46 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04450 seconds
  • Memory Usage 2,223KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete