Re: Auth and Registry

Albert Lash <alby-8/[email protected]> Fri, 29 Apr 2005 17:03:02 -0400 (EDT)
Newsgroups gmane.comp.lib.nexista.devel
Message-ID <[email protected]>
OK, so in using the old login.php script:

if(!$auth->registerUser(array(
        'username' => $username,
        'last_login' => time(),
        'user_id' => $user_id,
        'roles' => $newarr,
		'account_id' => $account_id)))
{
    trigger_error(Error::getError(). ' in login.php', WARNING);
}

nothing appears in flow, but use of the prepend.php code:

    echo '<pre>';
    print_r($auth->sessionData);
    echo '</pre>';

reveals that some items were added. I can't seem to access the roles
coming from the database with Path::get('//role/name', 'flow'); though.;


On Fri, 29 Apr 2005, Albert Lash wrote:

> Not really, I just read the docs and the prepend example. Let's start real
> easy. I just want to manually login a user using prepend.php and give them
> some roles, so that I can access my sitemap gates and role based interface
> elements. I'll add the _registry items for the interface, but what do I
> need to do to set the roles?
>
> $roles=Array('admin','root','user');
> Auth::registerUser($roles);
>
> ??
>
> On Fri, 29 Apr 2005, Joshua wrote:
>
> > Well the hooks that are in now let you use an external auth system - the
> > prepend file has examples. So whatever auth system you use (one user, one
> > password all the way to full blown roles) fits right in. Basically all nx
> > wants is an array of roles - if you dont use roles then it can just be
> > groups, whatever - nx calls them roles/actions but what they actually are in
> > you auth system is irrelevant.   You can also add whatever criterias in the
> > registry as you need using the provided function (Auth::setSessiondata()) for
> > your own use - say you need to add things like user's gender or whatever and
> > keep it all under the same place as the rest.
> >
> > So your prepend file should define the login, auth, etc.. methods (can be
> > functions or callable object/methods) that will return the needed data.   You
> >
> > make sense?
> >
> >
> > On Friday 29 April 2005 1:55, Albert Lash wrote:
> > > Hi Joshua,
> > >
> > > I'm going to work on the auth system for the PHP5 Nx. Do you have any
> > > input? I remember you had some ideas about the registry, and it appears
> > > that you've developed a significant amount of code surrounding those
> > > ideas.
> > >
> > > I'm going to compare the old with the new, as well as PSA 4.x, and try to
> > > come up with the best and easiest solution. Your ideas about an
> > > auth-independent framework will be integrated as well, of course.
> > >
> > > Alby
> >
>