From 766c56a693e8b1bd4293459bb256abdc0515a0b5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 9 Jun 2009 19:01:02 +0200 Subject: Teile der Namespaces Common und Net in den neuen Namespace Core verschoben --- src/modules/UserBackendMysql/UserBackendMysql.cpp | 90 +++++++++++------------ 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'src/modules/UserBackendMysql/UserBackendMysql.cpp') diff --git a/src/modules/UserBackendMysql/UserBackendMysql.cpp b/src/modules/UserBackendMysql/UserBackendMysql.cpp index b020310..f0e9b2e 100644 --- a/src/modules/UserBackendMysql/UserBackendMysql.cpp +++ b/src/modules/UserBackendMysql/UserBackendMysql.cpp @@ -20,10 +20,10 @@ #include #include "UserBackendMysql.h" -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -36,7 +36,7 @@ namespace Modules { boost::shared_ptr UserBackendMysql::backend; -bool UserBackendMysql::handleConfigEntry(const Common::ConfigEntry &entry, bool handled) { +bool UserBackendMysql::handleConfigEntry(const Core::ConfigEntry &entry, bool handled) { if(handled) return false; @@ -65,7 +65,7 @@ bool UserBackendMysql::handleConfigEntry(const Common::ConfigEntry &entry, bool val = strtol(entry[1][0].c_str(), &endptr, 10); if(endptr != 0 || val < 0 || val > 65535) - Common::Logger::log(Common::Logger::WARNING, "UserBackendMysql: Invalid port"); + Core::Logger::log(Core::Logger::WARNING, "UserBackendMysql: Invalid port"); else port = val; } @@ -121,7 +121,7 @@ bool UserBackendMysql::handleConfigEntry(const Common::ConfigEntry &entry, bool void UserBackendMysql::configFinished() { if(db.empty()) { - Common::Logger::log(Common::Logger::ERROR, "UserBackendMysql: No database name given"); + Core::Logger::log(Core::Logger::ERROR, "UserBackendMysql: No database name given"); return; } @@ -132,17 +132,17 @@ void UserBackendMysql::configFinished() { } -boost::shared_ptr > UserBackendMysql::getUserList() throw(Net::Exception) { - Net::ThreadManager::get()->detach(); +boost::shared_ptr > UserBackendMysql::getUserList() throw(Core::Exception) { + Core::ThreadManager::get()->detach(); if(mysql_ping(mysql)) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); mysql_real_query(mysql, queryListUsers.c_str(), queryListUsers.length()); MYSQL_RES *result = mysql_use_result(mysql); if(!result || mysql_num_fields(result) < 4) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); boost::shared_ptr > users(new std::map()); @@ -158,11 +158,11 @@ boost::shared_ptr > UserBackendMysql:: return users; } -boost::shared_ptr UserBackendMysql::getUserInfo(unsigned long uid) throw(Net::Exception) { - Net::ThreadManager::get()->detach(); +boost::shared_ptr UserBackendMysql::getUserInfo(unsigned long uid) throw(Core::Exception) { + Core::ThreadManager::get()->detach(); if(mysql_ping(mysql)) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); std::string query = queryUserById; @@ -177,7 +177,7 @@ boost::shared_ptr UserBackendMysql::getUserInfo(unsigned long MYSQL_RES *result = mysql_use_result(mysql); if(!result || mysql_num_fields(result) < 4) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); MYSQL_ROW row = mysql_fetch_row(result); @@ -192,14 +192,14 @@ boost::shared_ptr UserBackendMysql::getUserInfo(unsigned long return user; } - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); } -boost::shared_ptr UserBackendMysql::getUserInfoByName(const std::string &name) throw(Net::Exception) { - Net::ThreadManager::get()->detach(); +boost::shared_ptr UserBackendMysql::getUserInfoByName(const std::string &name) throw(Core::Exception) { + Core::ThreadManager::get()->detach(); if(mysql_ping(mysql)) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); boost::scoped_array escapedName(new char[name.length()*2+1]); @@ -211,7 +211,7 @@ boost::shared_ptr UserBackendMysql::getUserInfoByName(const st MYSQL_RES *result = mysql_use_result(mysql); if(!result || mysql_num_fields(result) < 4) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); MYSQL_ROW row = mysql_fetch_row(result); @@ -226,14 +226,14 @@ boost::shared_ptr UserBackendMysql::getUserInfoByName(const st return user; } - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); } -boost::shared_ptr > UserBackendMysql::getUserGroupList(unsigned long uid) throw(Net::Exception) { - Net::ThreadManager::get()->detach(); +boost::shared_ptr > UserBackendMysql::getUserGroupList(unsigned long uid) throw(Core::Exception) { + Core::ThreadManager::get()->detach(); if(mysql_ping(mysql)) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); std::ostringstream tmp; tmp << '"'; @@ -246,7 +246,7 @@ boost::shared_ptr > UserBackendMysql::getUserGroupList(u MYSQL_RES *result = mysql_use_result(mysql); if(!result || mysql_num_fields(result) < 1) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); boost::shared_ptr > groups(new std::set); @@ -257,17 +257,17 @@ boost::shared_ptr > UserBackendMysql::getUserGroupList(u } -boost::shared_ptr > UserBackendMysql::getGroupList() throw(Net::Exception) { - Net::ThreadManager::get()->detach(); +boost::shared_ptr > UserBackendMysql::getGroupList() throw(Core::Exception) { + Core::ThreadManager::get()->detach(); if(mysql_ping(mysql)) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); mysql_real_query(mysql, queryListGroups.c_str(), queryListGroups.length()); MYSQL_RES *result = mysql_use_result(mysql); if(!result || mysql_num_fields(result) < 2) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); boost::shared_ptr > groups(new std::map()); @@ -280,11 +280,11 @@ boost::shared_ptr > UserBackendMysql: return groups; } -std::string UserBackendMysql::getGroupName(unsigned long gid) throw(Net::Exception) { - Net::ThreadManager::get()->detach(); +std::string UserBackendMysql::getGroupName(unsigned long gid) throw(Core::Exception) { + Core::ThreadManager::get()->detach(); if(mysql_ping(mysql)) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); std::string query = queryGroupById; @@ -299,21 +299,21 @@ std::string UserBackendMysql::getGroupName(unsigned long gid) throw(Net::Excepti MYSQL_RES *result = mysql_use_result(mysql); if(!result || mysql_num_fields(result) < 2) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); MYSQL_ROW row = mysql_fetch_row(result); if(row) return row[1]; - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); } -unsigned long UserBackendMysql::getGroupId(const std::string &name) throw(Net::Exception) { - Net::ThreadManager::get()->detach(); +unsigned long UserBackendMysql::getGroupId(const std::string &name) throw(Core::Exception) { + Core::ThreadManager::get()->detach(); if(mysql_ping(mysql)) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); boost::scoped_array escapedName(new char[name.length()*2+1]); @@ -325,21 +325,21 @@ unsigned long UserBackendMysql::getGroupId(const std::string &name) throw(Net::E MYSQL_RES *result = mysql_use_result(mysql); if(!result || mysql_num_fields(result) < 2) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); MYSQL_ROW row = mysql_fetch_row(result); if(row) return strtoul(row[0], 0, 10); - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); } -boost::shared_ptr > UserBackendMysql::getGroupUserList(unsigned long gid) throw(Net::Exception) { - Net::ThreadManager::get()->detach(); +boost::shared_ptr > UserBackendMysql::getGroupUserList(unsigned long gid) throw(Core::Exception) { + Core::ThreadManager::get()->detach(); if(mysql_ping(mysql)) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); std::ostringstream tmp; tmp << '"'; @@ -352,7 +352,7 @@ boost::shared_ptr > UserBackendMysql::getGroupUserList(u MYSQL_RES *result = mysql_use_result(mysql); if(!result || mysql_num_fields(result) < 1) - throw Net::Exception(Net::Exception::NOT_AVAILABLE); + throw Core::Exception(Core::Exception::NOT_AVAILABLE); boost::shared_ptr > users(new std::set); @@ -368,14 +368,14 @@ void UserBackendMysql::registerBackend() { return; backend.reset(new UserBackendMysql()); - Common::ConfigManager::get()->registerConfigurable(backend.get()); + Core::ConfigManager::get()->registerConfigurable(backend.get()); } void UserBackendMysql::unregisterBackend() { if(!backend) return; - Common::ConfigManager::get()->unregisterConfigurable(backend.get()); + Core::ConfigManager::get()->unregisterConfigurable(backend.get()); Server::UserManager::get()->unregisterBackend(backend); backend.reset(); -- cgit v1.2.3