Thanks Noah, Thanks Brad,

That looks simple enough, Brad (though I would have preferred not to touch
the (apt-get installed) trac source). I'll give it a shot.

1. So I can use DbAuth just for the IUserDirectory information?
Authentication is done and user name is passed through by Apache.

2. Aren't user id (for authentication - "banderson") and user name (for
display - "Brad Anderson") two separate things? I can only see
"users_username_field" which seems to be used for both. Is that because trac
doesn't have that difference?

Btw, I don't know how the sequence of IUserDirectory providers is currently
determined, but you may want to flatten the user list (first found is only
found). Not sure how that can be done with generators in a scalable fashion.

Cheers,
Danny

On 2/9/07, Brad Anderson <[EMAIL PROTECTED]> wrote:
>
>
> Danny Adair wrote:
> > Hi,
> >
> > Using trac version 0.10.3(-1) on Debian Etch with apache2/mod-python.
> >
> > I'm currently letting Apache do authentication against sqlite for trac,
> > and only allow authenticated users. The same database also holds user
> > profiles with lots of other information. What is the cleanest way to
> > provide the "full name"/"email address" information to trac?
> >
> > I would like to disable the form from trac.Settings and pull everything
> > from the database.
> > Do I need to create a session for this? If yes, what's the best way to
> > do this?
> >
> > Looking at...
> > http://trac.edgewall.org/browser/tags/trac-0.10.3/trac/Settings.py -
> > already assumes a session and just sets session_attributes "name" and
> > "email"
> > http://trac.edgewall.org/browser/tags/trac-0.10.3/trac/web/main.py -
> > instantiates new session "on contact" if necessary
> > http://trac.edgewall.org/browser/tags/trac-0.10.3/trac/web/session.py
> > <http://trac.edgewall.org/browser/tags/trac-0.10.3/trac/web/session.py>
> > - doesn't seem to provide an API for _outside_ session creation (so
> > either I mimick most of trac.main (providing req, env, and so on) or I
> > manually INSERT into trac's database and create a cookie myself)
> >
> > Please keep in mind I'm doing this outside of trac (if it's a session I
> > would create it after logging the user in, i.e. before main.dispatch()
> > created a new session).
> > Where's a hook for this?
> >
> > I see another option: Hack all templates which use full name and email
> > address to pull it from a cookie which I set at login time. This seems
> > very dirty but if it only affects the new ticket/change ticket screens
> > and the session-way has issues I'd consider it.
> > If someone changes such a cookie manually it's not tragic. This would be
> > a comfort, not a security feature.
> >
> > Anyone done this before? This seems so basic I suspect there is a more
> > straightforward way...
>
> Try the DbAuthPlugin with IUserDirectory enabled.
>
> http://www.trac-hacks.org/wiki/DbAuthPlugin
>
> There's a patch on http://trac.edgewall.org/ticket/2456
>
> With this solution, I have made the 'users' table a view of another table
> with
> user information in it.  Works like a charm.
>
> BA
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to