Defect #35355

Unable to create or edit users with Cyrillic logins

Added by Roman K 5 months ago. Updated 5 months ago.

Status:ResolvedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Accounts / authentication
Target version:-
Resolution: Affected version:4.2.1

Description

Used version: 4.2.1.stable (Bitnami Redmine Stack)
Tested on fresh new install.
Tested on upgraded from 4.0.3 install.

I'm unable to create new or modify existing users with Cyrillic login. Error is: “Login is invalid”.

Existing user accounts works fine. Also, I can create user manually via direct DB queries without any problems.

There was no such problem on 4.0.3.

Already reported on Bitmani Forums, but this error occurs even on fresh new install, so I'm also report it here.

History

#1 Updated by Roman K 5 months ago

Also tested in docker image:
  • redmine:latest
  • redmine:4.1.3
  • redmine:4.0.9

from DockerHub and issue occurs there.

#2 Updated by Roman K 5 months ago

That's strange: i've tested ALL versions of redmine and no one can create users with Cyrillic logins.
But how we are using redmine with Cyrillic login users for years?!

#3 Updated by Roman K 5 months ago

Restored old backup of version 4.0.1 and dont have this issue.
But on fresh 4.0.1 (via bitnami or docker image) I have this issue.

I totally dont understand whats going on.

#4 Updated by Pavel Rosický 5 months ago

unfortunatelly Cyrillic logins aren't allowed for more then 13 years

# Login must contain letters, numbers, underscores only
validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i

https://github.com/redmine/redmine/blob/master/app/models/user.rb#L110

and LDAP logins also triggers validation
https://github.com/redmine/redmine/blob/master/app/models/user.rb#L253

so the only way to bypass the validation should be altering the source code, 3rd party plugins, or of course direct import to the database. Nothing official.

https://www.redmine.org/issues/6166 is basically the same problem with german characters, but no one seems to be interested.

#5 Updated by Roman K 5 months ago

  • Status changed from New to Resolved

Yeah, totally forgot about this small edit in app/models/user.rb:

validates_format_of :login, :with => /[а-яА-ЯёЁa-zA-Z0-9_\-@\.]*/i

seems like it can resolve problem with german characters.

Personally, I dont understand such decision, its UTF-8 already, whats the point in filtering this characters?
3 years with cyrillic logins, no problems.

Thank you.

#6 Updated by Pavel Rosický 5 months ago

maybe UTF-8 (and Ruby support) wasn't so common 13 years ago.

I don't see any valid reason why not to make it less strict and allow such characters, but I'm not a Redmine's maintainer...

Also available in: Atom PDF