mirror of
https://github.com/nzbget/nzbget.git
synced 2025-12-23 22:27:45 -05:00
#620: wildcards in option AuthorizedIP
This commit is contained in:
@@ -301,9 +301,10 @@ bool WebProcessor::IsAuthorizedIp(const char* remoteAddr)
|
||||
// split option AuthorizedIP into tokens and check each token
|
||||
bool authorized = false;
|
||||
Tokenizer tok(g_Options->GetAuthorizedIp(), ",;");
|
||||
while (const char* iP = tok.Next())
|
||||
while (const char* ip = tok.Next())
|
||||
{
|
||||
if (!strcmp(iP, remoteIp))
|
||||
WildMask mask(ip);
|
||||
if (mask.Match(remoteIp))
|
||||
{
|
||||
authorized = true;
|
||||
break;
|
||||
|
||||
10
nzbget.conf
10
nzbget.conf
@@ -397,11 +397,13 @@ SecureKey=
|
||||
|
||||
# IP-addresses allowed to connect without authorization.
|
||||
#
|
||||
# Comma separated list of privileged IPs for easy access to NZBGet
|
||||
# built-in web-server (web-interface and RPC). The connected clients
|
||||
# have full unrestricted access.
|
||||
# List of privileged IPs for easy access to NZBGet built-in web-server
|
||||
# (web-interface and RPC). The connected clients have full unrestricted access.
|
||||
#
|
||||
# Example: 127.0.0.1,192.168.178.2.
|
||||
# Separate entries with commas or semicolons. Use wildcard characters
|
||||
# * and ? for pattern matching.
|
||||
#
|
||||
# Example: 127.0.0.1, 192.168.178.*
|
||||
#
|
||||
# NOTE: Do not use this option if the program works behind another
|
||||
# web-server because all requests will have the address of this server.
|
||||
|
||||
@@ -829,7 +829,6 @@ var Config = (new function($)
|
||||
else if (option.caption.toLowerCase().indexOf('password') > -1 &&
|
||||
option.name.toLowerCase() !== '*unpack:password')
|
||||
{
|
||||
console.log(option.caption);
|
||||
option.type = 'password';
|
||||
html += '<div class="password-field input-append">' +
|
||||
'<input type="password" id="' + option.formId + '" value="' + Util.textToAttr(value) + '" class="editsmall">'+
|
||||
@@ -879,6 +878,11 @@ var Config = (new function($)
|
||||
|
||||
htmldescr = htmldescr.replace(/&/g, '&');
|
||||
|
||||
// add extra new line after Examples not ended with dot
|
||||
htmldescr = htmldescr.replace(/Example:.*/g, function (match) {
|
||||
return match + (Util.endsWith(match, '.') ? '' : '\n');
|
||||
});
|
||||
|
||||
// replace URLs
|
||||
exp = /(http:\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
|
||||
htmldescr = htmldescr.replace(exp, "<a href='$1'>$1</a>");
|
||||
|
||||
Reference in New Issue
Block a user