Skip to content

Commit

Permalink
Now that installing TAPA requires two server refreshes - 1 after inst…
Browse files Browse the repository at this point in the history
…alling on Marketplace and 1 to patch security files - added a warning to the first configured login page so that the user can be aware.
  • Loading branch information
marpontes committed Feb 16, 2018
1 parent eff68bb commit b68da47
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions install/jsp/PUCLogin.jsp
Expand Up @@ -24,6 +24,9 @@
org.pentaho.platform.api.engine.IPentahoSession,
org.pentaho.platform.api.engine.IPluginManager,
org.pentaho.platform.web.jsp.messages.Messages,
java.nio.charset.StandardCharsets,
java.nio.file.Files,
java.nio.file.Paths,
java.util.List,
java.util.ArrayList,
java.util.StringTokenizer,
Expand Down Expand Up @@ -187,6 +190,20 @@
IPluginManager plugMan = PentahoSystem.get(IPluginManager.class, PentahoSessionHolder.getSession());
Object generatedTemplate = null;
// ---- START - block to determine if another restart is needed
String solutionPath = PentahoSystem.getApplicationContext().getSolutionRootPath() + "/system/tapa/static/shouldrestart";
String shouldRestart;
try{
shouldRestart = new String(Files.readAllBytes(Paths.get(solutionPath)), StandardCharsets.UTF_8);
shouldRestart = (shouldRestart != null && shouldRestart.startsWith("yes")) ? "yes" : "no";
}catch(Exception e){
shouldRestart = "error";
}
// ---- END - block to determine if another restart is needed
Map<String, Object> tapaContext = new HashMap<String, Object>();
Expand All @@ -207,6 +224,7 @@
tapaContext.put( "TAPA_REQUESTED_URL" , Encode.forJavaScript(requestedURL) );
tapaContext.put( "TAPA_SHOWUSERS" , showUsers );
tapaContext.put( "TAPA_LOGGEDIN" , loggedIn );
tapaContext.put( "TAPA_SHOULDRESTART" , shouldRestart );
/* --------------------------------
Expand Down
5 changes: 5 additions & 0 deletions resources/templates/pentaho/index.html
Expand Up @@ -22,6 +22,11 @@
<body class="pentaho-page-background">
<div id="login-wrapper">
<div id="login-background">
{% if TAPA_SHOULDRESTART == "yes" %}
<div class="alert alert-warning">
<strong>Warning!</strong> You must restart your server once more to get TAPA working properly. Some security rules have just been applied.
</div>
{% endif %}
<div id="login-logo"></div>

<div id="login-form-container">
Expand Down

0 comments on commit b68da47

Please sign in to comment.