-private:
- STG_LOGGER & WriteServLog;
-
- void Connect(bool fakeConnect = false);
- void Disconnect(bool fakeDisconnect, const std::string & reason);
- int SaveMonthStat(int month, int year);
-
- int SendMessage(STG_MSG & msg) const;
- void ScanMessage();
- time_t lastScanMessages;
-
- string login;
- int id;
- bool __connected;
- USER_PROPERTY<bool> connected;
-
- bool enabledDirs[DIR_NUM];
-
- USER_ID_GENERATOR userIDGenerator;
-
- uint32_t __currIP; // ôÅËÕÝÉÊ ÁÄÒÅÓ ÐÏÌØÚÏ×ÁÔÅÌÑ
- USER_PROPERTY<uint32_t> currIP;
-
- /*
- ë ÔÏÍÕ ÍÏÍÅÎÔÕ ËÁË ÍÙ ÕÖÅ ÎÅ Á×ÔÏÒÉÚÏ×ÁÎÉÙ, ÎÏ ÅÝÅ ÎÅ ×ÙÐÏÌÎÅÎ Disconnect,
- currIP ÕÖÅ ÓÂÒÏÛÅÎ. ðÏÓÌÅÄÎÅÅ ÚÎÁÞÅÎÉÅ currIP ÓÏÈÒÁÎÑÅÍ × lastIPForDisconnect
- */
- uint32_t lastIPForDisconnect;
-
- time_t pingTime;
-
- const ADMIN sysAdmin;
- const BASE_STORE * store;
-
- const TARIFFS * tariffs;
- const TARIFF * tariff;
-
- TRAFF_STAT traffStat;
- std::pair<time_t, TRAFF_STAT> traffStatSaved;
-
- const SETTINGS * settings;
-
- set<const BASE_AUTH *> authorizedBy;
-
- const map<uint32_t, user_iter> * ipIndex;
-
- list<STG_MSG> messages;
-
- bool deleted;
-
- time_t lastWriteStat; // ÷ÒÅÍÑ ÐÏÓÌÅÄÎÅÊ ÚÁÐÉÓÉ ÓÔÁÔÉÓÔÉËÉ
- time_t lastWriteDeatiledStat; // ÷ÒÅÍÑ ÐÏÓÌÅÄÎÅÊ ÚÁÐÉÓÉ ÄÅÔÁÌØÎÏÊ ÓÔÁÔÉÓÔÉËÉ
-
- // Properties
- USER_PROPERTY<double> & cash;
- USER_PROPERTY<DIR_TRAFF> & up;
- USER_PROPERTY<DIR_TRAFF> & down;
- USER_PROPERTY<double> & lastCashAdd;
- USER_PROPERTY<time_t> & passiveTime;
- USER_PROPERTY<time_t> & lastCashAddTime;
- USER_PROPERTY<double> & freeMb;
- USER_PROPERTY<time_t> & lastActivityTime;
- USER_PROPERTY<string> & password;
- USER_PROPERTY<int> & passive;
- USER_PROPERTY<int> & disabled;
- USER_PROPERTY<int> & disabledDetailStat;
- USER_PROPERTY<int> & alwaysOnline;
- USER_PROPERTY<string> & tariffName;
- USER_PROPERTY<string> & nextTariff;
- USER_PROPERTY<string> & address;
- USER_PROPERTY<string> & note;
- USER_PROPERTY<string> & group;
- USER_PROPERTY<string> & email;
- USER_PROPERTY<string> & phone;
- USER_PROPERTY<string> & realName;
- USER_PROPERTY<double> & credit;
- USER_PROPERTY<time_t> & creditExpire;
- USER_PROPERTY<USER_IPS> & ips;
- USER_PROPERTY<string> & userdata0;
- USER_PROPERTY<string> & userdata1;
- USER_PROPERTY<string> & userdata2;
- USER_PROPERTY<string> & userdata3;
- USER_PROPERTY<string> & userdata4;
- USER_PROPERTY<string> & userdata5;
- USER_PROPERTY<string> & userdata6;
- USER_PROPERTY<string> & userdata7;
- USER_PROPERTY<string> & userdata8;
- USER_PROPERTY<string> & userdata9;
-
- // End properties
-
- DIR_TRAFF sessionUpload;
- DIR_TRAFF sessionDownload;
-
- CHG_PASSIVE_NOTIFIER passiveNotifier;
- CHG_TARIFF_NOTIFIER tariffNotifier;
- CHG_CASH_NOTIFIER cashNotifier;
- CHG_IP_NOTIFIER ipNotifier;
-
- mutable pthread_mutex_t mutex;
-
- string errorStr;
+ int SendMessage(Message & msg) const;
+ void ScanMessage();
+
+ time_t lastScanMessages;
+
+ std::string login;
+ int id;
+ bool __connected;
+ UserProperty<bool> connected;
+
+ bool enabledDirs[DIR_NUM];
+
+ uint32_t __currIP; // Current user's ip
+ UserProperty<uint32_t> currIP;
+
+ uint32_t lastIPForDisconnect; // User's ip after unauth but before disconnect
+ std::string lastDisconnectReason;
+
+ time_t pingTime;
+
+ const Admin * sysAdmin;
+ const Store * store;
+
+ const Tariffs * tariffs;
+ const Tariff * tariff;
+
+ const Services & m_services;
+
+ TraffStat traffStat;
+ std::pair<time_t, TraffStat> traffStatSaved;
+
+ const Settings * settings;
+
+ std::set<const Auth *> authorizedBy;
+ time_t authorizedModificationTime;
+
+ std::vector<Message> messages;
+
+ bool deleted;
+
+ time_t lastWriteStat;
+ time_t lastWriteDetailedStat;
+
+ // Properties
+ UserProperty<double> & cash;
+ UserProperty<DirTraff> & up;
+ UserProperty<DirTraff> & down;
+ UserProperty<double> & lastCashAdd;
+ UserProperty<time_t> & passiveTime;
+ UserProperty<time_t> & lastCashAddTime;
+ UserProperty<double> & freeMb;
+ UserProperty<time_t> & lastActivityTime;
+ UserProperty<std::string> & password;
+ UserProperty<int> & passive;
+ UserProperty<int> & disabled;
+ UserProperty<int> & disabledDetailStat;
+ UserProperty<int> & alwaysOnline;
+ UserProperty<std::string> & tariffName;
+ UserProperty<std::string> & nextTariff;
+ UserProperty<std::string> & address;
+ UserProperty<std::string> & note;
+ UserProperty<std::string> & group;
+ UserProperty<std::string> & email;
+ UserProperty<std::string> & phone;
+ UserProperty<std::string> & realName;
+ UserProperty<double> & credit;
+ UserProperty<time_t> & creditExpire;
+ UserProperty<UserIPs> & ips;
+ UserProperty<std::string> & userdata0;
+ UserProperty<std::string> & userdata1;
+ UserProperty<std::string> & userdata2;
+ UserProperty<std::string> & userdata3;
+ UserProperty<std::string> & userdata4;
+ UserProperty<std::string> & userdata5;
+ UserProperty<std::string> & userdata6;
+ UserProperty<std::string> & userdata7;
+ UserProperty<std::string> & userdata8;
+ UserProperty<std::string> & userdata9;
+
+ // End properties
+
+ DirTraff sessionUpload;
+ DirTraff sessionDownload;
+ time_t sessionUploadModTime;
+ time_t sessionDownloadModTime;
+
+ CHG_PASSIVE_NOTIFIER passiveNotifier;
+ CHG_DISABLED_NOTIFIER disabledNotifier;
+ CHG_TARIFF_NOTIFIER tariffNotifier;
+ CHG_CASH_NOTIFIER cashNotifier;
+ CHG_IPS_NOTIFIER ipNotifier;
+
+ mutable pthread_mutex_t mutex;
+
+ std::string errorStr;