X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/c963a109219ed101fa42f501b16f90d7b7b4f3f2..4b7c2c628f550de5c28e756a4abf033e52ffca38:/projects/stargazer/plugins/authorization/ao/ao.cpp diff --git a/projects/stargazer/plugins/authorization/ao/ao.cpp b/projects/stargazer/plugins/authorization/ao/ao.cpp index b59bd58c..84e97a0d 100644 --- a/projects/stargazer/plugins/authorization/ao/ao.cpp +++ b/projects/stargazer/plugins/authorization/ao/ao.cpp @@ -24,14 +24,16 @@ $Date: 2010/03/04 12:29:06 $ $Author: faust $ */ -#include #include -#include + +#include +#include // for_each +#include // mem_fun_ref #include "ao.h" #include "user.h" #include "users.h" -#include "../../../user_property.h" +#include "user_property.h" #include "../../../eventloop.h" class AO_CREATOR @@ -61,7 +63,6 @@ AO_CREATOR aoc; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -// ëÌÁÓÓ ÄÌÑ ÐÏÉÓËÁ ÀÚÅÒÁ × ÓÐÉÓËÅ ÎÏÔÉÆÉËÁÔÏÒÏ× template class IS_CONTAINS_USER: public binary_function { @@ -94,44 +95,23 @@ AUTH_AO::AUTH_AO() { } //----------------------------------------------------------------------------- -void AUTH_AO::SetUsers(USERS * u) -{ -users = u; -} -//----------------------------------------------------------------------------- -void AUTH_AO::SetSettings(const MODULE_SETTINGS & s) -{ -settings = s; -} -//----------------------------------------------------------------------------- -int AUTH_AO::ParseSettings() -{ -return 0; -} -//----------------------------------------------------------------------------- -const string & AUTH_AO::GetStrError() const -{ -return errorStr; -} -//----------------------------------------------------------------------------- int AUTH_AO::Start() { GetUsers(); -list::iterator users_iter; - -/*onAddUserNotifier.SetAuthorizator(this); -onDelUserNotifier.SetAuthorizator(this);*/ users->AddNotifierUserAdd(&onAddUserNotifier); users->AddNotifierUserDel(&onDelUserNotifier); -users_iter = usersList.begin(); -while (users_iter != usersList.end()) +/*list::iterator it = usersList.begin(); +while (it != usersList.end()) { - UpdateUserAuthorization(*users_iter); - ++users_iter; - } + UpdateUserAuthorization(*it); + ++it; + }*/ +std::for_each(usersList.begin(), usersList.end(), std::bind1st(std::mem_fun(&AUTH_AO::UpdateUserAuthorization), this)); + isRunning = true; + return 0; } //-----------------------------------------------------------------------------