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 : Maxim Mamontov <faust@stargazer.dp.ua>
40 using CURR_IP_NOTIFIER = PropertyNotifierBase<uint32_t>;
41 using CONNECTED_NOTIFIER = PropertyNotifierBase<bool>;
44 virtual ~User() = default;
46 virtual int WriteConf() = 0;
47 virtual int WriteStat() = 0;
49 virtual const std::string& GetLogin() const = 0;
51 virtual uint32_t GetCurrIP() const = 0;
52 virtual time_t GetCurrIPModificationTime() const = 0;
54 virtual void AddCurrIPBeforeNotifier(CURR_IP_NOTIFIER* notifier) = 0;
55 virtual void DelCurrIPBeforeNotifier(const CURR_IP_NOTIFIER* notifier) = 0;
57 virtual void AddCurrIPAfterNotifier(CURR_IP_NOTIFIER* notifier) = 0;
58 virtual void DelCurrIPAfterNotifier(const CURR_IP_NOTIFIER* notifier) = 0;
60 virtual void AddConnectedBeforeNotifier(CONNECTED_NOTIFIER* notifier) = 0;
61 virtual void DelConnectedBeforeNotifier(const CONNECTED_NOTIFIER* notifier) = 0;
63 virtual void AddConnectedAfterNotifier(CONNECTED_NOTIFIER* notifier) = 0;
64 virtual void DelConnectedAfterNotifier(const CONNECTED_NOTIFIER* notifier) = 0;
66 virtual int GetID() const = 0;
68 virtual double GetPassiveTimePart() const = 0;
70 virtual const Tariff* GetTariff() const = 0;
71 virtual void ResetNextTariff() = 0;
73 virtual const DirTraff& GetSessionUpload() const = 0;
74 virtual const DirTraff& GetSessionDownload() const = 0;
75 virtual time_t GetSessionUploadModificationTime() const = 0;
76 virtual time_t GetSessionDownloadModificationTime() const = 0;
78 virtual bool GetConnected() const = 0;
79 virtual time_t GetConnectedModificationTime() const = 0;
80 virtual const std::string& GetLastDisconnectReason() const = 0;
81 virtual int GetAuthorized() const = 0;
82 virtual time_t GetAuthorizedModificationTime() const = 0;
84 virtual bool IsAuthorizedBy(const Auth * auth) const = 0;
85 virtual std::vector<std::string> GetAuthorizers() const = 0;
87 virtual int AddMessage(Message* msg) = 0;
89 virtual void UpdatePingTime(time_t t = 0) = 0;
90 virtual time_t GetPingTime() const = 0;
92 virtual void Run() = 0;
94 virtual const std::string& GetStrError() const = 0;
96 virtual UserProperties& GetProperties() = 0;
97 virtual const UserProperties& GetProperties() const = 0;
99 virtual bool GetDeleted() const = 0;
100 virtual void SetDeleted() = 0;
102 virtual time_t GetLastWriteStatTime() const = 0;
104 virtual bool IsInetable() = 0;
105 virtual std::string GetEnabledDirs() const = 0;
107 virtual void OnAdd() = 0;
108 virtual void OnDelete() = 0;
110 virtual std::string GetParamValue(const std::string& name) const = 0;