[Solar-talk] Alternate authentication object for Solar_User
Leo Chiao
leo.chiao at gmail.com
Sun Mar 16 19:59:21 CDT 2008
In the current app I am developing, I need to use two distinct
authentication sources so I am planning to use two Solar_User objects: one
which uses the default Solar_Auth settings I have defined in my config file
and the other with a custom config setting. To accomplish this, I am
calling Solar::factory('Solar_User') with the optional $config as the second
constructor param.
For most config parameters, they are either integers or strings, but
Solar_User expects an actual authentication object which means I have to
specify the config via code. I just wanted to confirm that there isn't a
more elegant way to accomplish this:
if (! Solar_Registry::exists('user')) {
Solar_Registry::set('user', Solar::factory('Solar_User'));
}
if (! Solar_Registry::exists('member')) {
$config = array(
'auth' => Solar::factory('Solar_Auth', Solar::config('Vendor_Auth'))
);
Solar_Registry::set('member', Solar::factory('Solar_User', $config));
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman-mail3.webfaction.com/pipermail/solar-talk/attachments/20080316/6c8ce76b/attachment.html
More information about the Solar-talk
mailing list