Browse Source

Rename function

adaptive-webui-19844
Chocobo1 2 years ago
parent
commit
851374e517
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 2
      src/base/utils/net.cpp
  2. 2
      src/base/utils/net.h
  3. 2
      src/webui/webapplication.cpp

2
src/base/utils/net.cpp

@ -63,7 +63,7 @@ namespace Utils @@ -63,7 +63,7 @@ namespace Utils
|| (addr == QHostAddress(u"::ffff:127.0.0.1"_qs));
}
bool isIPInRange(const QHostAddress &addr, const QVector<Subnet> &subnets)
bool isIPInSubnets(const QHostAddress &addr, const QVector<Subnet> &subnets)
{
QHostAddress protocolEquivalentAddress;
bool addrConversionOk = false;

2
src/base/utils/net.h

@ -45,7 +45,7 @@ namespace Utils::Net @@ -45,7 +45,7 @@ namespace Utils::Net
bool isValidIP(const QString &ip);
std::optional<Subnet> parseSubnet(const QString &subnetStr);
bool isLoopbackAddress(const QHostAddress &addr);
bool isIPInRange(const QHostAddress &addr, const QVector<Subnet> &subnets);
bool isIPInSubnets(const QHostAddress &addr, const QVector<Subnet> &subnets);
QString subnetToString(const Subnet &subnet);
QHostAddress canonicalIPv6Addr(const QHostAddress &addr);

2
src/webui/webapplication.cpp

@ -579,7 +579,7 @@ bool WebApplication::isAuthNeeded() @@ -579,7 +579,7 @@ bool WebApplication::isAuthNeeded()
{
if (!m_isLocalAuthEnabled && Utils::Net::isLoopbackAddress(m_clientAddress))
return false;
if (m_isAuthSubnetWhitelistEnabled && Utils::Net::isIPInRange(m_clientAddress, m_authSubnetWhitelist))
if (m_isAuthSubnetWhitelistEnabled && Utils::Net::isIPInSubnets(m_clientAddress, m_authSubnetWhitelist))
return false;
return true;
}

Loading…
Cancel
Save