bwaters wrote:
> Not sure what the "right answer" on your session setup is but I'll tell
> you what I have done.
> I built an authentication object that holds the user and current
> session info as a component.
>
> I add a variable to appmodel to hold a reference to this component in
> this case
>
> var $asAuth = false;
>
> Then in the startup for the authentication component i put this code
> (also could put similar code in app_controller)
> To add a reference to the object in all of the models the controller
> uses.
>
> if (isset($controller->uses) && !empty($controller->uses)){
>               for($i=0;$i<count($controller->uses);$i++){
>                       $controller->{$controller->uses[$i]}->asAuth = &$this;
>               }
> }
>
> This works unless you create the model directly (like from another
> model).  Also, I always use uses even if it is the natural model for
> the controller

Well, thank you for your contribution.
I'll try this, since I'm not yet familiar with components, it will be a
good exercise.
Thank you very much.

For my N.2 problem, I abandoned the HABTM clauses and fell back to good
old hasMany and belongsTo, with a Model for the join Table. As for now,
the HABTM functionality is too limited for my needs, it seems... The
only remaining problem is a side effect of this fallback: the join
table must have a single primary key (such as 'id').... Once again, a
question of DB design, but I like association table to be association,
and not entities.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to