|
|
|
@ -69,13 +69,6 @@ public class ConfigBasic {
|
|
|
|
|
final File langPath = new File(sb.getAppPath("locale.source", "locales").getAbsolutePath());
|
|
|
|
|
String lang = env.getConfig("locale.language", "browser");
|
|
|
|
|
|
|
|
|
|
final int authentication = sb.adminAuthenticated(header);
|
|
|
|
|
if (authentication < 2) {
|
|
|
|
|
// must authenticate
|
|
|
|
|
prop.authenticationRequired();
|
|
|
|
|
return prop;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* For authenticated users only : acquire a transaction token for the next POST form submission */
|
|
|
|
|
try {
|
|
|
|
|
prop.put(TransactionManager.TRANSACTION_TOKEN_PARAM, TransactionManager.getTransactionToken(header));
|
|
|
|
@ -95,6 +88,14 @@ public class ConfigBasic {
|
|
|
|
|
boolean ssl = env.getConfigBool("server.https", false);
|
|
|
|
|
boolean upnp = false;
|
|
|
|
|
if (post != null) {
|
|
|
|
|
|
|
|
|
|
final int authentication = sb.adminAuthenticated(header);
|
|
|
|
|
if (authentication < 2) {
|
|
|
|
|
// must authenticate
|
|
|
|
|
prop.authenticationRequired();
|
|
|
|
|
return prop;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Settings will be modified : check this is a valid transaction using HTTP POST method */
|
|
|
|
|
TransactionManager.checkPostTransaction(header, post);
|
|
|
|
|
|
|
|
|
@ -189,11 +190,24 @@ public class ConfigBasic {
|
|
|
|
|
prop.put("reconnect", "0");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// set a warning in case that the default password was not changed
|
|
|
|
|
String currpw = sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "");
|
|
|
|
|
String dfltpw = sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5_DEFAULT, "");
|
|
|
|
|
prop.put("changedfltpw", currpw.equals(dfltpw) ? "1" : "0");
|
|
|
|
|
|
|
|
|
|
// set a use case
|
|
|
|
|
prop.put("setUseCase_switchError", 0);
|
|
|
|
|
prop.put("setUseCase_switchWarning", 0);
|
|
|
|
|
String networkName = sb.getConfig(SwitchboardConstants.NETWORK_NAME, "");
|
|
|
|
|
if (post != null && post.containsKey("usecase")) {
|
|
|
|
|
|
|
|
|
|
final int authentication = sb.adminAuthenticated(header);
|
|
|
|
|
if (authentication < 2) {
|
|
|
|
|
// must authenticate
|
|
|
|
|
prop.authenticationRequired();
|
|
|
|
|
return prop;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Settings will be modified : check this is a valid transaction using HTTP POST method */
|
|
|
|
|
TransactionManager.checkPostTransaction(header, post);
|
|
|
|
|
|
|
|
|
|