|
|
@ -35,6 +35,7 @@ |
|
|
|
#include <QCryptographicHash> |
|
|
|
#include <QCryptographicHash> |
|
|
|
#include <QDir> |
|
|
|
#include <QDir> |
|
|
|
#include <QLocale> |
|
|
|
#include <QLocale> |
|
|
|
|
|
|
|
#include <QMutableListIterator> |
|
|
|
#include <QPair> |
|
|
|
#include <QPair> |
|
|
|
#include <QSettings> |
|
|
|
#include <QSettings> |
|
|
|
|
|
|
|
|
|
|
@ -487,21 +488,17 @@ QList<Utils::Net::Subnet> Preferences::getWebUiAuthSubnetWhitelist() const |
|
|
|
return subnets; |
|
|
|
return subnets; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Preferences::setWebUiAuthSubnetWhitelist(const QStringList &subnets) |
|
|
|
void Preferences::setWebUiAuthSubnetWhitelist(QStringList subnets) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QList<Utils::Net::Subnet> filteredSubnets; |
|
|
|
QMutableListIterator<QString> i(subnets); |
|
|
|
foreach (QString subnetString, subnets) { |
|
|
|
while (i.hasNext()) { |
|
|
|
bool ok = false; |
|
|
|
bool ok = false; |
|
|
|
const Utils::Net::Subnet subnet = Utils::Net::parseSubnet(subnetString.trimmed(), &ok); |
|
|
|
const Utils::Net::Subnet subnet = Utils::Net::parseSubnet(i.next().trimmed(), &ok); |
|
|
|
if (ok) |
|
|
|
if (!ok) |
|
|
|
filteredSubnets.append(subnet); |
|
|
|
i.remove(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QStringList subnetsStringList; |
|
|
|
setValue("Preferences/WebUI/AuthSubnetWhitelist", subnets); |
|
|
|
for (const Utils::Net::Subnet &subnet : filteredSubnets) |
|
|
|
|
|
|
|
subnetsStringList.append(Utils::Net::subnetToString(subnet)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setValue("Preferences/WebUI/AuthSubnetWhitelist", subnetsStringList); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString Preferences::getServerDomains() const |
|
|
|
QString Preferences::getServerDomains() const |
|
|
|