3 $Date: 2010/03/11 14:42:05 $
14 #include "resetable.h"
17 //-----------------------------------------------------------------------------
24 disabledDetailStat(0),
37 userdata(USERDATA_NUM),
45 int disabledDetailStat;
47 std::string tariffName;
54 std::vector<std::string> services;
57 std::string nextTariff;
58 std::vector<std::string> userdata;
62 //-----------------------------------------------------------------------------
81 userdata(USERDATA_NUM),
88 USER_CONF_RES & operator=(const USER_CONF & uc)
90 userdata.resize(USERDATA_NUM);
91 password = uc.password;
93 disabled = uc.disabled;
94 disabledDetailStat = uc.disabledDetailStat;
95 alwaysOnline = uc.alwaysOnline;
96 tariffName = uc.tariffName;
101 realName = uc.realName;
105 nextTariff = uc.nextTariff;
106 for (size_t i = 0; i < USERDATA_NUM; i++) userdata[i] = uc.userdata[i];
107 services.resize(uc.services.size());
108 for (size_t i = 0; i < uc.services.size(); ++i) services[i] = uc.services[i];
109 creditExpire = uc.creditExpire;
113 USER_CONF GetData() const
116 uc.password = password.data();
117 uc.passive = passive.data();
118 uc.disabled = disabled.data();
119 uc.disabledDetailStat = disabledDetailStat.data();
120 uc.alwaysOnline = alwaysOnline.data();
121 uc.tariffName = tariffName.data();
122 uc.address = address.data();
123 uc.phone = phone.data();
124 uc.email = email.data();
125 uc.note = note.data();
126 uc.realName = realName.data();
127 uc.corp = corp.data();
128 uc.group = group.data();
129 uc.credit = credit.data();
130 uc.nextTariff = nextTariff.data();
131 for (size_t i = 0; i < USERDATA_NUM; i++)
133 uc.userdata[i] = userdata[i].data();
135 uc.services.resize(services.size());
136 for (size_t i = 0; i < services.size(); ++i)
137 uc.services[i] = services[i].data();
138 uc.creditExpire = creditExpire.data();
142 //-------------------------------------------------------------------------
144 RESETABLE<std::string> password;
145 RESETABLE<int> passive;
146 RESETABLE<int> disabled;
147 RESETABLE<int> disabledDetailStat;
148 RESETABLE<int> alwaysOnline;
149 RESETABLE<std::string> tariffName;
150 RESETABLE<std::string> address;
151 RESETABLE<std::string> phone;
152 RESETABLE<std::string> email;
153 RESETABLE<std::string> note;
154 RESETABLE<std::string> realName;
155 RESETABLE<std::string> corp;
156 RESETABLE<std::string> group;
157 RESETABLE<double> credit;
158 RESETABLE<std::string> nextTariff;
159 std::vector<RESETABLE<std::string> > userdata;
160 std::vector<RESETABLE<std::string> > services;
161 RESETABLE<time_t> creditExpire;
162 RESETABLE<USER_IPS> ips;
164 //-----------------------------------------------------------------------------