So I have a pretty typical user model, nothing special about it. I’d like to be able to use this model as a guest user when no other user is logged in.
Is there a way to create a guest account, or some sort of default when no account is set, in CakePHP so that Auth contains that?
So, for example, the id would be set as 0, username would be set to guest, etc.
Thank you,
James
You could override the
findmethod at yourUsermodel, so that whenAuthcalls it (internally), you can intercept that and return whatever your want instead. Something like this (on yourUsermodel):