diff --git a/doc/News.html b/doc/News.html
index da9216136..51e8a5b2c 100644
--- a/doc/News.html
+++ b/doc/News.html
@@ -37,6 +37,18 @@ globalheader();
-->
+
v0.37 +
v0.36_build20050326
You can now go back to the Settings page if you want to make more changes.
diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java index 76013d090..3cccb1335 100644 --- a/htroot/SettingsAck_p.java +++ b/htroot/SettingsAck_p.java @@ -191,15 +191,35 @@ public class SettingsAck_p { String port = (String) post.get("port"); String peerName = (String) post.get("peername"); String shutdownWaiting = (String) post.get("shutdownWaiting"); - String info = ""; - env.setConfig("port", port); - env.setConfig("peerName", peerName); - env.setConfig("shutdownWaiting", shutdownWaiting); - prop.put("info", 12);//port or peername changed - prop.put("info_port", port); - prop.put("info_peerName", peerName); - prop.put("info_shutdownWaiting", shutdownWaiting); + // check if peer name already exists + yacySeed oldSeed = yacyCore.seedDB.lookupByName(peerName); + + if (oldSeed == null) { + // the name is new + boolean nameOK = (peerName.length() <= 80); + for (int i = 0; i < peerName.length(); i++) { + if ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_".indexOf(peerName.charAt(i)) < 0) nameOK = false; + } + if (!(nameOK)) { + // deny change + prop.put("info", 17);//peer name is wrong + } else { + + // set values + env.setConfig("port", port); + env.setConfig("peerName", peerName); + env.setConfig("shutdownWaiting", shutdownWaiting); + + prop.put("info", 12);//port or peername changed + prop.put("info_port", port); + prop.put("info_peerName", peerName); + prop.put("info_shutdownWaiting", shutdownWaiting); + } + } else { + // deny change + prop.put("info", 16);//peer name is already used by another peer + } return prop; } diff --git a/htroot/Settings_p.html b/htroot/Settings_p.html index c686b9abc..fd5628838 100644 --- a/htroot/Settings_p.html +++ b/htroot/Settings_p.html @@ -47,7 +47,7 @@ delete the file 'DATA/SETTINGS/httpProxy.conf' in the YaCy application root fold