I'm also working on fixing the nao authentication because I really
need it in my app and think it will be beneficial to all. When I tried
the nao mode I kept getting an error that said

Uninitialized string offset: 0 in [path to oth_auth.php] on line 416.

I checked line 416 of the naoLogin function and after doing a print
out of $group['level'] I noticed that only the first character of each
value in the group array was printing out. So, $gids[]  was being
initialized to the first character of each value in the group array. I
changed the line

$gids[] = $group['level'];

to

$gids[] = $row[$this->group_model]['level'];

and the error went away but I keep getting kicked back to the login
page with the error message "Wrong username/passwd" I am using the
default password and I know it works because I was able to get it
working using the oth mode. I will keep looking into this and
hopefully come up with a solution. If anybody out there has
successfully gotten the nao mode to work please share with others.
Thanks.


On Apr 8, 3:42 pm, "LSL" <[EMAIL PROTECTED]> wrote:
> I have made some debugging and it seems that $gids array in naoLogin
> stays empty (although user has groups assigned). The $row has only
> User values - no Group, no Permission.
>
> I have tried to change unbindAll in naoLogin from belongsTo into
> hasAndBelongsToMany and it authentises OK. But now I have no access.
> This might be resolvable. I'll try to solve this and keep all
> informed.
>
> LSL
>
> LSL napsal:
>
> > Hallo.
> > I have madeothAuthworking just in oth mode according toothAuth
> > documentation (http://bakery.cakephp.org/articles/view/148). I would
> > like to make it working innaomode so I can have more groups user
> > belongs to.
>
> > I have not found any docs about this mode so I have tried to do it
> > myself.
> > 1) I have created table:
> > CREATE TABLE `users_groups` (
> >     `user_id` int(10) unsigned NOT NULL default "0",
> >     `group_id` int(10) unsigned NOT NULL default "0",
> >     KEY `user_id` (`user_id`,`group_id`)
>
> > 2) I have dropped group_id in users table.
>
> > 3) I have adjusted models according to this new scheme:
> >   Users: var $hasAndBelongsToMany =
> > array('Group'=>array('className'=>'Group','joinTable'=>'users_groups'));
> >   Groups: var $hasAndBelongsToMany = array('Permission' ...  'User'
> > =>array('className' => 'User', 'joinTable' => 'users_groups'));
>
> > 4) Changed 'mode' to 'nao' in app_controller.php
>
> > But now it seems I cannot login. What am I doing wrong? Or is there
> > some mini-howto fornao?
>
> > Thanks...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to