Commit ad25cab4 authored by Ruanito Santos's avatar Ruanito Santos

web/app/controllers/Install.java: Add show dialog invalid inep

parent 7509fb94
......@@ -3,6 +3,8 @@ package controllers;
import java.io.*;
import java.util.ArrayList;
import javax.swing.JOptionPane;
import play.*;
import play.mvc.*;
import play.data.*;
......@@ -31,8 +33,11 @@ public class Install extends Controller {
String proxyUser = requestData.get("proxyUser");
String proxyPass = requestData.get("proxyPass");
if ((inep == null) || (inep.length() < 6) || (inep.length() > 12))
return badRequest("Inep inválido");
if ((inep == null) || (inep.length() < 6) || (inep.length() > 12)) {
Object[] options = { "OK" };
JOptionPane.showOptionDialog(null, "Inep inválido.", "Aviso", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);
return ok(views.html.install.index.render());
}
School school = null;
......@@ -44,15 +49,17 @@ public class Install extends Controller {
return internalServerError();
}
if (school == null)
return badRequest("Inep inválido");
if (school == null) {
Object[] options = { "OK" };
JOptionPane.showOptionDialog(null, "Inep inválido.", "Aviso", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);
return ok(views.html.install.index.render());
}
// build the package
String command = "sh " + MAKE_PACKAGE_BIN + " " + inep;
if (useProxy) {
command += " " + proxyHost + " " + proxyPort + " " +
proxyUser + " " + proxyPass;
proxyUser + " " + proxyPass;
}
StringBuffer sb = new StringBuffer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment