PDA

View Full Version : using the PHP::Interpreter Perl module


denby
06-23-2006, 01:41 PM
I have a review scipt written in Perl and I want to validate users' login status using the $vbulletin->userinfo['userid'] value: if it's not zero then I let them in. I decided to try using the embedded php intrepreter Perl module (http://search.cpan.org/dist/PHP-Interpreter/) and the basic functionality is OK but it seems to give a zero result all the time instead of only when I'm logged out.

I'm wondering whether when this module is instantiated it loses sight of the GPC array by operating in a new environment. Has anyone else tried this Perl module? Is there another way I can check the user login status (apart from cookie detecting)? I'd prefer a solution that is independant of cookies because they are open to abuse.

Paul M
06-23-2006, 07:05 PM
Ultimately you are going to have to use the vb cookie, as that's how vb works. Can your script query the vb database ? if so you could pull the session id from the cookie and query the vb session table to find the userid of that session.

denby
06-23-2006, 08:07 PM
I can access the vb3_userid cookie already. Oh well. Thanks anyway.

Paul M
06-23-2006, 08:29 PM
The userid cookie is easy to fake, the session id is not.

denby
06-23-2006, 08:35 PM
Yes well that's true. OK good tip. Thanks. :)