vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=100992)

Snatch 03-22-2006 10:36 AM

I get this Error

Code:

Notice: Undefined index: HTTP_REFERER in /var/www/web1/html/vb3/includes/class_core.php on line 1574
And this ist my index.php
PHP Code:

<?php
chdir
('/var/www/web1/html/vb3');  
require_once(
'/var/www/web1/html/vb3/global.php');  
?>
<html>  
<body>  
<?php
/************************************************\
 * File Uploader
 * **********************************************
 * File Name    : index.php
 * Author       : Tuan Do @ [url]www.celerondude.com[/url]
 * Email        : [email]dork@celerondude.com[/email]
 * Purpose      : load actions
\************************************************/

 
require_once('/var/www/web1/html/test/login_inc.php');
   
//-----------------------------------------------
// Initialize some stuff
//-----------------------------------------------
ob_start('ob_gzhandler');
error_reporting(E_ALL);
define('UPLOADER'1);

//-----------------------------------------------
// Require neccessary files and initialize objects
//-----------------------------------------------
require_once('includes/common.inc.php');
require_once(
'includes/template.class.php');
require_once(
'includes/functions.inc.php');
$Template = new Template('templates');
$Template->_cache 1;
$Template->_cache_dir 'cache/';
$start timer();


  
//-----------------------------------------------
// Load the settings file
//-----------------------------------------------
$Settings load_file($settings_file);


//-----------------------------------------------
// Files to include and the action
//-----------------------------------------------
$includes = array(
                    
'default'               => 'uploader.php',
                    
'login'                 => 'login.php',
                    
'logout'                => 'logout.php',
                    
'register'              => 'register.php',
                    
'lostpassword'          => 'lostpassword.php',
                    
'browse'                => 'browse.php',
                    
'viewfiles'             => 'viewfiles.php',
                    
'changepassword'        => 'changepassword.php',
                );
if( !isset(
$_GET['action']) || empty($_GET['action']) || !isset($includes[$_GET['action']]) )
{
    
$action 'default';
}
else
{
    
$action =& $_GET['action'];
}

//-----------------------------------------------
// Authenticate user
//----------------------------------------------- 
$banned [] = 'x.x.x.x';
$banned [] = 'x.x.x.x';
$banned [] = 'x.x.x';

if ( 
in_array $_SERVER['REMOTE_ADDR'], $banned ) )
{
    
show_message('Access Denied''Your IP address has been restricted from accessing this uploader.'1);

    
$Template->display('index.tpl');
    
    exit;
}
$logged_in 0;
if(
$Settings['password_required'] && $action != 'register' && $action != 'lostpassword' && $action != 'login' && $action != 'lostpassword')
{
    
session_start();
    if(!isset(
$_SESSION['uploader_username']))
    {
        if(isset(
$_COOKIE['uploader_userid']) && isset($_COOKIE['uploader_password']))
        {
            
$user authenticate_by_id($_COOKIE['uploader_userid'], $_COOKIE['uploader_password']);
            if(!
$user)
            {
                
$action 'login';
            }
            else
            {
                
$logged_in 1;
                
$current_user $user['username'];
                
$Template->assign('logged_in'1);
            }
        }
        else
        {
            
$action 'login';
        }
    }
    else
    {
        
$current_user $_SESSION['uploader_username'];
        
$logged_in 1;
        
$Template->assign('logged_in'1);
    }
}


//-----------------------------------------------
// Load action file.
//-----------------------------------------------
require( 'includes/' $includes[$action]);

//-----------------------------------------------
// Included files made changes to the template
// Now print everything
//-----------------------------------------------
if($Settings['password_required'] && !$logged_in)
{
    
$Template->assign('noheader'1);
}

$Template->assign('runtime'timer($start) );
$Template->display('index.tpl');
?>
</body>  
</html>

GreeTz
Snatch

nestoras 04-06-2006 01:15 AM

i have just install this!
1 problem!
i have this too
i have done everything you say but no fix!

Billspaintball 04-14-2006 01:26 PM

Sorry about the lack of support.
We have just had a new addition to the family 3 weeks ago and Ive been kinda busy.

Billspaintball 04-14-2006 01:32 PM

Quote:

Originally Posted by Snatch
I get this Error

I think its almost certainly a conflict because of something else you have on the page.

Have you tried section 5 of the troubleshooting guide to rule out other scripts interfearing?

Spinball 04-21-2006 11:13 PM

I'm having the same problems.
PHP Code:

<?php
   chdir
("/home/sites/avforums/public_html/forums");
   require_once(
'../forums/global.php');  
require_once(
'/home/sites/avplay/public_html/login_inc.php');
$allowed_userids "1";
$allowed_users explode(",",$allowed_userids);
if (!(
in_array($vbulletin->userinfo['userid'],$allowed_users))) {
   echo (
"<P align='center'>Sorry but you do not have permission to access this page.</P>");
   include (
"/home/sites/avplay/public_html/footer.php");
   exit();
}

chdir("/home/sites/avplay/public_html");

...avforums.com and avplay.com are both on the same server and AV Forrums has been set up with the cookie path being / and cookie domain being .avforums.com.

Keeps saying I'm not allowed in, and when I print_r $vbulletin->userinfo is returns a userd of 0.
Help!

Billspaintball 04-22-2006 04:56 AM

Have you tried just the sample code in "Troubleshooting - step 5" yet?
(refer to this post https://vborg.vbsupport.ru/showpost....98&postcount=2 )

If so, what happened?

Spinball 04-22-2006 07:38 AM

Quote:

Originally Posted by Billspaintball
Have you tried just the sample code in "Troubleshooting - step 5" yet?
(refer to this post https://vborg.vbsupport.ru/showpost....98&postcount=2 )

If so, what happened?

Yep - the same happened. Using vB 3.5.4
PHP Code:

<?php 
chdir
('/home/sites/avforums/public_html/forums'); 
require_once(
'/home/sites/avforums/public_html/forums/global.php'); 
?> 
<html> 
<body> 
This is a heading<br /> 
This is some more stuff <br /> 
And another line<br /> 
You get the idea<br /> 
Just place stuff as you normally would with HTML<br /> 
I use CSS to style and position on my site fwiw<br /> 
<br /> 
How about we put the login box right under here?<br /> 
<br /> 
<?php 
    
require_once('/home/sites/avforums/public_html/login_inc.php'); 
print_r($vbulletin->userinfo);

?> 
</body> 
</html>

Uploaded to www.avforums.com it works perfectly. Uploaded to www.avplay.com it does not. I get the 'Thanks for loggin in' message followed by the login request.
The contents of $vbulletin->userinfo are not being filled when the script is on avplay.com.

Billspaintball 04-23-2006 11:11 AM

Im pretty sure its related to cookies somehow.

Do both your forums use the same cookie prefix?

Spinball 04-23-2006 11:21 AM

Quote:

Originally Posted by Billspaintball
Im pretty sure its related to cookies somehow.

Do both your forums use the same cookie prefix?

I agree with you Bill. AVPplay.com is not a forum and there is no cookie manipulation on the website.

Spinball 04-27-2006 06:39 PM

Anyone got any ideas on this one? Can this hack work on a website on the same server but with a different domain?


All times are GMT. The time now is 10:41 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.02127 seconds
  • Memory Usage 1,793KB
  • 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_code_printable
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (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