Modify

Opened 14 years ago

Closed 12 years ago

#7145 closed defect (invalid)

PrivateTicketsPlugin is case sensitive for username

Reported by: Steven R. Loomis Owned by: Noah Kantrowitz
Priority: normal Component: PrivateTicketsPlugin
Severity: major Keywords:
Cc: Trac Release: 0.11

Description

We use e-mail addresses as usernames. It seems that the plugin is case sensitive, so if the owner name is 'Mark@…' but they authenticate as 'mark@…', this plugin won't let them see the ticket.

I think the plugin should be case insensitive.

Attachments (1)

7145case.patch (1.2 KB) - added by Steven R. Loomis 14 years ago.
7145case.patch - works for me

Download all attachments as: .zip

Change History (4)

Changed 14 years ago by Steven R. Loomis

Attachment: 7145case.patch added

7145case.patch - works for me

comment:1 Changed 14 years ago by Steven R. Loomis

not sure the patch attached properly.

Index: 0.11/privatetickets/policy.py
===================================================================
--- 0.11/privatetickets/policy.py	(revision 7874)
+++ 0.11/privatetickets/policy.py	(working copy)
@@ -63,17 +63,17 @@
         
         if perm.has_permission('TICKET_VIEW_REPORTER'):
             had_any = True
-            if tkt['reporter'] == perm.username:
+            if tkt['reporter'].lower() == perm.username.lower():
                 return None
         
         if perm.has_permission('TICKET_VIEW_CC'):
             had_any = True
-            if perm.username in [x.strip() for x in tkt['cc'].split(',')]:
+            if perm.username.lower() in [x.strip().lower() for x in tkt['cc'].split(',')]:
                 return None
         
         if perm.has_permission('TICKET_VIEW_OWNER'):
             had_any = True
-            if perm.username == tkt['owner']:
+            if perm.username.lower() == tkt['owner'].lower():
                 return None
         
         if perm.has_permission('TICKET_VIEW_REPORTER_GROUP'):
@@ -126,4 +126,5 @@
                     groups.add(action)
                     repeat = True 
         
-        return groups
\ No newline at end of file
+        return groups
+

comment:2 Changed 13 years ago by Ryan J Ollos

Summary: PrivateTicketsPlugin is case sensitivePrivateTicketsPlugin is case sensitive for username

Case-sensitivity should be an option for the plugin.

comment:3 Changed 12 years ago by Ryan J Ollos

Resolution: invalid
Status: newclosed

There is a Trac option ignore_auth_case (in the [trac] section of trac.ini). By default it is false. It appears that your authentication mechanism is case insensitive, but Trac is set to be case sensitive.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.