0001-redirect-user-when-authenticated-and-connected-9529.patch
mandayejs/sites/vincennes/static/vincennes/conservatoire/js/duonext.js | ||
---|---|---|
1 | 1 |
$(function(){ |
2 | 2 |
$('head').append('<link rel="stylesheet" href="/_mandaye/static/vincennes/conservatoire/css/font-awesome.min.css" type="text/css" />'); |
3 | 3 |
$('#mandaye-js').prepend('<div id="mandaye-vc-logo"><a href="https://www.vincennes.fr"><img src="/_mandaye/static/vincennes/conservatoire/images/vincennes-logo.png" alt="vincennes-logo.png"></a></div>'); |
4 |
$('head').append('<link rel="stylesheet" href="/_mandaye/static/vincennes/conservatoire/css/duonext.css"> type="text/css"');
|
|
4 |
$('head').append('<link rel="stylesheet" href="/_mandaye/static/vincennes/conservatoire/css/duonext.css" type="text/css">');
|
|
5 | 5 |
$('#sso-username').after('<a id="demarches" href="https://demarches.vincennes.fr">Démarches en ligne</a>'); |
6 | 6 |
if ($('#sso-username').length === 0) { |
7 | 7 |
$('#mandaye-vc-logo').after('<a id="demarches" href="https://demarches.vincennes.fr">Démarches en ligne</a>'); |
mandayejs/sites/vincennes/static/vincennes/conservatoire/js/force.redirect.js | ||
---|---|---|
1 |
/* This scripts force the redirection to the homepage (/Default.aspx) |
|
2 |
* if current pathname is /Connect.aspx and the current user is |
|
3 |
* already associated and currently connect |
|
4 |
*/ |
|
5 | ||
6 |
$(function(){ |
|
7 |
if (window.location.href.indexOf('/Connect.aspx') != -1){ |
|
8 |
var force_redirect = true; |
|
9 |
$('#sso-url').find('a').each(function(){ |
|
10 |
if(this.href.indexOf('/_mandaye/accounts/mellon/logout') == -1){ |
|
11 |
console.log('user not connected'); |
|
12 |
force_redirect = false; |
|
13 |
} |
|
14 |
}); |
|
15 | ||
16 |
$('#sso-mandaye-link').find('a').each(function(){ |
|
17 |
if(this.href.indexOf('/_mandaye/dissociate') == -1){ |
|
18 |
console.log('user not associated'); |
|
19 |
force_redirect = false; |
|
20 |
} |
|
21 |
}); |
|
22 | ||
23 |
if (force_redirect){ |
|
24 |
console.log("running sso"); |
|
25 |
window.location = '/_mandaye/post-login'; |
|
26 |
} |
|
27 |
|
|
28 |
} |
|
29 |
}); |
|
0 |
- |