Created
July 17, 2012 19:27
-
-
Save farmerbradllc/3131434 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%-- | |
| /** | |
| * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved. | |
| * | |
| * This library is free software; you can redistribute it and/or modify it under | |
| * the terms of the GNU Lesser General Public License as published by the Free | |
| * Software Foundation; either version 2.1 of the License, or (at your option) | |
| * any later version. | |
| * | |
| * This library is distributed in the hope that it will be useful, but WITHOUT | |
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
| * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | |
| * details. | |
| */ | |
| --%> | |
| <%@ include file="/html/portal/init.jsp" %> | |
| <% | |
| JSONObject samlSloContext = (JSONObject)request.getAttribute("samlSloContext"); | |
| JSONArray samlSloRequestInfos = samlSloContext.getJSONArray("samlSloRequestInfos"); | |
| %> | |
| <h3>Logging out from services</h3> | |
| <div id="output">Status Loading</div> | |
| <aui:script use="aui-io-request"> | |
| var div = A.one('#output'); | |
| div.html(''); | |
| var timer; | |
| var request = A.io.request( | |
| '?cmd=status', | |
| { | |
| dataType: 'json', | |
| on: { | |
| success: function(event) { | |
| var response = this.get('responseData'); | |
| console.log(response); | |
| var samlSloRequestInfos = response.samlSloRequestInfos; | |
| console.log(samlSloRequestInfos); | |
| for(var i = 0; i < samlSloRequestInfos.length; i++){ | |
| console.log(samlSloRequestInfos[i].status); | |
| if (samlSloRequestInfos[i].status == 0 || samlSloRequestInfos[i].status == 1) { | |
| div.append("<div>" + samlSloRequestInfos[i].name + "<img src='<%= themeDisplay.getPathThemeImages() %>/progress_bar/loading_animation.gif' /></div>"); | |
| } | |
| if (samlSloRequestInfos[i].status == 2) { | |
| console.log('Error'); | |
| div.append("<div>" + samlSloRequestInfos[i].name + "<img src='<%= themeDisplay.getPathThemeImages() %>/common/close.png' /></div>"); | |
| } | |
| if (samlSloRequestInfos[i].status == 3 || samlSloRequestInfos[i].status == 4 || samlSloRequestInfos[i].status == 5){ | |
| console.log('Service Logged Out'); | |
| div.append("<div>" + samlSloRequestInfos[i].name + "<img src='<%= themeDisplay.getPathThemeImages() %>/common/checked.png' /></div>"); | |
| } | |
| if (timer) { | |
| timer.cancel(); | |
| } | |
| } | |
| }, | |
| failure: function(event) { | |
| if (timer) { | |
| timer.cancel(); | |
| } | |
| } | |
| } | |
| } | |
| ); | |
| </aui:script> | |
| <script type="text/javascript"> | |
| <% | |
| for (int i = 0; i < samlSloRequestInfos.length(); i++ ) { | |
| JSONObject samlSloRequestInfo = samlSloRequestInfos.getJSONObject(i); | |
| %> | |
| <% | |
| } | |
| %> | |
| </script> | |
| <noscript> | |
| <% | |
| for (int i = 0; i < samlSloRequestInfos.length(); i++ ) { | |
| JSONObject samlSloRequestInfo = samlSloRequestInfos.getJSONObject(i); | |
| %> | |
| <a href="?cmd=logout&entityId=<%=samlSloRequestInfo.getString("entityId") %>">Logout from <%= samlSloRequestInfo.getString("name") %> </a> | |
| <% | |
| } | |
| %> | |
| </noscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment