#13099 closed defect (fixed)
SetRule and username case sensitivity
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Component: | DynamicFieldsPlugin |
Severity: | normal | Keywords: | owner set_to restrict_owner |
Cc: | Trac Release: | 1.0 |
Description
We don't have any rules on user names on our local trac installation. As such, our system has names with both upper and lower case letters. I was having trouble using the SetRule
to change the owner of the ticket based on the type field. I have restrict_owner = true
in my trac.ini so that the system allows the users to select the owner from a drop down list. This seems to preserve the capitalization of the username so the SetRule fails, if the user has any capital letters in their username. I have included a little work around.
--- rules.js (revision 15591) +++ rules.js (working copy) @@ -358,7 +360,8 @@ var option = jQuery(e).text(); if (set_to == '!' && option.length) // special non-empty rule set_to = option; - if (option == set_to) { + if (option.toLowerCase() == set_to) { + set_to = option doit = true; } });
Attachments (0)
Change History (9)
comment:2 follow-up: 7 Changed 8 years ago by
Replying to Ryan J Ollos:
Could you post an example of your rule so that I can test? Is your Trac instance running on Windows or Linux?
owner.set_to_BBLeroyBrown_when_type = custom_type (overwrite)
We are using Linux to run Trac.
I guess the issue is that the owner names specified in the rules of trac.ini cannot be case sensitive, or at least, even if specifying case-sensitive names was effective on Linux it would not be effective on Windows.
Have you tried setting
[trac]
ignore_auth_case = enabled
?
I didn't know about ignore_auth_case
. Thank you for the info. It was disabled. Setting ignore_auth_case = true
didn't fix the issue with existing accounts as they are already stored in a case preserving manner. It does, however, change all newly created user accounts to be lowercase. Going forward this would fix my problem.
I will either have to roll with my little hack or go through and sanitize all the existing user accounts. This is just a "non time consuming" side project for at work so if there is a quick and easy way of fixing existing user names, I would appreciate pointers/guidance/link.
christian
comment:4 Changed 8 years ago by
Status: | new → accepted |
---|
comment:5 Changed 8 years ago by
Replying to Ryan J Ollos:
I guess the issue is that the owner names specified in the rules of trac.ini cannot be case sensitive, or at least, even if specifying case-sensitive names was effective on Linux it would not be effective on Windows.
I had to refresh my memory on this. Trac uses ConfigParser
with default implementation of optionxfrom
, which converts all options to lowercase.
comment:7 Changed 5 years ago by
Replying to christiano@…:
I will either have to roll with my little hack or go through and sanitize all the existing user accounts. This is just a "non time consuming" side project for at work so if there is a quick and easy way of fixing existing user names, I would appreciate pointers/guidance/link.
It would probably be rather difficult to change the usernames due to the number of tables that store username. Username is stored in columns named username
, author
, sid
, owner
(and possibly others): wiki:TracDev/DatabaseSchema#DatabaseSchemaTrac0.12.
Could you post an example of your rule so that I can test? Is your Trac instance running on Windows or Linux?
I guess the issue is that the owner names specified in the rules of trac.ini cannot be case sensitive, or at least, even if specifying case-sensitive names was effective on Linux it would not be effective on Windows.Have you tried setting
[trac]
ignore_auth_case = enabled
?