~ubuntu-branches/debian/squeeze/movabletype-opensource/squeeze

« back to all changes in this revision

Viewing changes to default_templates/signin.mtml

  • Committer: Bazaar Package Importer
  • Author(s): Dominic Hargreaves
  • Date: 2008-06-13 23:28:40 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080613232840-ya4jfxv1jgl45a3d
Tags: 4.2~rc2-1
* New upstream release candidate
* Update Standards-Version (no changes)
* Ensure that schema upgrade message is always seen

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
5
</div>
 
6
<script type="text/javascript">
 
7
/* <![CDATA[ */
 
8
function mtUpdateSignInWidget(u) {
 
9
    var el = document.getElementById('signin-widget-content');
 
10
    if (!el) return;
 
11
    if (u) {
 
12
        if (u && u.is_authenticated) {
 
13
            user = u;
 
14
            mtSaveUser();
 
15
        } else {
 
16
            // user really isn't logged in; so let's do this!
 
17
            return mtSignIn();
 
18
        }
 
19
    } else {
 
20
        u = mtGetUser();
 
21
    }
 
22
    if (u) {
 
23
        var url;
 
24
        if (u.is_authenticated) {
 
25
            if (u.is_author) {
 
26
                url = '<$mt:CGIPath$><$mt:CommentScript$>?__mode=edit_profile';
 
27
                url += '&return_url=' + encodeURIComponent( location.href );
 
28
            } else {
 
29
                url = u.url;
 
30
            }
 
31
        } else if (u.url) {
 
32
            url = u.url;
 
33
        } else {
 
34
            url = null;
 
35
        }
 
36
        var content = '<__trans phrase="You are signed in as " escape="js">';
 
37
        if (url)
 
38
            content += '<a href="' + url + '">' + u.name + '</a>';
 
39
        else
 
40
            content += u.name;
 
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">';
 
44
    } else {
 
45
        content = '<a href="javascript:void(0)" onclick="return mtSignInOnClick(\'signin-widget-content\')"><__trans phrase="Sign In" escape="js"></a>';
 
46
    }
 
47
    el.innerHTML = content;
 
48
}
 
49
mtAttachEvent('usersignin', mtUpdateSignInWidget);
 
50
mtUpdateSignInWidget();
 
51
/* ]]> */
 
52
</script>
 
53
</mt:IfRegistrationAllowed>