-
Notifications
You must be signed in to change notification settings - Fork 2
/
vanilla-4.1.1-slingshot-login.ftl
139 lines (129 loc) · 4.64 KB
/
vanilla-4.1.1-slingshot-login.ftl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<#include "../include/alfresco-template.ftl" />
<@templateHeader>
<@link rel="stylesheet" type="text/css" href="${url.context}/res/themes/${theme}/login.css" />
</@>
<@templateBody>
<div id="alflogin" class="login-panel">
<div class="login-logo"></div>
<#if PORTLET>
<div class="login-portlet">${msg("message.login-portal")}</div>
<#else>
<form id="loginform" accept-charset="UTF-8" method="post" action="${url.context}/page/dologin" onsubmit="return alfLogin();">
<fieldset>
<div style="padding-top:96px">
<label id="txt-username" for="username"></label>
</div>
<div style="padding-top:4px">
<input type="text" id="username" name="username" maxlength="255" style="width:200px" value="<#if lastUsername??>${lastUsername?html}</#if>" />
</div>
<div style="padding-top:12px">
<label id="txt-password" for="password"></label>
</div>
<div style="padding-top:4px">
<input type="password" id="password" name="password" maxlength="255" style="width:200px"/>
</div>
<div style="padding-top:16px">
<input type="submit" id="btn-login" class="login-button" />
</div>
<input type="hidden" id="success" name="success" value="${successUrl?html}"/>
<input type="hidden" name="failure" value="<#assign link>${url.context}/page/type/login</#assign>${link?html}?error=true"/>
</fieldset>
</form>
</#if>
<div style="padding-top:32px">
<span class="login-copyright">
© 2005-2012 Alfresco Software Inc. All rights reserved.
</span>
</div>
</div>
<script type="text/javascript">//<![CDATA[
function alfLogin()
{
YAHOO.util.Dom.get("btn-login").setAttribute("disabled", true);
return true;
}
YAHOO.util.Event.onContentReady("alflogin", function()
{
var Dom = YAHOO.util.Dom;
// Prevent the Enter key from causing a double form submission
var form = Dom.get("loginform");
if (form)
{
// add the event to the form and make the scope of the handler this form.
YAHOO.util.Event.addListener(form, "submit", this._submitInvoked, this, true);
var fnStopEvent = function(id, keyEvent)
{
if (form.getAttribute("alflogin") == null)
{
form.setAttribute("alflogin", true);
}
}
var enterListener = new YAHOO.util.KeyListener(form,
{
keys: YAHOO.util.KeyListener.KEY.ENTER
}, fnStopEvent, "keydown");
enterListener.enable();
// set I18N labels
Dom.get("txt-username").innerHTML = Alfresco.util.message("label.username") + ":";
Dom.get("txt-password").innerHTML = Alfresco.util.message("label.password") + ":";
Dom.get("btn-login").value = Alfresco.util.message("button.login");
}
// generate and display main login panel
var panel = new YAHOO.widget.Overlay(YAHOO.util.Dom.get("alflogin"),
{
modal: false,
draggable: false, // NOTE: Don't change to "true"
fixedcenter: YAHOO.env.ua.mobile === null,
close: false,
visible: true,
iframe: false
});
panel.render(document.body);
panel.center();
Dom.get("success").value += window.location.hash;
Dom.get(<#if lastUsername??>"password"<#else>"username"</#if>).focus();
});
document.cookie="_alfTest=_alfTest"
var cookieEnabled = (document.cookie.indexOf("_alfTest") != -1);
<#if url.args["error"]??>
if (cookieEnabled == true)
{
Alfresco.util.PopupManager.displayPrompt(
{
title: Alfresco.util.message("message.loginfailure"),
text: Alfresco.util.message("message.loginautherror"),
buttons: [
{
text: Alfresco.util.message("button.ok"),
handler: function error_onOk()
{
this.destroy();
YAHOO.util.Dom.get("username").focus();
YAHOO.util.Dom.get("username").select();
},
isDefault: true
}]
});
}
</#if>
if (cookieEnabled == false)
{
Alfresco.util.PopupManager.displayPrompt(
{
title: Alfresco.util.message("message.cookiesfailure"),
text: Alfresco.util.message("message.cookieserror"),
buttons: [
{
text: Alfresco.util.message("button.ok"),
handler: function error_onOk()
{
this.destroy();
},
isDefault: false
}]
});
}
//]]></script>
</@>
</body>
</html>