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
_______________________________________________ Trac mailing list [email protected] http://lists.edgewall.com/mailman/listinfo/trac
