vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need help big time (https://vborg.vbsupport.ru/showthread.php?t=41661)

C.Birch 07-29-2002 05:09 PM

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


JulianD 07-30-2002 05:41 AM

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!

Logician 07-30-2002 08:37 AM

you may want to take a look at this hack too, if your secured pages are HTML, not PHP..

C.Birch 07-30-2002 03:53 PM

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.

Logician 07-30-2002 04:25 PM

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?

C.Birch 07-30-2002 04:39 PM

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.

Logician 07-31-2002 11:55 AM

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..


All times are GMT. The time now is 08:39 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.01036 seconds
  • Memory Usage 1,734KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete