Patch #811

Username validation - allow spaces...

Added by Jason Milkins over 11 years ago. Updated over 4 years ago.

Status:NewStart date:2008-03-08
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Accounts / authentication
Target version:-

Description

I've tested a very simple patch with a test installation of RedMine to allow usernames with spaces.

I have modified the RegEx in app/models/user.rb ...

validates_format_of :login, :with => /^[a-z0-9_\-@\.]*$/i

to

validates_format_of :login, :with => /^[a-z0-9 _\-@\.]*$/i

After running a number of simple tests (as follows)

  • Login
  • LDAP autogenerate user
  • Add Issue
  • List Issues
  • Filter Issues
  • View Activity
  • View Homepage
  • Add Member to Project
  • Assign Issue To

I have experienced no problems with this patch.

After a reviewing a reasonable amount of code it appears that db:user/id is used for the username xref'ing and the visible login name is only used for display and initial login.

Is there any further rationale for disallowing spaces in usernames?

Here is my rationale for usernames which include spaces.

My need for spaced usernames is linked to deployment, esp. with auto generating accounts with LDAP. Our Windows AD was setup with First Last style logins... and so we have to go through the process of user education if we are going to use an alternative LDAP property, in our case MailNickname, to login.

As you can appreciate logging in with their accustomed username would be a far easier solution, in terms of human engineering.

I think this would be helpful to a number of possible enterprise users too.


Related issues

Related to Redmine - Defect #2638: LDAP authentication should allow username to contain spac... New 2009-02-01
Related to Redmine - Feature #6166: Support german umlauts and whitespaces in login string New 2010-08-18
Duplicated by Redmine - Feature #10810: Allow Login IDs with spaces in them Closed

History

#1 Updated by Stanislav German-Evtushenko about 9 years ago

I'm not sure that allowing spaces in "Username" is a good Idea in general because a lot of problems you likely to be faced to. And allowing spaces will support this way in general.

#2 Updated by Ken Sands almost 9 years ago

Since the user name is just a tag I don't see why it's a bad idea, i have my svn users as full names with spaces, allowing the user names in redmine to have spaces ties in nicely with this, it reads easier on reports for development etc, it's the user name not the ID, you wouldn't have such a restriction on a location name or client name, it's a nice identifier that links to an ID the ID is the important bit. As long as the user name is unique and doesn't contain nasty characters that might cause format issues (ampersands slashes etc) it should be accepted. I've also tested by going into the database and changing the usernames from ie "kensands" to "Ken Sands" and everything appears to work as expected.

#3 Updated by Ubaldo Villaseca almost 9 years ago

I support this request.
I simply cannot use Redmine until this is fixed because our Active Directory system notation for usernames includes a white space.

#4 Updated by sebastian ovide almost 9 years ago

+1

#5 Updated by Antoine Rodriguez about 7 years ago

+1 ...... Active directory allows it, some organisations have hundreds of users with a space ... redmine must adapt.....

#6 Updated by Piotr Karasinski over 6 years ago

+1... still not fixed after 5 years?

#7 Updated by Daniel Felix over 6 years ago

Well this seems to be open. But is there any use case for usernames with spaces?
There is another regression somewhere in the tracker. Regarding usernames with German sings like äöü.

#8 Updated by Paul C over 5 years ago

[redacted]

#9 Updated by Josef Assad over 5 years ago

Daniel Felix wrote:

Well this seems to be open. But is there any use case for usernames with spaces?

Antoine Rodriguez mentions that AD allows it so I assume there's lots of usernames in the wild with spaces in them.

I am also interested in having this resolved; we don't have an AD hooked up, but we have a very broad userbase and have had reports of confused users because redmine throws a blank page when someone tries using a user name with spaces.

I have read the discussion here and looking at it from the opposite side, is there a reason NOT to implement that small regex change?

If there is, then can we at least add an informational message in the register page under the Login text box explaining what characters are allowed?

There is another regression somewhere in the tracker. Regarding usernames with German sings like äöü.

Yeah that's in the linked issues above, I think you're referring to #6166.

#10 Updated by Cyber Tech over 4 years ago

Adding my vote, since I don't see actual vote options :)

#11 Updated by Jose Juan Montes over 4 years ago

+1.

Use case: Using a custom auth scheme with a provider (phpBB) that allows spaces. But LDAP, AD and Samba support spaces so +1.

#12 Updated by Brian Slack over 4 years ago

Such a small change seems crazy not to implement it. 100+ AD users all have spaces.

#13 Updated by Go MAEDA over 2 years ago

  • Duplicated by Feature #10810: Allow Login IDs with spaces in them added

Also available in: Atom PDF