vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Custom page login issue (https://vborg.vbsupport.ru/showthread.php?t=315802)

Alvar 12-03-2014 06:40 PM

Custom page login issue
 
Ive created custom page that has login...
when I login it loads and when the loading is done, it still shows logged out, exept if I go to vBulletin page that is not custom made, then I'm logged in... when ever I go to my custom page then I'm back to logged out, but actually I'm logged in but showing logged out...

My custom page is outaide vBulletin installation folder called "forum"

Lynne 12-03-2014 06:59 PM

If it's outside the /forum directory, then you probably need to move a bunch of required files to outside the /forum directory also. You should use a browser webmaster tool to see which files aren't being called by your script (assuming you used the tutorial in the vB4 Articles section to create the custom page).

nerbert 12-03-2014 07:34 PM

I can never get it straight how error messages are controlled so in every project I build I put this at the top
Code:

ini_set('display_errors', 1);
If some file isn't available you'll get a "failed to open stream" error message. I assume you have somehow required global.php. It in turn requires several other files. Maybe global can't get the right path or something.

Then after your required files I would put in

Code:

echo 'userid = ' . $vbulletin->userinfo['userid'];
That way you can see if it knows who you are.

Alvar 12-04-2014 02:23 PM

:eek: Ok, now I'm stuck there...
Code:

userid = Unable to add cookies, header already sent.
File: /home/domain/public_html/index.php
Line: 3


nerbert 12-04-2014 02:48 PM

Well, my echo line isn't working. I think it doesn't know your userid.

Try a plugin in "load_show_variables", and put that echo line in there and comment it out in your custom file.

Try it just once and then turn off the plugin or it will echo that on every page. It should take just a few seconds

Alvar 12-04-2014 03:29 PM

I see header, navbar... everything, but still shows me as "not logged in" :) but actually I'm logged it.

nerbert 12-04-2014 03:39 PM

If you don't see "userid = " above the regular page styling I suspect includes/class_bootstrap.php did not open a stream.

Does it show on other pages? If so turn off that plugin so it doesn't interfer with other pages

Alvar 12-04-2014 03:44 PM

on my custom page it says:
userid = 0

in normal vB4 pages userid = 1

nerbert 12-04-2014 03:47 PM

OK, that means it thinks you are a guest. So apparently it isn't reading your cookies. I'm not sure where it's supposed to do that but I'll have a look

Alvar 12-04-2014 03:52 PM

oky, thx, will wait

kh99 12-04-2014 03:57 PM

It could be the cookies aren't being sent. What do you have for Settings > Options > Cookies and HTTP Header Options > Path to Save Cookies? But if you're logging in from your custom page and the cookie path is wrong, I don't know how you'd be logged in on other forum pages.

Alvar 12-04-2014 04:04 PM

Quote:

Originally Posted by kh99 (Post 2525616)
It could be the cookies aren't being sent. What do you have for Settings > Options > Cookies and HTTP Header Options > Path to Save Cookies? But if you're logging in from your custom page and the cookie path is wrong, I don't know how you'd be logged in on other forum pages.

Path to Save Cookies: forum
(from the dropdown menu)
should I do something in "Custom Setting"

my custom page has no directory/folder

kh99 12-04-2014 04:15 PM

You could try choosing '/' from the dropdown menu, as long as you aren't running 2 forums from the same domain name.

Alvar 12-04-2014 04:20 PM

Quote:

Originally Posted by kh99 (Post 2525623)
You could try choosing '/' from the dropdown menu, as long as you aren't running 2 forums from the same domain name.

OK, so that was the issue I had, it works now wery well, thank you kh99 :up:
happy face now :)

nerbert 12-04-2014 04:30 PM

Well, so far I've found it's supposed to read your userid cookie on line 647 of includes/init.php. From there it should get all your userinfo.

I don't know how to test if it's got a problem reading the cookie


All times are GMT. The time now is 06:40 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.01811 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)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