Martin-S - 2005-09-28 16:31:09
I Olaf,
First I'd like to say thank's for the great script.
I'm having problem protect page in other directory.
The class is in /users/
the pages to be protected are in /admin/
I use the following code to protect the menu page /admin/index.php
include($_SERVER['DOCUMENT_ROOT']."/users/access_user_class.php");
$test_page_protect = new Access_user;
$test_page_protect->login_page = "../users/login.php";
$test_page_protect->access_page($_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING'],5);
if (isset($_GET['action']) && $_GET['action'] == "log_out"){
$test_page_protect->log_out(); // the method to log off
}
/admin/index.php has a link to other pages: /admin/go.php
protected whit the same code.
/admin/index.php redirect me to the /users/login.php, I then login and the /admin/index.php page load. So far so good.
After accessing the page go.php from the menu page, if I go back to /admin/index.php I get Access denied!
Help please
Thanks,
Martin