Mailing List Archive

Username vs. email
Hi,

currently my users are logging in with their LDAP directory ID,
which also happens to be (conincidence more than design, I'm sure!) the
first half of their local email addresses.

However, when a ticket is created, the @uchicago.edu is not appended
to their usernames. Is there a config parameter for this that I'm missing!?
Thanks in advance.

Cheers,

:D

--------------------------------------------------------------------
Daragh Fitzpatrick Daragh@UChicago.edu (773) 702-8976

Solutions Architect NSIT Administrative Systems
Renewal Projects and Architecture University of Chicago
--------------------------------------------------------------------
Username vs. email [ In reply to ]
I'm not aware of an option to do this, but I agree that something along
those lines would be useful. I raised some questions about the handling
of usernames and email addresses in my post
http://lists.edgewall.com/archive/trac/msg00412.html, but never received
any comments. I'd be happy to spend more time on this if it won't
interfere with work being done by others or if I get some helpful
feedback.

To accommodate your situation, I would ammend the proposal in my
previous message to allow for default email domains for authenticated
users.

On Wed, 2004-07-07 at 10:53, Daragh Fitzpatrick wrote:
> Hi,
>
> currently my users are logging in with their LDAP directory ID,
> which also happens to be (conincidence more than design, I'm sure!) the
> first half of their local email addresses.
>
> However, when a ticket is created, the @uchicago.edu is not appended
> to their usernames. Is there a config parameter for this that I'm missing!?
> Thanks in advance.
Username vs. email [ In reply to ]
I tried to do this in the code, but broke something else, and the ticket
returns a 404. I don't have the setup to debug it.

This is what I want to do in Notify.py:

Original:
def get_email_addresses(self, txt):
import email.Utils
emails = [x[1] for x in email.Utils.getaddresses([str(txt)])]
return filter(lambda x: x.find('@') > -1, emails)

--

Proposed change:
def get_email_addresses(self, txt):
import email.Utils
domain = self.env.get_config('notification', 'default_domain',
'localhost')
emails = [x[1] for x in email.Utils.getaddresses([str(txt)])]
emails_with_domain = []
for e in emails:
if e.count('@') == 0:
emails_with_domain.append(e + '@' + domain)
else:
emails_with_domain.append(e)
return filter(lambda x: x.find('@') > -1, emails_with_domain)

--

Why won't it work? Is the filter really recessary?

Cheers,

:D

--------------------------------------------------------------------
Daragh Fitzpatrick Daragh@UChicago.edu (773) 702-8976

Solutions Architect NSIT Administrative Systems
Renewal Projects and Architecture University of Chicago
--------------------------------------------------------------------

-----Original Message-----
From: Cap Petschulat [mailto:cap@cdres.com]
Sent: Thursday, July 08, 2004 12:41 PM
To: trac@bobcat.edgewall.com; Daragh@uchicago.edu
Subject: Re: [Trac] Username vs. email

I'm not aware of an option to do this, but I agree that something along
those lines would be useful. I raised some questions about the handling of
usernames and email addresses in my post
http://lists.edgewall.com/archive/trac/msg00412.html, but never received any
comments. I'd be happy to spend more time on this if it won't interfere with
work being done by others or if I get some helpful feedback.

To accommodate your situation, I would ammend the proposal in my previous
message to allow for default email domains for authenticated users.

On Wed, 2004-07-07 at 10:53, Daragh Fitzpatrick wrote:
> Hi,
>
> currently my users are logging in with their LDAP directory ID,
which
> also happens to be (conincidence more than design, I'm sure!) the
> first half of their local email addresses.
>
> However, when a ticket is created, the @uchicago.edu is not appended

> to their usernames. Is there a config parameter for this that I'm
missing!?
> Thanks in advance.
Username vs. email [ In reply to ]
Daragh Fitzpatrick wrote:

> I tried to do this in the code, but broke something else, and the ticket
> returns a 404. I don't have the setup to debug it.
>
> This is what I want to do in Notify.py:
>
> Original:
> def get_email_addresses(self, txt):
> import email.Utils
> emails = [x[1] for x in email.Utils.getaddresses([str(txt)])]
> return filter(lambda x: x.find('@') > -1, emails)
>
> --
>
> Proposed change:
> def get_email_addresses(self, txt):
> import email.Utils
> domain = self.env.get_config('notification', 'default_domain',
> 'localhost')
> emails = [x[1] for x in email.Utils.getaddresses([str(txt)])]
> emails_with_domain = []
> for e in emails:
> if e.count('@') == 0:
> emails_with_domain.append(e + '@' + domain)
> else:
> emails_with_domain.append(e)
> return filter(lambda x: x.find('@') > -1, emails_with_domain)
>
> --
>
> Why won't it work? Is the filter really recessary?
>

It's probably not a good idea to always append default_domain
to user names, that would only work for setups where all users
have email addresses with the same domain name. For example
that's not the case for projects.edgewall.com.
Cap Petschulat's suggestion is probably the way to go...

/ Jonas
--
Jonas Borgstr?m | Edgewall Software
jonas@edgewall.com | Professional GNU/Linux & Open Source Consulting.
| http://www.edgewall.com/
Username vs. email [ In reply to ]
Hi Jonas,

thanks for your response.

It also seems that the 'settings' page will be a workaround for my
issue, that of associating email addresses with users - I hadn't seen that
before, since settings.py isn't available for us mere mortals yet :( - do
you have an ETA?

That said, the email notification is already optional, and the
default_domain should be too. In my case, it makes sense since the users
will have single-signon userids and we are all in the same domain. In the
code, the default domain is only applied to potential email addresses
without '@'.

This is based on my believe that it is good practice to have others
outside the domain use their full email address as a userid.

This is a big issue for me since the email facility is not usable
(practically) otherwise.

I'd encourage keeping enterprise (I.e., intranet) users of Trac in
the back of your mind - that's where you'll have the most potential for
revenue!

Cheers,

:D

--------------------------------------------------------------------
Daragh Fitzpatrick Daragh@UChicago.edu (773) 702-8976

Solutions Architect NSIT Administrative Systems
Renewal Projects and Architecture University of Chicago
--------------------------------------------------------------------

-----Original Message-----
From: trac-bounces@bobcat.edgewall.com
[mailto:trac-bounces@bobcat.edgewall.com] On Behalf Of Jonas Borgstr?m
Sent: Thursday, July 08, 2004 5:53 PM
To: trac@bobcat.edgewall.com
Cc: Daragh@uchicago.edu
Subject: Re: [Trac] Username vs. email

Daragh Fitzpatrick wrote:

> I tried to do this in the code, but broke something else, and the
> ticket returns a 404. I don't have the setup to debug it.
>
> This is what I want to do in Notify.py:
>
> Original:
> def get_email_addresses(self, txt):
> import email.Utils
> emails = [x[1] for x in email.Utils.getaddresses([str(txt)])]
> return filter(lambda x: x.find('@') > -1, emails)
>
> --
>
> Proposed change:
> def get_email_addresses(self, txt):
> import email.Utils
> domain = self.env.get_config('notification', 'default_domain',
> 'localhost')
> emails = [x[1] for x in email.Utils.getaddresses([str(txt)])]
> emails_with_domain = []
> for e in emails:
> if e.count('@') == 0:
> emails_with_domain.append(e + '@' + domain)
> else:
> emails_with_domain.append(e)
> return filter(lambda x: x.find('@') > -1, emails_with_domain)
>
> --
>
> Why won't it work? Is the filter really recessary?
>

It's probably not a good idea to always append default_domain to user names,
that would only work for setups where all users have email addresses with
the same domain name. For example that's not the case for
projects.edgewall.com.
Cap Petschulat's suggestion is probably the way to go...

/ Jonas
--
Jonas Borgstr?m | Edgewall Software
jonas@edgewall.com | Professional GNU/Linux & Open Source Consulting.
| http://www.edgewall.com/

_______________________________________________
Trac mailing list
Trac@lists.edgewall.com
http://lists.edgewall.com/mailman/listinfo/trac