What if the user is editing his account and trying to change the
username or the email to an already existing value?
One way to resolve this is by checking the name in the session and if
it is the same as the current submited name skip the findByUsername
part, but this is not pretty good one, and i am not sure how to
implement it.
Any ideas?

On 21 Feb, 11:13, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 2/21/07, MaxPower <[EMAIL PROTECTED]> wrote:
>
> > if ($this->params['action'] == 'add') {
> >    // do the above code
> > } else if ($this->params['action'] == 'edit') {
> >   // check to see if username/email in $this->data is the same as the
> > existing records for the given $id
> > }
>
> Try checking if the $this->data has id set - a missing id means INSERT
> if id is present then CakePHP UPDATEs
>
> HTH
>
> Tarique
>
> --
> =============================================================
> PHP for E-Biz:http://sanisoft.com
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> =============================================================


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