Posted on: 11/03/04 12:35am
By: gotascii
Ive searched the forum with every possible keyword combo, and Im sure that I still managed to miss the post that already covers this...but here goes...
I am using Gl as an intranet. I need to force every user to login before they can access ANY GL content. Is this possible and where should I start? Any hints or direction would be greatly appriciated. Thanks.
force login
Posted on: 11/03/04 10:35pm
By: gotascii
Ok I figured out a way to make this work but it seems like it needs some work. I have a feeling the general direction is right.
Add the following to the bottom of lib-common.php:
$subject = $_CONF['site_url'] . '/users.php';
$pattern = '/(http://[^/]*)(/.*)/';
preg_match($pattern, $subject, $matches);
if ((!isset($_USER['uid'])) && ($HTTP_SERVER_VARS['REQUEST_URI'] != $matches[2])) {
header('Location: ' . $_CONF['site_url'] . '/users.php');
}
This essentially restricts access to any php that includes lib-common (all of the docs in GL? ) except users.php. Any comments or suggestions?
force login
Posted on: 11/03/04 11:28pm
By: ScurvyDawg
Why not just use permissions?
GL has *nix style permissions, I would just utilize those rather than start a custom hack.
Good luck
force login
Posted on: 11/03/04 11:44pm
By: gotascii
Even if you set every object to only viewable you still get a blank looking index.php. Also, one can access calendar (even though it will be blank) and also the contacts page (with no contacts), etc. etc.. Those factors are not acceptable IMO when using the site as an intranet. My goal is to eventually point the redirect to a custom login page that shows only username & password prompt. SHouldn't be to hard, just create a simple form that matches loginform.thtml and points to user.php. It will be much more intranet like that way...I think hehe.