* Passwords:

- Add remove method
    - Add console password form to configui.jsp
    - Consolidate multiple setSettings()/getJettyString() in FormHandler
    - Some form message tweaks
This commit is contained in:
zzz
2012-10-13 21:20:16 +00:00
parent 05740f7903
commit c5ab6b9993
12 changed files with 167 additions and 63 deletions

View File

@@ -19,7 +19,6 @@ import org.mortbay.jetty.handler.ContextHandlerCollection;
* Saves changes to clients.config or webapps.config
*/
public class ConfigClientsHandler extends FormHandler {
private Map _settings;
@Override
protected void processForm() {
@@ -167,8 +166,6 @@ public class ConfigClientsHandler extends FormHandler {
}
public void setSettings(Map settings) { _settings = new HashMap(settings); }
private void saveClientChanges() {
List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context);
for (int cur = 0; cur < clients.size(); cur++) {
@@ -212,15 +209,8 @@ public class ConfigClientsHandler extends FormHandler {
}
ClientAppConfig.writeClientAppConfig(_context, clients);
addFormNotice(_("Client configuration saved successfully - restart required to take effect."));
}
/** curses Jetty for returning arrays */
private String getJettyString(String key) {
String[] arr = (String[]) _settings.get(key);
if (arr == null)
return null;
return arr[0].trim();
addFormNotice(_("Client configuration saved successfully"));
addFormNotice(_("Restart required to take effect"));
}
// STUB for stopClient, not completed yet.
@@ -421,9 +411,10 @@ public class ConfigClientsHandler extends FormHandler {
boolean all = "0.0.0.0".equals(intfc) || "0:0:0:0:0:0:0:0".equals(intfc) ||
"::".equals(intfc);
changes.put(ConfigClientsHelper.BIND_ALL_INTERFACES, Boolean.toString(all));
if (_context.router().saveConfig(changes, null))
addFormNotice(_("Interface configuration saved successfully - restart required to take effect."));
else
if (_context.router().saveConfig(changes, null)) {
addFormNotice(_("Interface configuration saved"));
addFormNotice(_("Restart required to take effect"));
} else
addFormError(_("Error saving the configuration (applied but not saved) - please see the error logs"));
}
}