2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
23 $Date: 2010/09/10 06:38:26 $
41 extern "C" PLUGIN * GetPlugin();
45 //-----------------------------------------------------------------------------
46 template <typename varParamType>
47 class CHG_BEFORE_NOTIFIER: public PROPERTY_NOTIFIER_BASE<varParamType> {
49 CHG_BEFORE_NOTIFIER(AUTH_AO & a, USER_PTR u) : user(u), auth(a) {}
50 void Notify(const varParamType & oldValue, const varParamType & newValue);
51 USER_PTR GetUser() const { return user; }
57 //-----------------------------------------------------------------------------
58 template <typename varParamType>
59 class CHG_AFTER_NOTIFIER: public PROPERTY_NOTIFIER_BASE<varParamType> {
61 CHG_AFTER_NOTIFIER(AUTH_AO & a, USER_PTR u) : user(u), auth(a) {}
62 void Notify(const varParamType & oldValue, const varParamType & newValue);
63 USER_PTR GetUser() const { return user; }
69 //-----------------------------------------------------------------------------
70 class AUTH_AO_SETTINGS {
72 const std::string & GetStrError() const { static std::string s; return s; }
73 int ParseSettings(const MODULE_SETTINGS &) { return 0; }
75 //-----------------------------------------------------------------------------
76 class AUTH_AO :public AUTH {
81 void SetUsers(USERS * u);
82 void SetTariffs(TARIFFS *) {}
83 void SetAdmins(ADMINS *) {}
84 void SetTraffcounter(TRAFFCOUNTER *) {}
85 void SetStore(STORE *) {}
86 void SetStgSettings(const SETTINGS *) {}
90 int Reload() { return 0; }
92 void SetSettings(const MODULE_SETTINGS & s);
94 const std::string & GetStrError() const;
95 const std::string GetVersion() const;
96 uint16_t GetStartPosition() const;
97 uint16_t GetStopPosition() const;
99 void AddUser(USER_PTR u);
100 void DelUser(USER_PTR u);
102 void UpdateUserAuthorization(USER_PTR u) const;
103 void Unauthorize(USER_PTR u) const;
105 int SendMessage(const STG_MSG & msg, uint32_t ip) const;
109 void SetUserNotifiers(USER_PTR u);
110 void UnSetUserNotifiers(USER_PTR u);
112 mutable std::string errorStr;
113 AUTH_AO_SETTINGS aoSettings;
115 std::list<USER_PTR> usersList;
117 MODULE_SETTINGS settings;
120 ÍÙ ÄÏÌÖÎÙ ÐÅÒÅÐÒÏ×ÅÒÉÔØ ×ÏÚÍÏÖÎÏÓÔØ Á×ÔÏÒÉÚÁÃÉÉ ÀÚÅÒÁ ÐÒÉ ÉÚÍÅÎÅÎÉÉ
121 ÓÌÅÄÕÀÝÉÈ ÅÇÏ ÐÁÒÁÍÅÔÒÏ×:
126 list<CHG_BEFORE_NOTIFIER<int> > BeforeChgAONotifierList;
127 list<CHG_AFTER_NOTIFIER<int> > AfterChgAONotifierList;
129 list<CHG_BEFORE_NOTIFIER<USER_IPS> > BeforeChgIPNotifierList;
130 list<CHG_AFTER_NOTIFIER<USER_IPS> > AfterChgIPNotifierList;
132 class ADD_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
134 ADD_USER_NONIFIER(AUTH_AO & a) : auth(a) {}
135 virtual ~ADD_USER_NONIFIER() {}
137 void Notify(const USER_PTR & user)
146 class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_PTR> {
148 DEL_USER_NONIFIER(AUTH_AO & a) : auth(a) {}
149 virtual ~DEL_USER_NONIFIER() {}
151 void Notify(const USER_PTR & user)
161 //-----------------------------------------------------------------------------