utils.js
1.68 KB
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
(function() {
var saml = document.createElement('script');
saml.type = 'text/javascript';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(saml);
})();
$(document).ready(function(){
var loginMsg = t('user_saml', 'Login with SAML');
$('<div id="login-saml"></div>').css({
'text-align': 'center',
}).appendTo('form');
$('<p>or</p>').css(
{
'text-align': 'center',
'font-weight': 'bolder',
'font-size' : '110%'
}).appendTo('#login-saml');
if ($('#user').val() == "") {
$('#password').parent().hide();
$('#remember_login').hide();
$('#remember_login+label').hide();
$('#submit').hide();
}
$('#user').change( function() {
if ($(this).val() !== "") {
$('#password').parent().show();
$('#remember_login').show();
$('#remember_login+label').show();
$('#submit').show();
}
else {
$('#password').parent().hide();
$('#remember_login').hide();
$('#remember_login+label').hide();
$('#submit').hide();
}
});
$('<p>Access using SAML authentication</p>').css(
{
'text-align': 'center',
'font-weight': 'bolder',
'font-size' : '110%'
}).appendTo('#login-saml');
$('<a id="login-saml-action" href="?app=user_saml" ></a>').css(
{
'text-decoration': 'none'
}).appendTo('#login-saml');
$('<img id="login-saml-img" src="' + OC.imagePath('user_saml', 'logo.jpg') + '" title="'+ loginMsg +'" alt="'+ loginMsg +'" />').css(
{
cursor : 'pointer',
border : '1px solid #777'
}).appendTo('#login-saml-action');
});