- std::set<const AUTH *> authorizedBy;
-
- std::list<STG_MSG> messages;
-
- bool deleted;
-
- time_t lastWriteStat;
- time_t lastWriteDetailedStat;
-
- // 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<std::string> & password;
- USER_PROPERTY<int> & passive;
- USER_PROPERTY<int> & disabled;
- USER_PROPERTY<int> & disabledDetailStat;
- USER_PROPERTY<int> & alwaysOnline;
- USER_PROPERTY<std::string> & tariffName;
- USER_PROPERTY<std::string> & nextTariff;
- USER_PROPERTY<std::string> & address;
- USER_PROPERTY<std::string> & note;
- USER_PROPERTY<std::string> & group;
- USER_PROPERTY<std::string> & email;
- USER_PROPERTY<std::string> & phone;
- USER_PROPERTY<std::string> & realName;
- USER_PROPERTY<double> & credit;
- USER_PROPERTY<time_t> & creditExpire;
- USER_PROPERTY<USER_IPS> & ips;
- USER_PROPERTY<std::string> & userdata0;
- USER_PROPERTY<std::string> & userdata1;
- USER_PROPERTY<std::string> & userdata2;
- USER_PROPERTY<std::string> & userdata3;
- USER_PROPERTY<std::string> & userdata4;
- USER_PROPERTY<std::string> & userdata5;
- USER_PROPERTY<std::string> & userdata6;
- USER_PROPERTY<std::string> & userdata7;
- USER_PROPERTY<std::string> & userdata8;
- USER_PROPERTY<std::string> & userdata9;
-
- // End properties
-
- DIR_TRAFF sessionUpload;
- DIR_TRAFF sessionDownload;
-
- CHG_PASSIVE_NOTIFIER passiveNotifier;
- CHG_TARIFF_NOTIFIER tariffNotifier;
- CHG_CASH_NOTIFIER cashNotifier;
- CHG_IPS_NOTIFIER ipNotifier;
-
- mutable pthread_mutex_t mutex;
-
- std::string errorStr;
+ DirTraff sessionUpload;
+ DirTraff sessionDownload;
+ time_t sessionUploadModTime;
+ time_t sessionDownloadModTime;
+
+ ScopedConnection m_beforePassiveConn;
+ void onPassiveChange(int oldVal, int newVal);
+
+ ScopedConnection m_afterDisabledConn;
+ void onDisabledChange(int oldVal, int newVal);
+
+ ScopedConnection m_beforeTariffConn;
+ void onTariffChange(const std::string& oldVal, const std::string& newVal);
+
+ ScopedConnection m_beforeCashConn;
+ void onCashChange(double oldVal, double newVal);
+
+ ScopedConnection m_afterIPConn;
+ void onIPChange(const UserIPs& oldVal, const UserIPs& newVal);
+
+ mutable std::mutex m_mutex;
+
+ std::string errorStr;
+
+ double getPassiveTimePart() const;