Log in

View Full Version : Sitewide use of VB permissions


MkJnr
11-22-2003, 09:37 PM
Had a quick browse round these forums and what I gather is that to use the VB member permissions etc throughout your site you would just have to include external.php into your page. Do you then have to write your own queries to use that or is there a way to access the existing functions?

e.g. How would you check that someone is in the usergroup which is allowed to access a certain page? Or could you allow someone to login from a non forum page?

Thanks in advance,

Mark

Xenon
11-23-2003, 10:56 AM
all you need is to import global.php, with that file you can use the complete permission system of vb :)

MkJnr
11-23-2003, 06:33 PM
I tried to import it like so from my file:


chdir("$DOCUMENT_ROOT/forum/");
require_once("./global.php");


But then it comes with this error:


Warning: main(./includes/init.php): failed to open stream: No such file or directory in <.Dir to forum folder>/global.php on line 18

Fatal error: main(): Failed opening required './includes/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in <.Dir to forum folder>/global.php on line 18

insanctus
11-23-2003, 08:58 PM
chdir('./../forum/');
require_once('./global.php');

Try that..

wce
12-08-2005, 03:43 PM
I tried this including global.php, and it works to get the cookie data of the user, but it doesn't seem to be updating the session to keep users logged in when they're on non-vb pages.... so when they go back to the forum, if its been longer than the cookie timeout, they're no longer logged into the forums.... any ideas?

Andreas
12-08-2005, 03:47 PM
That's expected behaviour if they don't have userid/password cookies.
There is no way around this, except increasing cookie timeout :)

wce
12-08-2005, 03:53 PM
they would have userid and password cookies wouldn't they? Well, not individual cookies but doesn't the vb cookie store the userid and the password? theres no way to update the cookie to keep them 'active'? even if it's a code snippet or something that I need to throw into my non-vb pages, i'd be glad to do it if I could figure out where in VB it updates the cookie to keep the user active :)