Date: 01/25/00
- Next message: Davor Cengija: "Re: [PHPLIB] PHPLIB among multiple webservers."
- Previous message: Florian Gnägi: "Re: [PHPLIB] What is session cookie?????"
- Next in thread: Björn Schotte: "Re: [PHPLIB] Problem with page_open() inside my own function class"
- Reply: Björn Schotte: "Re: [PHPLIB] Problem with page_open() inside my own function class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I've got a slight problem ...
1.) installed PHPLIB on the local web server
2.) adding two fields in an existing user table and generating
some md5 hashes for user_id
3.) extended my own auto_prepend.php3 with including "prepend.php3"
from PHPLIB
I use a class to generate an easy layout for my Site. This class
is named phpcenter. It provides some functions for a horizontal
navigation bar etc. In this class, I set a function pheader() and
pfooter() which open my layout with tables and pfooter() closes
it etc.
Inside the pheader() function, I do the following:
function pheader() {
global $PHP_SELF,$sess,$auth;
if (!$this->notloggedin) {
page_open(array("sess")=>"phpcentersession","auth"=>"Example_Auth"));
}
echo "<html>";
.
.
.
}
I modified local.inc in that way:
function auth_loginform()
global $sess;
global $_PHPLIB;
global $phpcenter;
$phpcenter->notloggedin=true;
include($_PHPLIB["libdir"] . "loginform.ihtml");
}
Otherwise, if I didn't check if notloggedin was set, PHP got an
stack overflow in db_mysql.inc. I also modified the SQL query for
using my own users table.
Everything is working fine: my index.php3, for example, looks like
this:
<?
# $phpcenter was initialized in auto_prepend.php3, before including
# those includes from PHPLIB
$phpcenter->pheader();
?>
some html stuff, content
<?
$phpcenter->pfooter();
?>
So, if I access this page, I wonderfully get an authentication page
inside my layout. If I authenticate with my username and passwort, I
can show up that "some html stuff, content". But, if I'm accessing another
page from the navigation (session id is correctly appended via
$sess->url()), I get again that authentication page.
This is wrong, I think ... after having logged in (either via GET
method or via cookie method) I should be able to move around those
protected pages because I have already authenticated myself with the
correct username and password.
I also tried to put that page_open() out of my own class and set it up
into index.php3 (of course at the first line). But the same results as
above are showing up.
What is my silly brain doing wrong?
-- Björn Schotte ---> NEU: 0931/7843792 <---*DIE* deutschsprachige Anlaufstelle, wenn es um PHP geht: <http://www.php-center.de/> - PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>. To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in the body, not the subject, of your message.
- Next message: Davor Cengija: "Re: [PHPLIB] PHPLIB among multiple webservers."
- Previous message: Florian Gnägi: "Re: [PHPLIB] What is session cookie?????"
- Next in thread: Björn Schotte: "Re: [PHPLIB] Problem with page_open() inside my own function class"
- Reply: Björn Schotte: "Re: [PHPLIB] Problem with page_open() inside my own function class"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

