forked from payara/Payara
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request payara#3417 from MattGill98/PAYARA-2940-Secure-Adm…
…in-Support-Portal-Fix-PAYARA4 PAYARA-2940 Secure Admin Support Portal Fix- Payara4
- Loading branch information
Showing
16 changed files
with
100,339 additions
and
101,098 deletions.
There are no files selected for viewing
This file contains 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
79 changes: 79 additions & 0 deletions
79
...i/payara-support/src/main/java/fish/payara/admingui/support/handlers/SupportHandlers.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | ||
* | ||
* Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved. | ||
* | ||
* The contents of this file are subject to the terms of either the GNU | ||
* General Public License Version 2 only ("GPL") or the Common Development | ||
* and Distribution License("CDDL") (collectively, the "License"). You | ||
* may not use this file except in compliance with the License. You can | ||
* obtain a copy of the License at | ||
* https://github.com/payara/Payara/blob/master/LICENSE.txt | ||
* See the License for the specific | ||
* language governing permissions and limitations under the License. | ||
* | ||
* When distributing the software, include this License Header Notice in each | ||
* file and include the License file at glassfish/legal/LICENSE.txt. | ||
* | ||
* GPL Classpath Exception: | ||
* The Payara Foundation designates this particular file as subject to the "Classpath" | ||
* exception as provided by the Payara Foundation in the GPL Version 2 section of the License | ||
* file that accompanied this code. | ||
* | ||
* Modifications: | ||
* If applicable, add the following below the License Header, with the fields | ||
* enclosed by brackets [] replaced by your own identifying information: | ||
* "Portions Copyright [year] [name of copyright owner]" | ||
* | ||
* Contributor(s): | ||
* If you wish your version of this file to be governed by only the CDDL or | ||
* only the GPL Version 2, indicate your decision by adding "[Contributor] | ||
* elects to include this software in this distribution under the [CDDL or GPL | ||
* Version 2] license." If you don't indicate a single choice of license, a | ||
* recipient has the option to distribute your version of this file under | ||
* either the CDDL, the GPL Version 2 or to extend the choice of license to | ||
* its licensees as provided above. However, if you add GPL Version 2 code | ||
* and therefore, elected the GPL Version 2 license, then the option applies | ||
* only if the new code is made subject to such option by the copyright | ||
* holder. | ||
*/ | ||
package fish.payara.admingui.support.handlers; | ||
|
||
import java.util.logging.Logger; | ||
|
||
import com.sun.enterprise.config.serverbeans.SecureAdmin; | ||
import com.sun.jsftemplating.annotation.Handler; | ||
import com.sun.jsftemplating.annotation.HandlerOutput; | ||
import com.sun.jsftemplating.layout.descriptors.handler.HandlerContext; | ||
|
||
import org.glassfish.internal.api.Globals; | ||
|
||
public class SupportHandlers { | ||
|
||
private static Logger LOGGER = Logger.getLogger(SupportHandlers.class.getName()); | ||
|
||
@Handler( | ||
id = "py.getSpecialAdminIndicator", | ||
output = { | ||
@HandlerOutput(name = "token", type = String.class) | ||
} | ||
) | ||
public static void getDeployedAppsInfo(HandlerContext handlerCtx) { | ||
|
||
// Get Domain xml | ||
SecureAdmin secureAdmin = Globals.getDefaultBaseServiceLocator().getService(SecureAdmin.class); | ||
if (secureAdmin == null) { | ||
LOGGER.warning("Unable to find Secure Admin configuration in Service Locator."); | ||
return; | ||
} | ||
|
||
// Get the special admin indicator | ||
String token = secureAdmin.getSpecialAdminIndicator(); | ||
if (token == null) { | ||
LOGGER.warning("Unable to find special admin token from the secure administration configuration."); | ||
} | ||
|
||
handlerCtx.setOutputValue("token", token); | ||
} | ||
|
||
} |
42 changes: 41 additions & 1 deletion
42
appserver/admingui/payara-support/src/main/resources/support/support.jsf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,48 @@ | ||
<!-- | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | ||
* | ||
* Copyright (c) [2017-2018] Payara Foundation and/or its affiliates. All rights reserved. | ||
* | ||
* The contents of this file are subject to the terms of either the GNU | ||
* General Public License Version 2 only ("GPL") or the Common Development | ||
* and Distribution License("CDDL") (collectively, the "License"). You | ||
* may not use this file except in compliance with the License. You can | ||
* obtain a copy of the License at | ||
* https://github.com/payara/Payara/blob/master/LICENSE.txt | ||
* See the License for the specific | ||
* language governing permissions and limitations under the License. | ||
* | ||
* When distributing the software, include this License Header Notice in each | ||
* file and include the License file at glassfish/legal/LICENSE.txt. | ||
* | ||
* GPL Classpath Exception: | ||
* The Payara Foundation designates this particular file as subject to the "Classpath" | ||
* exception as provided by the Payara Foundation in the GPL Version 2 section of the License | ||
* file that accompanied this code. | ||
* | ||
* Modifications: | ||
* If applicable, add the following below the License Header, with the fields | ||
* enclosed by brackets [] replaced by your own identifying information: | ||
* "Portions Copyright [year] [name of copyright owner]" | ||
* | ||
* Contributor(s): | ||
* If you wish your version of this file to be governed by only the CDDL or | ||
* only the GPL Version 2, indicate your decision by adding "[Contributor] | ||
* elects to include this software in this distribution under the [CDDL or GPL | ||
* Version 2] license." If you don't indicate a single choice of license, a | ||
* recipient has the option to distribute your version of this file under | ||
* either the CDDL, the GPL Version 2 or to extend the choice of license to | ||
* its licensees as provided above. However, if you add GPL Version 2 code | ||
* and therefore, elected the GPL Version 2 license, then the option applies | ||
* only if the new code is made subject to such option by the copyright | ||
* holder. | ||
--> | ||
|
||
<f:verbatim> | ||
<iframe | ||
id="zendeskFrame" name="zendeskFrame" | ||
style="height:100%;width:100%;pointer-events: all;z-index: 1000!important;transform: translate3d(0, 0, 0);" | ||
frameborder="0" scrolling="auto" | ||
src="/resource/payara_support/zendesk/index.html?url=#{sessionScope.REST_URL}"> | ||
src="/payara_support/zendesk/index.jsf"> | ||
</iframe> | ||
</f:verbatim> |
79 changes: 79 additions & 0 deletions
79
appserver/admingui/payara-support/src/main/resources/zendesk/index.jsf
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<!-- | ||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. | ||
* | ||
* Copyright (c) [2018] Payara Foundation and/or its affiliates. All rights reserved. | ||
* | ||
* The contents of this file are subject to the terms of either the GNU | ||
* General Public License Version 2 only ("GPL") or the Common Development | ||
* and Distribution License("CDDL") (collectively, the "License"). You | ||
* may not use this file except in compliance with the License. You can | ||
* obtain a copy of the License at | ||
* https://github.com/payara/Payara/blob/master/LICENSE.txt | ||
* See the License for the specific | ||
* language governing permissions and limitations under the License. | ||
* | ||
* When distributing the software, include this License Header Notice in each | ||
* file and include the License file at glassfish/legal/LICENSE.txt. | ||
* | ||
* GPL Classpath Exception: | ||
* The Payara Foundation designates this particular file as subject to the "Classpath" | ||
* exception as provided by the Payara Foundation in the GPL Version 2 section of the License | ||
* file that accompanied this code. | ||
* | ||
* Modifications: | ||
* If applicable, add the following below the License Header, with the fields | ||
* enclosed by brackets [] replaced by your own identifying information: | ||
* "Portions Copyright [year] [name of copyright owner]" | ||
* | ||
* Contributor(s): | ||
* If you wish your version of this file to be governed by only the CDDL or | ||
* only the GPL Version 2, indicate your decision by adding "[Contributor] | ||
* elects to include this software in this distribution under the [CDDL or GPL | ||
* Version 2] license." If you don't indicate a single choice of license, a | ||
* recipient has the option to distribute your version of this file under | ||
* either the CDDL, the GPL Version 2 or to extend the choice of license to | ||
* its licensees as provided above. However, if you add GPL Version 2 code | ||
* and therefore, elected the GPL Version 2 license, then the option applies | ||
* only if the new code is made subject to such option by the copyright | ||
* holder. | ||
--> | ||
|
||
<event> | ||
<!beforeCreate | ||
setPageSessionAttribute(key="specialAdminIndicator", value="null"); | ||
py.getSpecialAdminIndicator(token="#{pageSession.specialAdminIndicator}"); | ||
/> | ||
</event> | ||
|
||
<f:verbatim> | ||
<base href="/resource/payara_support/zendesk/"> | ||
<script type="text/javascript"> | ||
var specialAdminIndicator = "#{pageSession.specialAdminIndicator}"; | ||
|
||
// Set the admin console port for use in angular | ||
var globalPort = "4848"; | ||
let portSplit = window.location.href.split(':'); | ||
if (portSplit.length >= 2) { | ||
globalPort = portSplit[2].split('/')[0]; | ||
} | ||
</script> | ||
<app-root></app-root> | ||
<script type="text/javascript" src="/resource/zendesk/inline.bundle.js"></script> | ||
<script type="text/javascript" src="/resource/zendesk/polyfills.bundle.js"></script> | ||
<script type="text/javascript" src="/resource/zendesk/scripts.bundle.js"></script> | ||
<script type="text/javascript" src="/resource/zendesk/styles.bundle.js"></script> | ||
<script type="text/javascript" src="/resource/zendesk/vendor.bundle.js"></script> | ||
<script type="text/javascript" src="/resource/zendesk/main.bundle.js"></script> | ||
|
||
<script type="text/javascript"> | ||
addCSS('/resource/zendesk/assets/skins/payara_theme/styles.css'); | ||
function addCSS(filename){ | ||
var head = document.getElementsByTagName('head')[0]; | ||
var style = document.createElement('link'); | ||
style.href = filename; | ||
style.type = 'text/css'; | ||
style.rel = 'stylesheet'; | ||
head.appendChild(style); | ||
} | ||
</script> | ||
</f:verbatim> |
Oops, something went wrong.