Re: [Phplib-users] Two different auth classes in the same web site
Brought to you by:
nhruby,
richardarcher
From: Layne W. <la...@dr...> - 2003-10-23 19:35:11
|
On Thursday, October 23, 1997, at 12:15 PM, Virilo Tejedor wrote: Your system clock appears to be 6 years behind. > I have an auth subclass called 'Customer_Auth' and i=A0need another=20 > subclass (i.e. Admin_Auth) for admins. > These classes have differents behaviors: ill never let anybody=20 > autoregister in Admin_Auth or visit as user 'nobody'. > =A0 > These classes also will have differents tables in the database. > =A0 > I havent thought if its better have two phplib copies, or one copy for=20= > both classes.=A0 In the second case, Im not sure if somebody could=20 > authenticate in customer pages and appears like authenticated because=20= > both classes uses the same session class (and table). This is simple to achieve in 3 steps: 1. define your 2 auth extension classes 2. make sure the separate classes use separate tables (or otherwise=20 prevent a customer from authenticating as admin) 3. make sure the page_open() on customer pages sets "auth" =3D>=20 "Customer_Auth" and on admin pages sets "auth" =3D> "Admin_Auth" Layne= |