On Fri, 29 Feb 2008 19:43:32 -0000, Noah Kantrowitz <[EMAIL PROTECTED]> wrote:
> Nick Murdoch wrote: >> Hi all, >> >> I'm currently trying to fix the Gantt Plugin (http://trac-hacks.org/ >> wiki/GanttPlugin) for use on a Trac I manage, because at the moment >> the "My Tickets" display won't work. I've worked out why: >> >> sqlite> SELECT query from report where id=7; >> >> SELECT p.value AS __color__, >> (CASE status WHEN 'assigned' THEN 'Assigned' ELSE 'Owned' END) AS >> __group__, >> id AS ticket, summary, component, version, milestone, >> t.type AS type, priority, time AS created, >> changetime AS _changetime, description AS _description, >> reporter AS _reporter >> FROM ticket t >> LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority' >> WHERE t.status IN ('new', 'assigned', 'reopened') AND owner = $USER >> ORDER BY (status = 'assigned') DESC, p.value, milestone, t.type, >> time >> >> Now, this SQL needs a USER attribute, which means I need to pass a >> second parameter containing the user to cursor.execute(query), but >> that's where I get stuck. The trac.env.Environment object seems to be >> the only access I have to the environment, and the only user-related >> method in that is get_known_users(). >> >> Is there any way to get the currently logged in user out of Trac from >> a plugin? > > req.authname. Thanks! Out of interest, where is this documented? I looked through the source of the Request object and presumably it's coming in from a callback assigned to it elsewhere, but I can't work out where that'd be. Cheers, Nick --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
