I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 285a2b92 authored by zzz's avatar zzz
Browse files

Drop unused ConfigConsole*. Password implementation should merge code into ConfigUI*.

parent 3839d987
No related branches found
No related tags found
No related merge requests found
package net.i2p.router.web;
/**
* Handler to deal with console config.
*
*/
public class ConfigConsoleHandler extends FormHandler {
private boolean _forceRestart;
private boolean _shouldSave;
private String _configPass;
// This is possibly the wrong place for this...
// private String _configPort;
@Override
protected void processForm() {
if(_shouldSave) {
saveChanges();
} else {
// noop
}
}
public void setShouldsave(String moo) {
_shouldSave = true;
}
public void setRestart(String moo) {
_forceRestart = true;
}
public void setConfigPass(String val) {
_configPass = val.trim();
}
/**
* The user made changes to the config and wants to save them, so
* lets go ahead and do so.
*
*/
private void saveChanges() {
if(_configPass != null) {
_context.router().setConfigSetting("consolePassword", _configPass);
} else {
_context.router().setConfigSetting("consolePassword", "");
}
boolean saved = _context.router().saveConfig();
if(saved) {
addFormNotice("Configuration saved successfully");
} else {
addFormNotice("Error saving the configuration (applied but not saved) - please see the error logs");
}
if(_forceRestart) {
addFormNotice("Performing a soft restart");
_context.router().restart();
addFormNotice("Soft restart complete");
}
}
}
package net.i2p.router.web;
public class ConfigConsoleHelper extends HelperBase {
private String consolePassword="consolePassword";
public ConfigConsoleHelper() {}
public String getSettings() {
StringBuilder buf = new StringBuilder(4*1024);
buf.append(consolePassword);
return buf.toString();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment