if (ERXStringUtilities.stringIsNullOrEmpty(System.getProperty("er.extensions.ERXDirectAction.ChangeSystemPropertyPassword"))) {  return null; } String key = request().stringFormValueForKey("key"); String value = request().stringFormValueForKey("value"); String password = request().stringFormValueForKey("password"); if (!System.getProperty("er.extensions.ERXDirectAction.ChangeSystemPropertyPassword").equals(password)) { return null; } WOResponse r = new WOResponse(); if (ERXStringUtilities.stringIsNullOrEmpty(key) ) { r.appendContentString("key cannot be null or empty old System properties:\n"+System.getProperties()); } else { value = ERXStringUtilities.stringIsNullOrEmpty(value) ? "" : value; java.util.Properties p = System.getProperties(); p.put(key, value); System.setProperties(p); ERXLogger.configureLoggingWithSystemProperties(); r.appendContentString("<html><body>New System properties:<br>"); for (java.util.Enumeration e = p.keys(); e.hasMoreElements();) { Object k = e.nextElement(); if (k.equals(key)) { r.appendContentString("<b>'"+k+"="+p.get(k)+"'     <= you changed this</b><br>"); } else { r.appendContentString("'"+k+"="+p.get(k)+"'<br>"); } } r.appendContentString("</body></html>"); } return r;
WOResponse r = null; if (canPerformActionWithPasswordKey("er.extensions.ERXDirectAction.ChangeSystemPropertyPassword")) { String key = request().stringFormValueForKey("key"); String value = request().stringFormValueForKey("value"); r = new WOResponse(); if (ERXStringUtilities.stringIsNullOrEmpty(key) ) { r.appendContentString("key cannot be null or empty old System properties:\n"+System.getProperties()); } else { value = ERXStringUtilities.stringIsNullOrEmpty(value) ? "" : value; java.util.Properties p = System.getProperties(); p.put(key, value); System.setProperties(p); ERXLogger.configureLoggingWithSystemProperties(); r.appendContentString("<html><body>New System properties:<br>"); for (java.util.Enumeration e = p.keys(); e.hasMoreElements();) { Object k = e.nextElement(); if (k.equals(key)) { r.appendContentString("<b>'"+k+"="+p.get(k)+"'     <= you changed this</b><br>"); } else { r.appendContentString("'"+k+"="+p.get(k)+"'<br>"); } } r.appendContentString("</body></html>"); } } return r;
    public WOActionResults systemPropertyAction() {        if (ERXStringUtilities.stringIsNullOrEmpty(System.getProperty("er.extensions.ERXDirectAction.ChangeSystemPropertyPassword"))) {            //returns null, do not give any feedback like password wrong or disabled            return null;        }        String key = request().stringFormValueForKey("key");        String value = request().stringFormValueForKey("value");        String password = request().stringFormValueForKey("password");        if (!System.getProperty("er.extensions.ERXDirectAction.ChangeSystemPropertyPassword").equals(password)) {            return null;        }        WOResponse r = new WOResponse();        if (ERXStringUtilities.stringIsNullOrEmpty(key) ) {            r.appendContentString("key cannot be null or empty old System properties:\n"+System.getProperties());        } else {            value = ERXStringUtilities.stringIsNullOrEmpty(value) ? "" : value;            java.util.Properties p = System.getProperties();            p.put(key, value);            System.setProperties(p);            ERXLogger.configureLoggingWithSystemProperties();            r.appendContentString("<html><body>New System properties:<br>");            for (java.util.Enumeration e = p.keys(); e.hasMoreElements();) {                Object k = e.nextElement();                if (k.equals(key)) {                    r.appendContentString("<b>'"+k+"="+p.get(k)+"'     <= you changed this</b><br>");                } else {                    r.appendContentString("'"+k+"="+p.get(k)+"'<br>");                }            }            r.appendContentString("</body></html>");        }        return r;    }