[ckan-dev] Using e-mails as usernames

Vitor Baptista vitor at vitorbaptista.com
Wed Aug 7 17:33:41 UTC 2013


Hi all,

I'm working on a feature to add invites to users. To do so, I'm adding a
"state" field to the user. When you invite someone, it'll create a
"pending" user, with the name/email that you provide, and will send an
email to the user asking him/her to activate the account.

The problem is that I can't create a user without an username and a
password. To work around this, I'll set them to random values. For the
password, it's OK. But for the username, it's weird. Wouldn't it be nice if
we could set the username as the e-mail, and be done with it? Why do we
have usernames in the first place?

If we didn't, then this functionality would be basically the same as the
"Forgot Password". We would just need to change the e-mail template, so the
user knows what we're talking about, and making sure we activate the
account when she changes the password. We could reuse most of the code.

The first step would be to accepting symbols in the username (@, +, .), so
we can add an email there. Then we would remove the username field from the
create user form. And, the final step would be to change the code to use
emails wherever we're using username, and we could finally kill the column.

For this card, simply allowing symbols in the usernames would be enough. It
would be a first step in this direction.

What do you think?

Cheers,

Vítor Baptista

Developer  |  http://vitorbaptista.com |
LinkedIn<http://www.linkedin.com/in/vitorbaptista>|
@vitorbaptista <http://twitter.com/vitorbaptista>

The Open Knowledge Foundation <http://okfn.org>

*Empowering through Open Knowledge*

http://okfn.org/  |  @okfn <http://twitter.com/okfn>  |  OKF on
Facebook<https://www.facebook.com/OKFNetwork> |
Blog <http://blog.okfn.org/>  |  Newsletter<http://okfn.org/about/newsletter/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130807/470589d7/attachment.html>


More information about the ckan-dev mailing list