[Phplib-users] Re: Phplib-users digest, Vol 1 #182 - 1 msg
Brought to you by:
nhruby,
richardarcher
|
From: Matthew L. <lei...@ma...> - 2002-04-30 21:31:31
|
Dear David,
Probably two users calling the same of pages and expecting to get two
different web sites are using different URLs, right? Are you virtually
hosting multiple domains? I'm guessing whatever it is, there's some way
to tell these two apart. So you use that to determine the auth object:
$page_features=array("foo.com"=>array("sess"=>"foo_sess","auth"=>"foo_auth"...),
"bar.com"=>array("sess"=>"bar_sess","auth"=>"bar_auth"...),
"baz.com"=>array("sess"=>"baz_sess",...);
$page = $page_features($HTTP_HOST);
page_open($page);
You probably have to be more careful in divining the object names, but the
general strategy is that. Once you start the session, $auth, $perm, etc.
are registered in it so they remember their type.
This means that you will have load every client's session, auth, perm
objects no matter which client's site is being served. Here is another
idea: Give each site owner their own local.inc, with the same sess,
auth, perm objects defined by the same name. So everybody has a session
object "my_session", an auth object "my_auth", whatever. Then you use the
URL or HTTP_HOST to determine which local4.inc to load.
require "$HTTP_HOST-local.inc";
// only now are my_sess etc. declared classes
page_open("sess"=>"my_sess","auth"=>"my_auth",...)
Actually, this is probably better, since all your content is in a DB_SQL
object and which one depends on the client, too. So just make sure
local.inc declares classes of the same name for each client and you're
good. The only thing that really has to be different is the database
object.
HTH,
Matt
HTH,
Matt
> Message: 1
> From: "David Glenn" <dav...@em...>
> To: <php...@li...>
> Date: Tue, 30 Apr 2002 14:32:52 -0500
> Subject: [Phplib-users] phplib: dynamic page_open values
>
> I have a problem I haven't cracked yet. I have a centralized site (one
> complete set of php pages) that will be used by many client groups, each
> of which need to access their own database (each database with its own
> phplib auth table set as well as application data). So it would seem if
> I could call page_open with a pertinent key value and then set the
> sess/auth/perm values dynamically on each page I would be on my way.
>
> I can call an initializer page with a name/value of the key value, and
> then it would be great if that was stuck in a session for each page to
> use (via an header.inc or somesuch). However, with phplib, I can't get
> to the session values unless I already know the pertinent page_open sess
> value. Mr. Chicken please meet Mr. Egg.
>
> Ideas, prior solutions, something I'm missing? Thanks.
>
> David Glenn
> da...@so...
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
>
>
>
>
>
> --__--__--
>
> _______________________________________________
> Phplib-users mailing list
> Php...@li...
> https://lists.sourceforge.net/lists/listinfo/phplib-users
>
>
> End of Phplib-users Digest
>
--
----------------------------------------------------------------
Matthew Leingang http://www.math.rutgers.edu/
Rutgers University lei...@ma...
Department of Mathematics /usr/games/fortune says:
The University of California Statistics Department; where mean is normal,
and deviation standard.
|