Skip to content
Snippets Groups Projects
casPropagateLogoutView.html 4.36 KiB
Newer Older
vitam-prg's avatar
vitam-prg committed
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <title th:text="#{screen.logout.header}">Propagate Logout View</title>

    <link rel="stylesheet" th:href="@{#{webjars.fontawesomemin.css}}"/>

    <link rel="stylesheet" th:href="@{/css/cas.css}"/>

Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
    <link rel="icon" type="image/x-icon" th:href="${vitamuiFavicon} ? 'data:image/png;base64,' + ${vitamuiFavicon} : @{/images/favicon.ico}"/>
vitam-prg's avatar
vitam-prg committed

    <script type="text/javascript" th:src="@{#{webjars.jquerymin.js}}"></script>
    <script type="text/javascript" th:src="@{#{webjars.jqueryui.js}}"></script>
    <script src="//www.google.com/recaptcha/api.js" async defer th:if="${recaptchaSiteKey}"></script>

    <script th:inline="javascript">
        /*<![CDATA[*/
        function redirectToApp() {
            window.location = encodeURI([[${logoutRedirectUrl}]]) ;
        }

        function handleCallback(index, status) {

        }

        /**
        	For Surrogation purposes, do not show logout page information.
        	Redirect straight to service.
        */
        function handleDisplay() {
       		var _this = this;
        	var logoutRedirectUrl = [[${logoutRedirectUrl}]];

        	if(logoutRedirectUrl && logoutRedirectUrl.indexOf('username=') > 0) {
        		window.setTimeout(function(){
        			_this.redirectToApp();
        		}, 200);
        	}
        	else {
        		$('body')[0].style.display = '';
        	}
        }
        /*]]>*/
    </script>
</head>


Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
<body style='display: none' th:styleappend="${@environment.getProperty('theme.body.style')}">
vitam-prg's avatar
vitam-prg committed

	<div class="login">
    </div>

    <div class="login-box step-email">
        <header>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
            <img class="vitam-logo" th:src="${vitamLogo} ? 'data:image/png;base64,' + ${vitamLogo} : @{/images/vitam-logo.png}">
            <h1><img th:src="${vitamuiLargeLogo} ? 'data:image/png;base64,' + ${vitamuiLargeLogo} : @{/images/vitamui-logo-large.png}"></h1>
vitam-prg's avatar
vitam-prg committed
        </header>

        <div>
            <h2 th:utext="#{screen.logout.header}">Logout successful</h2>
            <p th:utext="#{screen.logout.fc.success}">You have successfully logged out of the Central Authentication
                Service. Given single logout is enabled with CAS, \
                the following list of applications are <strong> only notified</strong> to log you out and destroy your
                user session. Remember that this \
                is just a notification, not a guarantee. It is up the application itself to honor these notifications
                and properly take action to log you \
                out.</p>

            <p th:utext="#{screen.logout.security}">For security reasons, exit your web browser.</p>

            <button type="button" th:if="${logoutRedirectUrl}" class="vitamui-primary" name="submit" accesskey="l" onclick="redirectToApp();">[[${'Go to ' + logoutRedirectUrl}]]</button>

        </div>
    </div>



	<div>
       	<ol style="list-style: none" start="a">
vitam-prg's avatar
vitam-prg committed
			<li th:each="entry,iterStat : ${logoutUrls}">
				<script type="text/javascript" th:inline="javascript">
                    /*<![CDATA[*/
                    $.ajax({
                        url: [[${entry.key.logoutUrl.toExternalForm()}]],
                        dataType: 'jsonp',
                        async: true,
                        contentType: [[${entry.value.contentType}]]
                        , data: [[${entry.value.message}]]
                        , success: function (data) {
                            var index = [[${iterStat.index}]];
                            handleCallback(index, 200);
                        },
                        error: function (err, textStatus, errorThrown) {
                            var index = [[${iterStat.index}]];
                            handleCallback(index, err.status);
                        }
                    });
                    handleDisplay();
                    /*]]>*/
                </script>
                <!--
                <p>
                    <i data-toggle="tooltip" data-placement="top" class="fa fa-question" th:id="${'service'+iterStat.index}" title="Logout request pending..."> </i>
                    <kbd th:text="${entry.key.service.id}"/>
                </p>
                 -->
            </li>
        </ol>
    </div>

</body>

</html>