On 6/26/08, Todd Wolaver <[EMAIL PROTECTED]> wrote:
> I'm not sure as to the best way to go about this...
>
> I'm building an application that will authenticate different types of users
> (ie system admins and customers) and they are maintained in different
> database tables.  I'd like to have each type to use a different storage
> namespace.
>
> What I've done in the past is to extend Zend_Auth and override the
> getInstance() method. I've also added helper methods such as getUser() to
> return a Zend_Table_Row object of the authenticated user.
> <?php
> class My_Auth_Client extends Zend_Auth
> {
>     protected static $_instance = null;
>
>
>     public static function getInstance()
>     {
>         if (null === self::$_instance) {
>             self::$_instance = new self();
>             self::$_instance->setStorage(new
> Zend_Auth_Storage_Session('Auth_Admin'));
>         }
>
>         return self::$_instance;
>     }
>
>     public function getUser()
>     {
>         $id = $this->getIdentity()->client_admin_id;
>  $table = new ClientAdmins();
>         return $table->find($id)->current();
>     }
> }
> ?>
>
> This has worked up until I tested my code on PHP v.5.2.6 and I get:
> Fatal error: Call to private Zend_Auth::__construct() from context
> 'My_Auth_Client' in
> /var/www/vhosts/dev.dzcrs.com/library/My/Auth/Client.php on
> line 9

Can you just create your own __construct method and don't call
parent::__construct()?

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/

Reply via email to