1
<mt:IfRegistrationAllowed>
2
<div class="widget-sign-in widget">
3
<h3 class="widget-header"><__trans phrase="Sign In"></h3>
4
<div id="signin-widget-content" class="widget-content"></div>
6
<script type="text/javascript">
8
function mtUpdateSignInWidget(u) {
9
var el = document.getElementById('signin-widget-content');
12
if (u && u.is_authenticated) {
16
// user really isn't logged in; so let's do this!
24
if (u.is_authenticated) {
26
url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile';
27
url += '&return_url=' + encodeURIComponent( location.href );
36
var content = '<__trans phrase="You are signed in as " escape="js">';
38
content += '<a href="' + url + '">' + u.name + '</a>';
41
content += '. (<a href="javascript:void(0)" onclick="return mtSignOutOnClick()"><__trans phrase="sign out" escape="js"></a>)';
42
} else if (u && u.is_banned) {
43
content = '<__trans phrase="You do not have permission to sign in to this blog." escape="js">';
45
content = '<a href="javascript:void(0)" onclick="return mtSignInOnClick(\'signin-widget-content\')"><__trans phrase="Sign In" escape="js"></a>';
47
el.innerHTML = content;
49
mtAttachEvent('usersignin', mtUpdateSignInWidget);
50
mtUpdateSignInWidget();
53
</mt:IfRegistrationAllowed>