]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
Tariff users table index fixed
[stg.git] / projects / stargazer / plugins / authorization / inetaccess / inetaccess.cpp
index 439bee185ed3aabf03201ffdcaf104a1dd966a6e..58d9259f68f124a433b00ec44ff4e6ce54991287 100644 (file)
@@ -44,6 +44,7 @@
 #include "stg/tariff.h"
 #include "stg/user_property.h"
 #include "stg/settings.h"
 #include "stg/tariff.h"
 #include "stg/user_property.h"
 #include "stg/settings.h"
+#include "stg/plugin_creator.h"
 #include "inetaccess.h"
 
 extern volatile const time_t stgTime;
 #include "inetaccess.h"
 
 extern volatile const time_t stgTime;
@@ -52,31 +53,10 @@ void InitEncrypt(BLOWFISH_CTX * ctx, const string & password);
 void Decrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8);
 void Encrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8);
 
 void Decrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8);
 void Encrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8);
 
-//-----------------------------------------------------------------------------
-class IA_CREATOR
-{
-private:
-    AUTH_IA * ia;
-
-public:
-    IA_CREATOR()
-        : ia(new AUTH_IA())
-        {
-        };
-    ~IA_CREATOR()
-        {
-        delete ia;
-        };
-
-    AUTH_IA * GetPlugin()
-    {
-        return ia;
-    };
-};
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-IA_CREATOR iac;
+PLUGIN_CREATOR<AUTH_IA> iac;
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -95,21 +75,6 @@ AUTH_IA_SETTINGS::AUTH_IA_SETTINGS()
 {
 }
 //-----------------------------------------------------------------------------
 {
 }
 //-----------------------------------------------------------------------------
-int AUTH_IA_SETTINGS::ParseIntInRange(const string & str, int min, int max, int * val)
-{
-if (str2x(str.c_str(), *val))
-    {
-    errorStr = "Incorrect value \'" + str + "\'.";
-    return -1;
-    }
-if (*val < min || *val > max)
-    {
-    errorStr = "Value \'" + str + "\' out of range.";
-    return -1;
-    }
-return 0;
-}
-//-----------------------------------------------------------------------------
 int AUTH_IA_SETTINGS::ParseSettings(const MODULE_SETTINGS & s)
 {
 int p;
 int AUTH_IA_SETTINGS::ParseSettings(const MODULE_SETTINGS & s)
 {
 int p;