summaryrefslogtreecommitdiffstats
path: root/src/modules/UserDBBackendMysql
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2009-09-27 01:55:44 +0200
committerMatthias Schiffer <matthias@gamezock.de>2009-09-27 01:55:44 +0200
commite1d8490f0654a3da0b900407d80d91d8d0da68c8 (patch)
treed65b4bd4a596a98061e094120b6a1aed388d1c89 /src/modules/UserDBBackendMysql
parentd88c486ae403bee8f4b16e4bdf9daf19f8915eed (diff)
downloadmad-e1d8490f0654a3da0b900407d80d91d8d0da68c8.tar
mad-e1d8490f0654a3da0b900407d80d91d8d0da68c8.zip
Use libicu to support unicode properly; migrated ConfigManager to UnicodeString
Diffstat (limited to 'src/modules/UserDBBackendMysql')
-rw-r--r--src/modules/UserDBBackendMysql/UserDBBackendMysql.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/modules/UserDBBackendMysql/UserDBBackendMysql.cpp b/src/modules/UserDBBackendMysql/UserDBBackendMysql.cpp
index e905541..7e7711a 100644
--- a/src/modules/UserDBBackendMysql/UserDBBackendMysql.cpp
+++ b/src/modules/UserDBBackendMysql/UserDBBackendMysql.cpp
@@ -40,34 +40,34 @@ bool UserDBBackendMysql::handleConfigEntry(const Core::ConfigEntry &entry, bool
if(!entry[0].getKey().matches("UserManager"))
return false;
- if(entry[1].empty())
+ if(entry[1].isEmpty())
return true;
if(!entry[1].getKey().matches("Mysql"))
return false;
if(entry[2].getKey().matches("Host")) {
- if(entry[3].empty())
- host = entry[2][0];
+ if(entry[3].isEmpty())
+ host = entry[2][0].extract();
}
else if(entry[2].getKey().matches("Username")) {
- if(entry[3].empty())
- username = entry[2][0];
+ if(entry[3].isEmpty())
+ username = entry[2][0].extract();
}
else if(entry[2].getKey().matches("Password")) {
- if(entry[3].empty())
- passwd = entry[2][0];
+ if(entry[3].isEmpty())
+ passwd = entry[2][0].extract();
}
else if(entry[2].getKey().matches("Database")) {
- if(entry[3].empty())
- db = entry[2][0];
+ if(entry[3].isEmpty())
+ db = entry[2][0].extract();
}
else if(entry[2].getKey().matches("Port")) {
- if(entry[3].empty()) {
+ if(entry[3].isEmpty()) {
char *endptr;
long val;
- val = strtol(entry[2][0].c_str(), &endptr, 10);
+ val = strtol(entry[2][0].extract().c_str(), &endptr, 10);
if(endptr != 0 || val < 0 || val > 65535)
application->log(Core::Logger::LOG_WARNING, "UserDBBackendMysql: Invalid port");
@@ -76,82 +76,82 @@ bool UserDBBackendMysql::handleConfigEntry(const Core::ConfigEntry &entry, bool
}
}
else if(entry[2].getKey().matches("UnixSocket")) {
- if(entry[3].empty())
- unixSocket = entry[2][0];
+ if(entry[3].isEmpty())
+ unixSocket = entry[2][0].extract();
}
else if(entry[2].getKey().matches("Queries")) {
if(entry[3].getKey().matches("ListUsers")) {
- if(entry[4].empty())
- queryListUsers = entry[3][0];
+ if(entry[4].isEmpty())
+ queryListUsers = entry[3][0].extract();
}
else if(entry[3].getKey().matches("ListGroups")) {
- if(entry[4].empty())
- queryListGroups = entry[3][0];
+ if(entry[4].isEmpty())
+ queryListGroups = entry[3][0].extract();
}
else if(entry[3].getKey().matches("ListUserGroups")) {
- if(entry[4].empty())
- queryListUserGroups = entry[3][0];
+ if(entry[4].isEmpty())
+ queryListUserGroups = entry[3][0].extract();
}
else if(entry[3].getKey().matches("ListGroupUsers")) {
- if(entry[4].empty())
- queryListGroupUsers = entry[3][0];
+ if(entry[4].isEmpty())
+ queryListGroupUsers = entry[3][0].extract();
}
else if(entry[3].getKey().matches("UserById")) {
- if(entry[4].empty())
- queryUserById = entry[3][0];
+ if(entry[4].isEmpty())
+ queryUserById = entry[3][0].extract();
}
else if(entry[3].getKey().matches("UserByName")) {
- if(entry[4].empty())
- queryUserByName = entry[3][0];
+ if(entry[4].isEmpty())
+ queryUserByName = entry[3][0].extract();
}
else if(entry[3].getKey().matches("GroupById")) {
- if(entry[4].empty())
- queryGroupById = entry[3][0];
+ if(entry[4].isEmpty())
+ queryGroupById = entry[3][0].extract();
}
else if(entry[3].getKey().matches("GroupByName")) {
- if(entry[4].empty())
- queryGroupByName = entry[3][0];
+ if(entry[4].isEmpty())
+ queryGroupByName = entry[3][0].extract();
}
else if(entry[3].getKey().matches("UserGroupTable")) {
- if(entry[4].empty())
- queryUserGroupTable = entry[3][0];
+ if(entry[4].isEmpty())
+ queryUserGroupTable = entry[3][0].extract();
}
else if(entry[3].getKey().matches("AddUser")) {
- if(entry[4].empty())
- queryAddUser = entry[3][0];
+ if(entry[4].isEmpty())
+ queryAddUser = entry[3][0].extract();
}
else if(entry[3].getKey().matches("UpdateUser")) {
- if(entry[4].empty())
- queryUpdateUser = entry[3][0];
+ if(entry[4].isEmpty())
+ queryUpdateUser = entry[3][0].extract();
}
else if(entry[3].getKey().matches("DeleteUser")) {
- if(entry[4].empty())
- queryDeleteUser = entry[3][0];
+ if(entry[4].isEmpty())
+ queryDeleteUser = entry[3][0].extract();
}
else if(entry[3].getKey().matches("AddGroup")) {
- if(entry[4].empty())
- queryAddGroup = entry[3][0];
+ if(entry[4].isEmpty())
+ queryAddGroup = entry[3][0].extract();
}
else if(entry[3].getKey().matches("UpdateGroup")) {
- if(entry[4].empty())
- queryUpdateGroup = entry[3][0];
+ if(entry[4].isEmpty())
+ queryUpdateGroup = entry[3][0].extract();
}
else if(entry[3].getKey().matches("DeleteGroup")) {
- if(entry[4].empty())
- queryDeleteGroup = entry[3][0];
+ if(entry[4].isEmpty())
+ queryDeleteGroup = entry[3][0].extract();
}
else if(entry[3].getKey().matches("AddUserToGroup")) {
- if(entry[4].empty())
- queryAddUserToGroup = entry[3][0];
+ if(entry[4].isEmpty())
+ queryAddUserToGroup = entry[3][0].extract();
}
else if(entry[3].getKey().matches("DeleteUserFromGroup")) {
- if(entry[4].empty())
- queryDeleteUserFromGroup = entry[3][0];
+ if(entry[4].isEmpty())
+ queryDeleteUserFromGroup = entry[3][0].extract();
}
- else if(!entry[3].empty())
+ else if(!entry[3].isEmpty())
return false;
}
- else if(!entry[2].empty())
+ else if(!entry[2].isEmpty())
return false;
return true;