vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   pass username and id to a php page in vbulletin (https://vborg.vbsupport.ru/showthread.php?t=284246)

ohadpartuck 06-13-2012 06:54 AM

Actually, it's not working again...

here is the code

(it's working on the local host but not on the server)

PHP Code:

chdir('../Forum');
require_once(
'global.php');
$arr         $vbulletin->userinfo;
$usergroup     $arr['displaygroupid'];    
if (
$usergroup==""
    
$usergroup $arr['usergroupid'];
//change dir back
chdir('../backtomydir'); 

--------------- Added [DATE]1339582466[/DATE] at [TIME]1339582466[/TIME] ---------------

sorry.. it's not working I didn't check it right.. it's not working on the server

kh99 06-13-2012 10:34 AM

Hmm...what happens exactly? Are you getting global.php included successfully but you're not logged in? In the adminCP, in Options > Cookies and HTTP Header Options > Path to Save Cookies, you need to have the path set to '/' (but I believe that's the default). And you custom script is available through the same domain name, right?

ohadpartuck 06-13-2012 11:36 AM

the custom script is under the same domain name meaning
my script is on
www.myDomain.com/mydir
and the forum is on
www.myDomain.com/Forum

but the path to save cookies in set to /Forum/
as I see it.
Is that wrong?
i don't want to change it because there is a warning there that states
"Entering an invalid setting can leave you unable to login to your forum."

kh99 06-13-2012 11:41 AM

Quote:

Originally Posted by ohadpartuck (Post 2339245)
but the path to save cookies in set to /Forum/
as I see it.
Is that wrong?
i don't want to change it because there is a warning there that states
"Entering an invalid setting can leave you unable to login to your forum."

It's not "wrong", but I think it might be the problem. The cookie needs to be sent to for you to be "logged in", and since your script is not in /Forum/, the cookie's not getting sent and you're always going to appear logged out.

Changing it to / should be fine, in fact it should be one of the choices from the dropdown menu. If you have a live forum it might be that users will have to log in again even if they've chosen "Remember Me". If you do end up unable to log in (which I don't think is going to happen), you can upload tools.php (which should be in the "do not upload" folder of the distribution) and use that to reset the path.

ohadpartuck 06-13-2012 12:03 PM

Where is the path of "tools.php"?
I searched the whole Forum directory and the closest I've found is "usertools.php"
in the admicp folder.
and I don't see how my path to /Forum/ is saved there.

isn't that saved somewhere in the DB?

kh99 06-13-2012 12:10 PM

Sorry I wasn't clear. Forget about tools.php - it's a file that came with your vb package that you *would not* have uploaded, so you won't find it on your server.

ohadpartuck 06-13-2012 01:03 PM

so, I have no option of backing up if I indedd can't log in after this operation?

kh99 06-13-2012 01:45 PM

No, then you would need to find tools.php, it's just that I'm fairly certain that you won't have that problem.

If you download the distribution zip file for your version of vb (if you don't already have it). When you unzip it, there should be a "do_not_upload" folder, and in that folder there's a file named "tools.php". If you need to you can upload that to the admincp folder on you server, then in your browser go to "www.mysite.com/forum/admincp/tools.php" (using your own domain name and forum path, of course). You then need your customer number, the one you use to log in to the vbulletin.com customer area. After entering that, there's a "Reset Cookie Path" link you can use to reset it.

To make things more complicated, if you're running version vb4.2.0, tools.php doesn't work. Here's thread about that: https://www.vbulletin.com/forum/show...php-on-line-65 . If this applies to you and you want to make the change in the last post, that does appear to fix the issue.


All times are GMT. The time now is 02:12 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.01114 seconds
  • Memory Usage 1,739KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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