summaryrefslogtreecommitdiffstats
path: root/src/Common/UserManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/UserManager.cpp')
-rw-r--r--src/Common/UserManager.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/Common/UserManager.cpp b/src/Common/UserManager.cpp
index f112894..f14dbcc 100644
--- a/src/Common/UserManager.cpp
+++ b/src/Common/UserManager.cpp
@@ -39,11 +39,11 @@ UserManager::~UserManager() {
bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handled*/) {
if(entry[0].getKey().matches("UserManager")) {
if(entry[1].getKey().matches("MinUid")) {
- if(entry[2].empty()) {
+ if(entry[2].isEmpty()) {
char *endptr;
- unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10);
- if(entry[1][0].empty() || *endptr) {
- application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinUid '%s'", entry[1][0].c_str());
+ unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10);
+ if(entry[1][0].isEmpty() || *endptr) {
+ application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinUid '%s'", entry[1][0].extract().c_str());
}
else {
minUid = val;
@@ -51,11 +51,11 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl
}
}
else if(entry[1].getKey().matches("MaxUid")) {
- if(entry[2].empty()) {
+ if(entry[2].isEmpty()) {
char *endptr;
- unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10);
- if(entry[1][0].empty() || *endptr) {
- application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxUid '%s'", entry[1][0].c_str());
+ unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10);
+ if(entry[1][0].isEmpty() || *endptr) {
+ application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxUid '%s'", entry[1][0].extract().c_str());
}
else {
maxUid = val;
@@ -63,11 +63,11 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl
}
}
else if(entry[1].getKey().matches("MinGid")) {
- if(entry[2].empty()) {
+ if(entry[2].isEmpty()) {
char *endptr;
- unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10);
- if(entry[1][0].empty() || *endptr) {
- application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinGid '%s'", entry[1][0].c_str());
+ unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10);
+ if(entry[1][0].isEmpty() || *endptr) {
+ application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MinGid '%s'", entry[1][0].extract().c_str());
}
else {
minGid = val;
@@ -75,18 +75,18 @@ bool UserManager::handleConfigEntry(const Core::ConfigEntry &entry, bool /*handl
}
}
else if(entry[1].getKey().matches("MaxGid")) {
- if(entry[2].empty()) {
+ if(entry[2].isEmpty()) {
char *endptr;
- unsigned long val = std::strtoul(entry[1][0].c_str(), &endptr, 10);
- if(entry[1][0].empty() || *endptr) {
- application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxGid '%s'", entry[1][0].c_str());
+ unsigned long val = std::strtoul(entry[1][0].extract().c_str(), &endptr, 10);
+ if(entry[1][0].isEmpty() || *endptr) {
+ application->logf(Core::Logger::LOG_WARNING, "UserBackendHome: Invalid configuration: MaxGid '%s'", entry[1][0].extract().c_str());
}
else {
maxGid = val;
}
}
}
- else if(!entry[1].empty())
+ else if(!entry[1].isEmpty())
return false;
return true;