PEAR::Auth features, passing a container object of constructor and more

From: Date: Sat, 12 Jul 2003 14:34:58 +0000
Subject: PEAR::Auth features, passing a container object of constructor and more
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-18195@lists.php.net to get a copy of this message
I was thinking about extending the auth container to allow passing the container as an object instead of a new with parameters ex right now $auth_obj = new Auth('DB', $options, 'doLogin'); new way (optional) $auth_container = new Auth_Container_DB($options); $auth_obj = new Auth($auth_container, $options, 'doLogin'); This would make it easier to use custom containers. It would be implemented without breaking bc. as alla wrote in a previous email >>Attached is a patch that adds a flag to $auth->start() >> >>$auth->start(); // same behavour as usual.. >>$auth->start(true); // always register the session (eg. same as usual >>behaviour) I don't think this should be determined in the start method, a better implementation would only start the session if the showLogin option has been set to true, which is what you need as I understand from your email. something like this should do the trick but I woudl have to do some testing. function start() { $this->assignData(); if($this->showLogin){ session_start(); if (!$this->checkAuth()) { $this->login(); } } }

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