X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/9596c437646f369c3924dc78b20872762f3a47b9..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 811807de..84e97a0d 100644 --- a/projects/stargazer/plugins/authorization/ao/ao.cpp +++ b/projects/stargazer/plugins/authorization/ao/ao.cpp @@ -24,9 +24,11 @@ $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" @@ -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; } //-----------------------------------------------------------------------------