Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: Re: [rocco] GLinks 3RC - Login/Logout Toggle Issue: Edit Log

Here is the list of edits for this post
Re: [rocco] GLinks 3RC - Login/Logout Toggle Issue
Try adding this code to the bottom of include_common_head.html
Code:
<%if not d and not user.Username~%>
<script type="text/javascript" src="<%config.build_static_url%>/utils.js"></script>
<script type="text/javascript">
//<![CDATA[
registerEvent(window, 'onload', function () {
var loginbar = document.getElementById('loginbar');
if (!loginbar)
return;
var loginlink = loginbar.firstChild;
if (loginlink.className != 'out')
return;
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
if (cookies[i].match(/<%config.user_cookie_prefix%>s=[0-9a-f]+/)) {
loginlink.href = '<%config.db_cgi_url%>/user.cgi?logout=1';
loginlink.className = 'in';
loginlink.firstChild.nodeValue = 'Logout';
break;
}
}
});
//]]>
</script>
<%~endif%>

Adrian

Last edited by:

brewt: Apr 2, 2005, 3:38 AM

Edit Log: