[Framework-Team] To plip or not to plip: create user id based on full name when using email login

Maurits van Rees maurits at vanrees.org
Tue Nov 13 10:48:19 UTC 2012


Hi,

For background, see this recent thread on plone-devel:
http://thread.gmane.org/gmane.comp.web.zope.plone.devel/31351
This revolves around this issue: https://dev.plone.org/ticket/11616

This has got to do with using your email address as login name, though 
it is a bit wider than that.

Basically the problem is:

- Currently not all email addresses that are accepted by Plone can be 
used as login name. For example, pete-o'hara+hello at example.org is a fine 
email address, but it is not accepted as login name.

- The reason is that when creating a user the email address is used both 
as login name and as user id.  For the user id we are more strict in 
what we accept.  Especially a plus-sign can give problems when used in a 
url.

I have created a pull request for plone.app.users that solves this, but 
part or all of this might need to be plipped, so I would like the 
framework team's opinion on that.  I think the change is small enough 
that this is not needed, but still.
This is the pull request: https://github.com/plone/plone.app.users/pull/5

With this pull request we try a few options for coming up with a good 
user id:

1. We query a utility, so integrators can register a hook to generate a 
user id using their own logic. This is new. No utility is registered by 
default. A possibility for an integrator would be to register a utility 
that creates a uuid.

2. If a username is given and we do not use email as login, then we 
simply return that username as the user id. Same as currently.

3. We create a user id based on the full name, if that is  passed. This 
may result in an id like bob-jones-2 when there is more than one Bob 
Jones. This is new. Normally this would kick in when using email as 
login. Currently Plone simply uses the email as user id as well. With 
this new rule it should also be possible to remove the username field 
from the registration form even when not using email as login, as long 
as you keep the fullname field, but I think that would require some 
extra code.

Note that currently Plone already supports having a login name that 
differs from your user id, for example when you use email as login and 
change your email address: your original address remains your user id.  
So I do not expect problems in that area, though there are a few issues 
currently with email as login that I should check.

So, some options:

A. I can merge this now, no plip required.

B. I merge this now, except the utility part. I can plip that.

C. I merge this now, except that I change number 3 to keep using the 
email address as user id. I plip creating a user id based on the full name.

D. This needs more time for careful consideration.  I plip it all.

Thanks,

-- 
Maurits van Rees: http://maurits.vanrees.org/



More information about the Framework-Team mailing list