X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/41ef27bc78218657d477a8f4334dede5d09ab38d..bc4721533e4041a19b42cb247064f9f42c3f9d5f:/projects/stargazer/plugins/authorization/ao/ao.cpp?ds=inline diff --git a/projects/stargazer/plugins/authorization/ao/ao.cpp b/projects/stargazer/plugins/authorization/ao/ao.cpp index 193b20bc..bdbfe3a9 100644 --- a/projects/stargazer/plugins/authorization/ao/ao.cpp +++ b/projects/stargazer/plugins/authorization/ao/ao.cpp @@ -27,6 +27,7 @@ $Author: faust $ #include #include +#include #include // for_each #include // mem_fun_ref @@ -34,32 +35,20 @@ $Author: faust $ #include "stg/users.h" #include "stg/user_property.h" #include "stg/common.h" +#include "stg/plugin_creator.h" #include "ao.h" -class AO_CREATOR -{ -private: - AUTH_AO * ao; - -public: - AO_CREATOR() - : ao(new AUTH_AO()) - { - }; - ~AO_CREATOR() - { - delete ao; - }; - - AUTH_AO * GetPlugin() - { - return ao; - }; -}; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -AO_CREATOR aoc; +PLUGIN_CREATOR aoc; +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +PLUGIN * GetPlugin() +{ +return aoc.GetPlugin(); +} //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -75,13 +64,6 @@ public: //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -PLUGIN * GetPlugin() -{ -return aoc.GetPlugin(); -} -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- const string AUTH_AO::GetVersion() const { return "Always Online authorizator v.1.0"; @@ -219,11 +201,7 @@ void AUTH_AO::GetUsers() { USER_PTR u; int h = users->OpenSearch(); -if (!h) - { - printfd(__FILE__, "users->OpenSearch() error\n"); - return; - } +assert(h && "USERS::OpenSearch is always correct"); while (!users->SearchNext(h, &u)) {