Re: Auth, [set|get]AuthData(), suggestions and MDB container

From: Date: Wed, 05 Mar 2003 16:08:49 +0000
Subject: Re: Auth, [set|get]AuthData(), suggestions and MDB container
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-14084@lists.php.net to get a copy of this message
On Sun Mar 02, 2003 at 09:3154PM +0100, Lorenzo Alberton wrote: > Wouldn't it a good idea just to add a new method for adding > (and not only replacing) a new user value? > > You could even rewrite setAuthData() like this: > function setAuthData($data) > { > $session = &Auth::_importGlobalVariable("session"); > > if(is_array($data)) { > foreach($data as $key=>$value) { > if(isset($session['auth'][$key]) { > $olddata[$key] = $session['auth'][$key]; > } else { > $olddata[$key] = null; > } > $session['auth'][$key] = $value; > } > } else { > // do sth with non-array-data... > // for instance use the old method here... > } > > return $olddata; > } I'll think about that, but it sounds like a good idea. > BTW, for those interested, I attached a MDB container for Auth. I've added the container to CVS! BTW: From what I can see, the best idea would be to make it a subclass of Auth_Container_DB, don't you think? -- Martin Jansen http://martinjansen.com/

« previous php.pear.dev (#14084) next »