Hi Javi,

While some good points are made in that post, I'm not too concered,
and I will continue to store emails in the username field.

"If you store email in username field, you have to be really careful
when using other plugins that depend on sfGuardPlugin, because chances
are, they’d display the email stored in username field publicly."

I fully agree. However, some plugins provide config to determine which
field to display. If they don't you can always override the username
getter to return a nickname field or something.

public function getUsername()
{
  return $this->Profile->nickname;
}

"It is also not ‘natural’ to code things like:
$this->sendEmailTo($user->getUsername());"

Again, if you don't have an email field there's nothing stopping you
creating a 'virtual getter':

public function getEmail()
{
  return $this->username;
}

I'd be interested to hear what other people think on this issue.

Hope this helps.

Tom

On Sat, Apr 3, 2010 at 6:46 AM, Javier Garcia <tirengar...@gmail.com> wrote:
> I read this (look the paragraph called "AVOID USING USERNAME FIELD FOR
> STORING EMAIL!"):
>
> http://bluehorn.co.nz/2009/04/29/implementing-email-login-with-sfguardplugin/
>
> Is that true?
>
> Javi
>
> On Apr 2, 5:27 am, Tom Haskins-Vaughan <t...@templestreetmedia.com>
> wrote:
>> Why don't you just store the email in the username field?
>>
>> On Thu, Apr 1, 2010 at 9:07 AM, Javier Garcia <tirengar...@gmail.com> wrote:
>> > Hi,
>>
>> > sfGuardUser model of sfDoctrineGuardPlugin is defined this way:
>>
>> > sfGuardUser:
>> >  actAs: [Timestampable]
>> >  columns:
>> >    id:
>> >      type: integer(4)
>> >      primary: true
>> >      autoincrement: true
>> >    username:
>> >      type: string(128)
>> >      notnull: true
>> >      unique: true
>>
>> > As you can see 'username' has the feature "notnull:true". Now i want
>> > to create a register form that is not using 'username' but the email
>> > address of the user.
>>
>> > When a user wants to register, it is showed this:
>>
>> > Validation failed in class sfGuardUser
>> > 1 field had validation error:
>> > * 1 validator failed on username (notnull)
>>
>> > Any idea?
>>
>> > Javi
>>
>> > --
>> > If you want to report a vulnerability issue on symfony, please send it to 
>> > security at symfony-project.com
>>
>> > You received this message because you are subscribed to the Google
>> > Groups "symfony users" group.
>> > To post to this group, send email to symfony-users@googlegroups.com
>> > To unsubscribe from this group, send email to
>> > symfony-users+unsubscr...@googlegroups.com
>> > For more options, visit this group at
>> >http://groups.google.com/group/symfony-users?hl=en
>>
>> > To unsubscribe, reply using "remove me" as the subject.
>
> --
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to