View Single Post
  #174  
Old 08-01-2006, 12:35 AM
Evoir Evoir is offline
 
Join Date: Nov 2001
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Billspaintball, First, thanks for writing this script and giving everyone a hand with it. I'm hoping that you can help me figure out what's going on.... I am unable to get it to work. I've read the troubleshooting guide and tried everything, and read all 12 pages of this thread. One other person was having this exact trouble, too, but it didn't seem to get resolved. Oh, I am using an IP address because the site is not live yet, it is in development. There are no subdomains.

Here's what happens.

I uploaded the file to here and I get the standard vB login screen. When I login, I get redirected to http://69.5.17.244/login.php, which produces an error because that file does not exist.

If I am logged in before I go to the above url, I see the actual html as if I am logged in. If I logout, I get redirected to vB logout screen. I click "return to previous screen" and I get sent to a standard vB login. When I attempot to login, I get redirected to /login.php which doesn't exist. (loop)

I have used your little script that gives you the path, and am using that path in the scripts below. I have tried changing the cookie path etc in your troubleshooting guide. I am really hoping to be able to use your script to limit access to non vB pages based on usergroup.

Here's my code (using your test code with my paths):
Code:
<?php 
chdir('/big/dom/xc5children/www/forums'); 
require_once('/big/dom/xc5children/www/forums/global.php'); 
?> 
<html> 
<body> 
<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo "This is only visible to people in usergroup 6";}
    ?> 

<?php 
    require_once('/big/dom/xc5children/www/login_inc.php'); 
?> 
</body> 
</html>
and login_inc.php
Code:
<?php
// Edit the line below to show path to your forums
$forumpath = "/big/dom/xc5children/www/forums";


// You dont have to edit anything underneath here,
// but you can if you wish to style the login box
// to match the style of your site.


// We check if user is logged in
if ($vbulletin->userinfo['userid']!=0) {

// If Logged in display welcome back message
echo "Welcome Back, <b>";
echo $vbulletin->userinfo['username'];
echo " !</b><br>";

// If logged in display logout link
echo "<a href=\"".$forumpath."login.php?$session[sessionurl]do=logout&amp;logouthash=$logouthash";
echo $vbulletin->userinfo['logouthash'];
echo "\">";
echo "<font size=\"1\" face=\"verdana\">Log Out</font></a>
";

} else { // If user is not logged in, we do this stuff

// Display text and link to register.
echo "
	You have to <a href=\"".$forumpath."/register.php?s=$session[sessionhash]\"
	target=\"_parent\"><b>register</b></a>  before you can post on our forums or use our advanced features.
	";

// Display login boxes + button
// You can style this with html or CSS as normal if desired.
echo"
	<form action=\"".$forumpath."/login.php\" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)>
	<script type=text/javascript src=\"".$forumpath."/clientscript/vbulletin_md5.js\"></script>
	User Name:<br>
	<input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '$vbphrase[username]') this.value = ''; size=10 />
			
	<br>Password2:<br>
	<input name=vb_login_password type=password size=10 />
	</br>
		
	<label for=cb_cookieuser_navbar><input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked />
	Remember Me?<br /></label>
	
		
	<input type=submit title=$vbphrase[enter_username_to_login_or_register] value=\"Log In\" />
		
	<input type=hidden name=s value=$session[sessionhash] />
	<input type=hidden name=do value=login />		
	<input type=hidden name=vb_login_md5password />
	<input type=hidden name=vb_login_md5password_utf />

	</form>
";

}
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01217 seconds
  • Memory Usage 1,784KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete