Skip to content

Commit

Permalink
Merge pull request payara#3417 from MattGill98/PAYARA-2940-Secure-Adm…
Browse files Browse the repository at this point in the history
…in-Support-Portal-Fix-PAYARA4

PAYARA-2940 Secure Admin Support Portal Fix- Payara4
  • Loading branch information
MeroRai authored Nov 15, 2018
2 parents 6838163 + 0b9381f commit 392afcc
Show file tree
Hide file tree
Showing 16 changed files with 100,339 additions and 101,098 deletions.
6 changes: 6 additions & 0 deletions appserver/admingui/payara-support/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>internal-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.messaging.mq</groupId>
<artifactId>imqjmx</artifactId>
Expand Down
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);
}

}
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>
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>
Loading

0 comments on commit 392afcc

Please sign in to comment.