Feature #6166

Support german umlauts and whitespaces in login string

Added by Max Meier almost 3 years ago. Updated 3 months ago.

Status:NewStart date:2010-08-18
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Accounts / authentication
Target version:-
Resolution:

Description

I am using redmine to authenticate with a Lotus Notes LDAP server. Unfortunately the validated login string can contain umlauts and whitespaces, like in the name "Max Müller". Redmine by default does neither allow non-ascii characters nor whitespaces in the login string.

If there is no other reason, why special characters must not be used, I think one could localize the validation pattern by extracting it into config/locales to be configured individually for each language.

For myself now, I changed app/models/user.rb

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

to
validates_format_of :login, :with => /^[a-z0-9_ äüöéßÄÜÖ\-@\.]*$/iu

which suits my needs very well.

Please let me know, if this is a good idea.

patch.txt Magnifier - Patch for login names containing umlauts and accent d'aigu (1000 Bytes) Max Meier, 2011-12-14 11:03


Related issues

Related to Patch #811: Username validation - allow spaces... New 2008-03-08

History

#1 Updated by Max Meier over 1 year ago

Upgrading to redmine 1.2.2 I created a patch for app/models/user.rb, which allows german umlauts and accent d'aigu in login names. The regexp pattern is extended with unicode quoted characters, so it should run also without requiring cp1232 or such.

Could you please integrate this into official redmine versions?

#2 Updated by Daniel Albuschat over 1 year ago

+1
I ran into the same problem with 1.3.0 and used the same "hack" to fix it (I manually edited user.rb).
Why hasn't this patch been incorporated?
Why is that validation necessary, anyways?

#3 Updated by Piotr Karasinski 3 months ago

Just stumbled upon the same issue with danish characters. The name of this thread should maybe be changed to "national characters in login string" or something. Anyway the difference for me was that these national characters are not ASCII, and apparently the app/models/user.rb file in its unmodified form is ASCII encoded. So I needed to add the following code on the very top of the file:

# -*- coding: utf-8 -*-

otherwise it failed with an error (at least it did for me) when accessing Redmine.

#4 Updated by Daniel Felix 3 months ago

Well we encountered the same Problem. It would be great to have this enabled in the next release.
I currently disabled just the Loginname validation as we are using LDAP for our user management. But this way we just need to change some core code on every release to get this thing working.

Also available in: Atom PDF