]> git.stg.codes - stg.git/blobdiff - projects/stargazer/user_impl.cpp
Ticket 52. Definition of the tariff pointer added to the
[stg.git] / projects / stargazer / user_impl.cpp
index aea25c781b43577c3bfd4b7fb50ea652f8b45210..d530108b95e7f225b42e32ce544662559aba6ac3 100644 (file)
@@ -134,6 +134,8 @@ USER_IMPL::USER_IMPL(const SETTINGS * s,
       userdata7(property.userdata7),
       userdata8(property.userdata8),
       userdata9(property.userdata9),
+      sessionUploadModTime(stgTime),
+      sessionDownloadModTime(stgTime),
       passiveNotifier(this),
       disabledNotifier(this),
       tariffNotifier(this),
@@ -204,6 +206,8 @@ USER_IMPL::USER_IMPL(const SETTINGS_IMPL * s,
       userdata7(property.userdata7),
       userdata8(property.userdata8),
       userdata9(property.userdata9),
+      sessionUploadModTime(stgTime),
+      sessionDownloadModTime(stgTime),
       passiveNotifier(this),
       disabledNotifier(this),
       tariffNotifier(this),
@@ -218,6 +222,7 @@ void USER_IMPL::Init()
 {
 password = "*_EMPTY_PASSWORD_*";
 tariffName = NO_TARIFF_NAME;
+tariff = tariffs->FindByName(tariffName);
 ips = StrToIPS("*");
 lastWriteStat = stgTime + random() % settings->GetStatWritePeriod();
 lastWriteDetailedStat = stgTime;
@@ -298,6 +303,8 @@ USER_IMPL::USER_IMPL(const USER_IMPL & u)
       userdata9(property.userdata9),
       sessionUpload(),
       sessionDownload(),
+      sessionUploadModTime(stgTime),
+      sessionDownloadModTime(stgTime),
       passiveNotifier(this),
       disabledNotifier(this),
       tariffNotifier(this),
@@ -1184,7 +1191,7 @@ if (nextTariff.ConstData() != "")
         }
     else
         {
-        std::string message = tariff->TariffChangeIsAllowed(*nt);
+        std::string message = tariff->TariffChangeIsAllowed(*nt, stgTime);
         if (message.empty())
             {
             property.tariffName.Set(nextTariff, sysAdmin, login, store);