Hi Noah,

thanks for the pointer. That looks simple indeed.

Cheers,
Danny

On 4/27/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Writting such a plugin is very trivial, just look at how the TracCas
plugin on trac-hacks works.

--Noah

==============Original message text===============
On Thu, 27 Apr 2006 1:49:37 EDT "Danny W. Adair" wrote:

Hi,

I'm integrating trac with a couple of other things (incl. Zope), using the
Apache module mod_auth_tkt for single sign-on.
My login/logout pages also take care of the trac cookies, and all of this
actually works great!

However, the "metanav navigation" in trac is not hardcoded anymore (I'm
using 0.9.4 now), and I couldn't find an easy way to override the existing
login/logout URLs.
My current workaround is to change the " chrome.nav.metanav" items inside the
header template, just before the menu bar is generated by nav():

<?cs # Mangle navigation items for customized authentication ?>
<?cs if:trac.authname == "anonymous" || !trac.authname ?>
<?cs set:chrome.nav.metanav.login = 'logged in as ' + trac.authname ?>
<?cs set:chrome.nav.metanav.logout = '<a href=""><?cs else ?>
<?cs set: chrome.nav.metanav.login = 'not logged in' ?>
<?cs set:chrome.nav.metanav.logout = '<a href="" ?>
<?cs /if ?>

That's not only ugly, it poses two other problems:
1. The actual trac variables trac.href.login/logout - from which metanav
seems to be built - remain the same: if they are used somewhere else they
will have the wrong value
2. I had to swap login and logout to make it prettier - adding to the
confusion - because Clearsilver only knows "set", not "unset"/"del".
Rebuilding the whole list seemed insane.

Is there a way - let's say in trac.ini - to redefine trac.href.login /logout?
Do I really have to write a plugin that replaces (though inherits 99% of)
the existing login module?

All I want to do is change the URLs - the actual auth is sorted!

Cheers,
Danny
===========End of original message text===========



_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac



--
Danny W. Adair
Director
Unfold Limited
New Zealand

Talk:         +64 4 472 1679
Fax:          +64 4 472 1680
Write:         [EMAIL PROTECTED]
Browse:     www.unfold.co.nz
Visit/Post: 22a Clifton Terrace, Kelburn 6005, Wellington, New Zealand
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac

Reply via email to