forked from I2P_Developers/i2p.i2p
* Console:
- Fix NPE after restart (ticket #763) - Move more nonces out of system properties
This commit is contained in:
@ -3,6 +3,8 @@ package net.i2p.router.web;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import net.i2p.util.RandomSource;
|
||||
|
||||
/**
|
||||
* Copied and modded from I2PTunnel IndexBean (GPL)
|
||||
* @author zzz
|
||||
@ -11,8 +13,6 @@ public class CSSHelper extends HelperBase {
|
||||
|
||||
private static final Map<String, Boolean> _UACache = new ConcurrentHashMap();
|
||||
|
||||
public CSSHelper() {}
|
||||
|
||||
public static final String PROP_UNIVERSAL_THEMING = "routerconsole.universal.theme";
|
||||
public static final String PROP_THEME_NAME = "routerconsole.theme";
|
||||
public static final String DEFAULT_THEME = "light";
|
||||
@ -24,6 +24,16 @@ public class CSSHelper extends HelperBase {
|
||||
public static final String PROP_DISABLE_REFRESH = "routerconsole.summaryDisableRefresh";
|
||||
private static final String PROP_XFRAME = "routerconsole.disableXFrame";
|
||||
|
||||
private static final String _consoleNonce = Long.toString(RandomSource.getInstance().nextLong());
|
||||
|
||||
/**
|
||||
* formerly stored in System.getProperty("router.consoleNonce")
|
||||
* @since 0.9.4
|
||||
*/
|
||||
public static String getNonce() {
|
||||
return _consoleNonce;
|
||||
}
|
||||
|
||||
public String getTheme(String userAgent) {
|
||||
String url = BASE_THEME_PATH;
|
||||
if (userAgent != null && userAgent.contains("MSIE")) {
|
||||
|
Reference in New Issue
Block a user