Пример #1
0
        private void BlockNotPaidPortal(Tenant tenant)
        {
            if (tenant == null)
            {
                return;
            }

            var passthroughtRequestEndings = new[] { ".htm", ".ashx", ".png", ".ico", ".less", ".css", ".js", "capabilities.json" };

            if (passthroughtRequestEndings.Any(path => Request.Url.AbsolutePath.EndsWith(path, StringComparison.InvariantCultureIgnoreCase)))
            {
                return;
            }

            if (!TenantExtra.EnableTariffSettings && TenantExtra.GetCurrentTariff().State >= TariffState.NotPaid)
            {
                if (string.IsNullOrEmpty(AdditionalWhiteLabelSettings.Instance.BuyUrl) ||
                    AdditionalWhiteLabelSettings.Instance.BuyUrl == AdditionalWhiteLabelSettings.DefaultBuyUrl)
                {
                    LogManager.GetLogger("ASC").WarnFormat("Tenant {0} is not paid", tenant.TenantId);
                    Response.StatusCode = (int)HttpStatusCode.PaymentRequired;
                    Response.End();
                }
                else if (!Request.Url.AbsolutePath.EndsWith(CommonLinkUtility.ToAbsolute(PaymentRequired.Location)))
                {
                    ResponseRedirect(PaymentRequired.Location, HttpStatusCode.PaymentRequired);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //timezone & language
            _timelngHolder.Controls.Add(LoadControl(TimeAndLanguage.Location));

            if (SetupInfo.IsVisibleSettings <PromoCode>() &&
                TenantExtra.GetCurrentTariff().State == ASC.Core.Billing.TariffState.Trial &&
                string.IsNullOrEmpty(CoreContext.TenantManager.GetCurrentTenant().PartnerId))
            {
                promoCodeSettings.Controls.Add(LoadControl(PromoCode.Location));
            }

            //dns
            if (SetupInfo.IsVisibleSettings <DnsSettings.DnsSettings>())
            {
                _dnsSettings.Controls.Add(LoadControl(DnsSettings.DnsSettings.Location));
            }

            //Portal version
            if (SetupInfo.IsVisibleSettings <VersionSettings.VersionSettings>() && 1 < CoreContext.TenantManager.GetTenantVersions().Count())
            {
                _portalVersionSettings.Controls.Add(LoadControl(VersionSettings.VersionSettings.Location));
            }

            //greeting settings
            _greetingSettings.Controls.Add(LoadControl(GreetingSettings.Location));

            //portal rename control
            _portalRename.Controls.Add(LoadControl(PortalRename.Location));
        }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            UsersCount    = TenantStatisticsProvider.GetUsersCount();
            UsedSize      = TenantStatisticsProvider.GetUsedSize();
            CurrentTariff = TenantExtra.GetCurrentTariff();
            CurrentQuota  = TenantExtra.GetTenantQuota();

            var partner = CoreContext.PaymentManager.GetApprovedPartner();

            if (partner != null)
            {
                Partner = partner;

                _quotaList = CoreContext.PaymentManager.GetPartnerTariffs(Partner.Id);

                if (!string.IsNullOrEmpty(Partner.Currency))
                {
                    Region = new RegionInfo(Partner.Currency);
                }

                var control = (TariffPartner)LoadControl(TariffPartner.Location);
                control.CurPartner        = Partner;
                control.TariffNotPaid     = CurrentTariff.State >= TariffState.NotPaid;
                control.TariffProlongable = CurrentTariff.Prolongable;
                PaymentsCodeHolder.Controls.Add(control);
            }

            if (_quotaList == null || !_quotaList.Any())
            {
                _quotaList = TenantExtra.GetTenantQuotas();
            }
            else if (!CurrentQuota.Trial)
            {
                CurrentQuota = _quotaList.FirstOrDefault(q => q.Id == CurrentQuota.Id) ?? CurrentQuota;
            }
            _quotaList = _quotaList.OrderBy(r => r.ActiveUsers).ToList().Where(r => !r.Trial);
            QuotasYear = _quotaList.Where(r => r.Year).ToList();

            HideBuyRecommendation = CurrentTariff.Autorenewal || TariffSettings.GetTariffSettings() || Partner != null;

            downgradeInfoContainer.Options.IsPopup     = true;
            buyRecommendationContainer.Options.IsPopup = true;
            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            if (StudioSmsNotificationSettings.IsVisibleSettings &&
                (SettingsManager.Instance.LoadSettings <StudioSmsNotificationSettings>(TenantProvider.CurrentTenantID).EnableSetting ||
                 CoreContext.UserManager.IsUserInGroup(SecurityContext.CurrentAccount.ID, Constants.GroupAdmin.ID)) &&
                Partner == null)
            {
                SmsEnable = true;
                var smsBuy = (SmsBuy)LoadControl(SmsBuy.Location);
                smsBuy.ShowLink = !SettingsManager.Instance.LoadSettings <StudioSmsNotificationSettings>(TenantProvider.CurrentTenantID).EnableSetting;
                SmsBuyHolder.Controls.Add(smsBuy);
            }

            if (Partner == null)
            {
                RegisterScript();
            }
        }
Пример #4
0
        private void BlockNotPaidPortal(Tenant tenant)
        {
            if (tenant == null)
            {
                return;
            }

            var passthroughtRequestEndings = new[] { ".htm", ".ashx", ".png", ".ico" };

            if (passthroughtRequestEndings.Any(path => Request.Url.AbsolutePath.EndsWith(path, StringComparison.InvariantCultureIgnoreCase)))
            {
                return;
            }

            if (!TenantExtra.EnableTarrifSettings && TenantExtra.GetCurrentTariff().State >= TariffState.NotPaid)
            {
                ResponseRedirect("~/402.htm", HttpStatusCode.PaymentRequired);
            }

            if (CoreContext.Configuration.Standalone)
            {
                var licenseDay = TenantExtra.GetCurrentTariff().LicenseDate.Date;
                if (licenseDay < DateTime.Today && licenseDay < TenantExtra.VersionReleaseDate)
                {
                    ResponseRedirect("~/402.htm", HttpStatusCode.PaymentRequired);
                }
            }
        }
        public static bool IsNotPaid()
        {
            Tariff tariff;

            return(TenantExtra.EnableTarrifSettings &&
                   ((tariff = TenantExtra.GetCurrentTariff()).State >= TariffState.NotPaid ||
                    TenantExtra.Enterprise && !TenantExtra.EnterprisePaid && tariff.LicenseDate == DateTime.MaxValue));
        }
Пример #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page
            .RegisterBodyScripts("~/usercontrols/management/tariffsettings/js/tariffusage.js",
                                 "~/js/asc/plugins/countries.js",
                                 "~/js/asc/plugins/phonecontroller.js")
            .RegisterStyle(
                "~/skins/default/phonecontroller.css",
                "~/usercontrols/management/tariffsettings/css/tariff.less",
                "~/usercontrols/management/tariffsettings/css/tariffusage.less")
            .RegisterClientScript(new CountriesResources());

            CurrentRegion = RegionDefault;
            Regions.Add(CurrentRegion);

            UsersCount    = TenantStatisticsProvider.GetUsersCount();
            UsedSize      = TenantStatisticsProvider.GetUsedSize();
            CurrentTariff = TenantExtra.GetCurrentTariff();
            CurrentQuota  = TenantExtra.GetTenantQuota();

            if (_quotaList == null || !_quotaList.Any())
            {
                _quotaList = TenantExtra.GetTenantQuotas();
            }
            else if (!CurrentQuota.Trial)
            {
                CurrentQuota = _quotaList.FirstOrDefault(q => q.Id == CurrentQuota.Id) ?? CurrentQuota;
            }
            _quotaList = _quotaList.OrderBy(r => r.ActiveUsers).ToList().Where(r => !r.Trial);
            QuotasYear = _quotaList.Where(r => r.Year).ToList();

            MonthIsDisable = !CurrentQuota.Free && (CurrentQuota.Year || CurrentQuota.Year3) && CurrentTariff.State == TariffState.Paid;
            YearIsDisable  = !CurrentQuota.Free && CurrentQuota.Year3 && CurrentTariff.State == TariffState.Paid;

            var minYearQuota = QuotasYear.FirstOrDefault(q => q.ActiveUsers >= UsersCount && q.MaxTotalSize >= UsedSize);

            MinActiveUser = minYearQuota != null ? minYearQuota.ActiveUsers : (QuotasYear.Count > 0 ? QuotasYear.Last().ActiveUsers : 0 + 1);

            HideBuyRecommendation = CurrentTariff.Autorenewal || TariffSettings.HideRecommendation;

            downgradeInfoContainer.Options.IsPopup     = true;
            buyRecommendationContainer.Options.IsPopup = true;
            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            if (StudioSmsNotificationSettings.IsVisibleSettings &&
                (SettingsManager.Instance.LoadSettings <StudioSmsNotificationSettings>(TenantProvider.CurrentTenantID).EnableSetting ||
                 CoreContext.UserManager.IsUserInGroup(SecurityContext.CurrentAccount.ID, Constants.GroupAdmin.ID)))
            {
                SmsEnable = true;
                var smsBuy = (SmsBuy)LoadControl(SmsBuy.Location);
                smsBuy.ShowLink = !SettingsManager.Instance.LoadSettings <StudioSmsNotificationSettings>(TenantProvider.CurrentTenantID).EnableSetting;
                SmsBuyHolder.Controls.Add(smsBuy);
            }

            RegisterScript();
            CurrencyCheck();
        }
Пример #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            //transfer portal
            _transferPortalSettings.Controls.Add(LoadControl(TransferPortal.Location));

            //timezone & language
            _timelngHolder.Controls.Add(LoadControl(TimeAndLanguage.Location));

            if (SetupInfo.IsVisibleSettings <PromoCode>() &&
                TenantExtra.GetCurrentTariff().State == ASC.Core.Billing.TariffState.Trial &&
                string.IsNullOrEmpty(CoreContext.TenantManager.GetCurrentTenant().PartnerId))
            {
                promoCodeSettings.Controls.Add(LoadControl(PromoCode.Location));
            }

            //Portal version
            if (SetupInfo.IsVisibleSettings <VersionSettings.VersionSettings>() && 1 < CoreContext.TenantManager.GetTenantVersions().Count())
            {
                _portalVersionSettings.Controls.Add(LoadControl(VersionSettings.VersionSettings.Location));
            }

            //main domain settings
            _mailDomainSettings.Controls.Add(LoadControl(MailDomainSettings.Location));

            //strong security password settings
            _strongPasswordSettings.Controls.Add(LoadControl(PasswordSettings.Location));

            //invitational link
            invLink.Controls.Add(LoadControl(InviteLink.Location));

            //sms settings
            var loadSms   = true;
            var partnerId = CoreContext.TenantManager.GetCurrentTenant().PartnerId;

            if (!string.IsNullOrEmpty(partnerId))
            {
                var partner = CoreContext.PaymentManager.GetPartner(partnerId);

                if (partner != null && partner.Status == PartnerStatus.Approved && !partner.Removed && partner.PartnerType != PartnerType.System)
                {
                    loadSms = false;
                }
            }
            if (StudioSmsNotificationSettings.IsVisibleSettings && loadSms)
            {
                _smsValidationSettings.Controls.Add(LoadControl(SmsValidationSettings.Location));
            }

            //admin message settings
            _admMessSettings.Controls.Add(LoadControl(AdminMessageSettings.Location));

            //default page settings
            _defaultPageSeettings.Controls.Add(LoadControl(DefaultPageSettings.Location));
        }
Пример #8
0
        public bool ActivateTrial()
        {
            if (!CoreContext.Configuration.Standalone)
            {
                throw new NotSupportedException();
            }
            if (!CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).IsAdmin())
            {
                throw new SecurityException();
            }

            var curQuota = TenantExtra.GetTenantQuota();

            if (curQuota.Id != Tenant.DEFAULT_TENANT)
            {
                return(false);
            }
            if (curQuota.Trial)
            {
                return(false);
            }

            var curTariff = TenantExtra.GetCurrentTariff();

            if (curTariff.DueDate.Date != DateTime.MaxValue.Date)
            {
                return(false);
            }

            var quota = new TenantQuota(-1000)
            {
                Name         = "apirequest",
                ActiveUsers  = curQuota.ActiveUsers,
                MaxFileSize  = curQuota.MaxFileSize,
                MaxTotalSize = curQuota.MaxTotalSize,
                Features     = curQuota.Features
            };

            quota.Trial = true;

            CoreContext.TenantManager.SaveTenantQuota(quota);

            var DEFAULT_TRIAL_PERIOD = 30;

            var tariff = new Tariff
            {
                QuotaId = quota.Id,
                DueDate = DateTime.Today.AddDays(DEFAULT_TRIAL_PERIOD)
            };

            CoreContext.PaymentManager.SetTariff(-1, tariff);

            MessageService.Send(HttpContext.Current.Request, MessageAction.LicenseKeyUploaded);

            return(true);
        }
Пример #9
0
        protected Tuple <string, string, string> GetShoppingData(TenantQuota quota, string currency, int quantity)
        {
            var getLink    = true;
            var buttonText = Resource.TariffButtonBuy;
            var infoText   = string.Empty;

            var currentUsersCount    = TenantStatisticsProvider.GetUsersCount();
            var currentVisitorsCount = TenantStatisticsProvider.GetVisitorsCount();
            var currentUsedSize      = TenantStatisticsProvider.GetUsedSize();
            var currentTariff        = TenantExtra.GetCurrentTariff();
            var currentQuota         = TenantExtra.GetTenantQuota();
            var language             = Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName;
            var customerId           = CoreContext.TenantManager.GetCurrentTenant().OwnerId.ToString();

            var quotaActiveUsers  = quota.ActiveUsers == -1 ? quantity : quota.ActiveUsers;
            var quotaMaxTotalSize = quota.ActiveUsers == -1 ? quota.MaxTotalSize * quantity : quota.MaxTotalSize;

            if (quotaActiveUsers < currentUsersCount ||
                quotaMaxTotalSize < currentUsedSize ||
                (!currentQuota.Free && (quotaActiveUsers * Constants.CoefficientOfVisitors) < currentVisitorsCount))
            {
                getLink = false;
            }
            else if (Equals(quota.Id, currentQuota.Id) &&
                     quantity == currentTariff.Quantity)
            {
                buttonText = Resource.TariffButtonExtend;
                if (!currentTariff.Prolongable)
                {
                    getLink = false;
                }
                else if (currentTariff.Autorenewal)
                {
                    getLink    = false;
                    buttonText = Resource.TariffEnabledAutorenew;
                    infoText   = Resource.TariffRemarkProlongEnable;
                }
            }
            else if (currentTariff.Prolongable)
            {
                buttonText = Resource.TariffButtonBuy;
                infoText   = Resource.TariffRemarkProlongDisable;
            }
            else if (currentTariff.State == TariffState.Paid && quotaActiveUsers < currentQuota.ActiveUsers)
            {
                getLink    = false;
                buttonText = Resource.TariffButtonBuy;
                infoText   = currentQuota.Year3 ? Resource.TariffRemarkDisabledYear : Resource.TariffRemarkDisabledMonth;
            }

            var link = getLink ? GetShoppingLink(quota, currency, language, customerId, quantity) : string.Empty;

            return(new Tuple <string, string, string>(buttonText, infoText, link));
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/management/tariffsettings/js/tarifflimitexceed.js"));
            Page.RegisterStyleControl(VirtualPathUtility.ToAbsolute("~/usercontrols/management/tariffsettings/css/tarifflimitexceed.less"));

            tariffLimitExceedUsersDialog.Options.IsPopup   = true;
            tariffLimitExceedStorageDialog.Options.IsPopup = true;
            tariffLimitDocsEditionDialog.Options.IsPopup   = true;

            IsDefaultTariff = TenantExtra.GetCurrentTariff().QuotaId.Equals(Tenant.DEFAULT_TENANT);
        }
Пример #11
0
 public object GetTenantExtra()
 {
     return(new
     {
         opensource = TenantExtra.Opensource,
         enterprise = TenantExtra.Enterprise,
         tariff = TenantExtra.GetCurrentTariff(),
         quota = TenantExtra.GetTenantQuota(),
         notPaid = TenantStatisticsProvider.IsNotPaid(),
         licenseAccept = Web.Studio.UserControls.Management.TariffSettings.LicenseAccept
     });
 }
Пример #12
0
        public AjaxResponse RequestPayPal(int qoutaId)
        {
            var res = new AjaxResponse();

            try
            {
                if (!HttpRuntime.Cache.Get(PartnerCache).Equals(DateTime.UtcNow))
                {
                    HttpRuntime.Cache.Insert(PartnerCache, DateTime.UtcNow);
                }

                var partnerId = CoreContext.TenantManager.GetCurrentTenant().PartnerId;
                var partner   = CoreContext.PaymentManager.GetPartner(partnerId);

                if (partner == null || partner.Status != PartnerStatus.Approved || partner.Removed || partner.PaymentMethod != PartnerPaymentMethod.PayPal)
                {
                    throw new MethodAccessException(Resource.PartnerPayPalExc);
                }

                var tenantQuota = TenantExtra.GetTenantQuota(qoutaId);

                var curruntQuota = TenantExtra.GetTenantQuota();
                if (TenantExtra.GetCurrentTariff().State == TariffState.Paid &&
                    tenantQuota.ActiveUsers < curruntQuota.ActiveUsers &&
                    tenantQuota.Year == curruntQuota.Year)
                {
                    throw new MethodAccessException(Resource.PartnerPayPalDowngrade);
                }

                if (tenantQuota.Price > partner.AvailableCredit)
                {
                    CoreContext.PaymentManager.RequestClientPayment(partnerId, qoutaId, false);
                    throw new Exception(Resource.PartnerRequestLimitInfo);
                }

                var usersCount = TenantStatisticsProvider.GetUsersCount();
                var usedSize   = TenantStatisticsProvider.GetUsedSize();

                if (tenantQuota.ActiveUsers < usersCount || tenantQuota.MaxTotalSize < usedSize)
                {
                    res.rs2 = "quotaexceed";
                    return(res);
                }

                res.rs1 = CoreContext.PaymentManager.GetButton(partner.Id, qoutaId);
            }
            catch (Exception e)
            {
                res.message = e.Message;
            }
            return(res);
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.RegisterBodyScripts("~/js/uploader/ajaxupload.js");
            Page.RegisterBodyScripts("~/usercontrols/management/tariffsettings/js/tariffstandalone.js");
            Page.RegisterStyle("~/usercontrols/management/tariffsettings/css/tariff.less");
            Page.RegisterStyle("~/usercontrols/management/tariffsettings/css/tariffstandalone.less");

            UsersCount    = TenantStatisticsProvider.GetUsersCount();
            CurrentTariff = TenantExtra.GetCurrentTariff();
            CurrentQuota  = TenantExtra.GetTenantQuota();

            AjaxPro.Utility.RegisterTypeForAjax(GetType());
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType());
            Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/Management/StudioSettings/studiosettings.js"));

            //transfer portal
            _transferPortalSettings.Controls.Add(LoadControl(TransferPortal.Location));

            //timezone & language
            _timelngHolder.Controls.Add(LoadControl(TimeAndLanguage.Location));

            if (SetupInfo.IsVisibleSettings <PromoCode>() &&
                TenantExtra.GetCurrentTariff().State == ASC.Core.Billing.TariffState.Trial &&
                string.IsNullOrEmpty(CoreContext.TenantManager.GetCurrentTenant().PartnerId))
            {
                promoCodeSettings.Controls.Add(LoadControl(PromoCode.Location));
            }

            //Portal version
            if (SetupInfo.IsVisibleSettings <VersionSettings.VersionSettings>() && 1 < CoreContext.TenantManager.GetTenantVersions().Count())
            {
                _portalVersionSettings.Controls.Add(LoadControl(VersionSettings.VersionSettings.Location));
            }

            //main domain settings
            _mailDomainSettings.Controls.Add(LoadControl(MailDomainSettings.Location));

            //strong security password settings
            _strongPasswordSettings.Controls.Add(LoadControl(PasswordSettings.Location));

            //invitational link
            invLink.Controls.Add(LoadControl(InviteLink.Location));

            //sms settings
            if (SetupInfo.IsVisibleSettings <StudioSmsNotificationSettings>() && CoreContext.PaymentManager.GetApprovedPartner() == null)
            {
                _smsValidationSettings.Controls.Add(LoadControl(SmsValidationSettings.Location));
            }

            //admin message settings
            _admMessSettings.Controls.Add(LoadControl(AdminMessageSettings.Location));

            //default page settings
            _defaultPageSeettings.Controls.Add(LoadControl(DefaultPageSettings.Location));

            /*if (CoreContext.Configuration.Standalone)
             * {
             *  _uploadHttpsSeettings.Controls.Add(LoadControl(UploadHttps.Location));
             * }*/
        }
Пример #15
0
        protected override void OnPreInit(EventArgs e)
        {
            base.OnPreInit(e);

            if (CoreContext.Configuration.Personal)
            {
                Context.Response.Redirect(FilesLinkUtility.FilesBaseAbsolutePath);
            }

            if (TenantExtra.GetCurrentTariff().State < TariffState.NotPaid)
            {
                Response.Redirect(CommonLinkUtility.GetDefault(), true);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page
            .RegisterBodyScripts("~/UserControls/Management/TariffSettings/js/tariffusage.js",
                                 "~/js/asc/plugins/countries.js",
                                 "~/js/asc/plugins/phonecontroller.js")
            .RegisterStyle(
                "~/skins/default/phonecontroller.css",
                "~/UserControls/Management/TariffSettings/css/tariff.less",
                "~/UserControls/Management/TariffSettings/css/tariffusage.less")
            .RegisterClientScript(new CountriesResources());

            CurrentRegion = RegionDefault;
            Regions.Add(CurrentRegion);

            UsersCount    = TenantStatisticsProvider.GetUsersCount();
            UsedSize      = TenantStatisticsProvider.GetUsedSize();
            CurrentTariff = TenantExtra.GetCurrentTariff();
            CurrentQuota  = TenantExtra.GetTenantQuota();

            if (_quotaList == null || !_quotaList.Any())
            {
                _quotaList = TenantExtra.GetTenantQuotas();
            }
            else if (!CurrentQuota.Trial)
            {
                CurrentQuota = _quotaList.FirstOrDefault(q => q.Id == CurrentQuota.Id) ?? CurrentQuota;
            }
            _quotaList = _quotaList.OrderBy(r => r.ActiveUsers).ToList().Where(r => !r.Trial);
            QuotasYear = _quotaList.Where(r => r.Year).ToList();

            MonthIsDisable = !CurrentQuota.Free && (CurrentQuota.Year || CurrentQuota.Year3) && CurrentTariff.State == TariffState.Paid;
            YearIsDisable  = !CurrentQuota.Free && CurrentQuota.Year3 && CurrentTariff.State == TariffState.Paid;

            var minYearQuota = QuotasYear.FirstOrDefault(q => q.ActiveUsers >= UsersCount && q.MaxTotalSize >= UsedSize);

            MinActiveUser = minYearQuota != null ? minYearQuota.ActiveUsers : (QuotasYear.Count > 0 ? QuotasYear.Last().ActiveUsers : 0 + 1);

            HideBuyRecommendation = CurrentTariff.Autorenewal || TariffSettings.HideRecommendation;

            downgradeInfoContainer.Options.IsPopup     = true;
            buyRecommendationContainer.Options.IsPopup = true;
            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            RegisterScript();
            CurrencyCheck();
        }
Пример #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.RegisterBodyScripts("~/js/uploader/ajaxupload.js");
            Page.RegisterBodyScripts("~/usercontrols/management/tariffsettings/js/tariffstandalone.js");
            Page.RegisterStyle("~/usercontrols/management/tariffsettings/css/tariff.less");
            Page.RegisterStyle("~/usercontrols/management/tariffsettings/css/tariffstandalone.less");

            UsersCount    = TenantStatisticsProvider.GetUsersCount();
            CurrentTariff = TenantExtra.GetCurrentTariff();
            CurrentQuota  = TenantExtra.GetTenantQuota();
            TenantCount   = CoreContext.TenantManager.GetTenants().Count(t => t.Status == TenantStatus.Active);

            Settings = AdditionalWhiteLabelSettings.Instance;
            Settings.LicenseAgreementsUrl = CommonLinkUtility.GetRegionalUrl(Settings.LicenseAgreementsUrl, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);

            AjaxPro.Utility.RegisterTypeForAjax(GetType());
        }
Пример #18
0
 public object GetTenantExtra()
 {
     return(new
     {
         customMode = CoreBaseSettings.CustomMode,
         opensource = TenantExtra.Opensource,
         enterprise = TenantExtra.Enterprise,
         tariff = TenantExtra.GetCurrentTariff(),
         quota = TenantExtra.GetTenantQuota(),
         notPaid = TenantExtra.IsNotPaid(),
         licenseAccept = SettingsManager.LoadForCurrentUser <TariffSettings>().LicenseAcceptSetting,
         enableTariffPage = //TenantExtra.EnableTarrifSettings - think about hide-settings for opensource
                            (!CoreBaseSettings.Standalone || !string.IsNullOrEmpty(LicenseReader.LicensePath)) &&
                            string.IsNullOrEmpty(SetupInfo.AmiMetaUrl) &&
                            !CoreBaseSettings.CustomMode
     });
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (CoreContext.Configuration.PartnerHosted)
            {
                HostedPartner = CoreContext.PaymentManager.GetApprovedPartner() ?? new Partner();
            }

            Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/management/tariffsettings/js/tarifflimitexceed.js"));
            Page.RegisterStyleControl(VirtualPathUtility.ToAbsolute("~/usercontrols/management/tariffsettings/css/tarifflimitexceed.less"));

            tariffLimitExceedUsersDialog.Options.IsPopup   = true;
            tariffLimitExceedStorageDialog.Options.IsPopup = true;
            tariffLimitDocsEditionDialog.Options.IsPopup   = true;
            UnauthorizedPartnerDialog.Options.IsPopup      = true;

            IsDefaultTariff = TenantExtra.GetCurrentTariff().QuotaId.Equals(Tenant.DEFAULT_TENANT);
        }
Пример #20
0
 public object GetTenantExtra()
 {
     return(new
     {
         customMode = CoreContext.Configuration.CustomMode,
         opensource = TenantExtra.Opensource,
         enterprise = TenantExtra.Enterprise,
         tariff = TenantExtra.GetCurrentTariff(),
         quota = TenantExtra.GetTenantQuota(),
         notPaid = TenantStatisticsProvider.IsNotPaid(),
         licenseAccept = Web.Studio.UserControls.Management.TariffSettings.LicenseAccept,
         enableTariffPage = //TenantExtra.EnableTariffSettings - think about hide-settings for opensource
                            (!CoreContext.Configuration.Standalone || !string.IsNullOrEmpty(LicenseReader.LicensePath)) &&
                            string.IsNullOrEmpty(SetupInfo.AmiMetaUrl) &&
                            !CoreContext.Configuration.CustomMode
     });
 }
Пример #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            InitScripts();

            if (!DisabledTopStudioPanel)
            {
                TopContent.Controls.Add(TopStudioPanel);
            }

            if (_browserNotSupported == null && !string.IsNullOrEmpty(WebConfigurationManager.AppSettings["web.browser-not-supported"]))
            {
                _browserNotSupported = new Regex(WebConfigurationManager.AppSettings["web.browser-not-supported"], RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.CultureInvariant);
            }
            if (_browserNotSupported != null && !string.IsNullOrEmpty(Request.Headers["User-Agent"]) && _browserNotSupported.Match(Request.Headers["User-Agent"]).Success)
            {
                Response.Redirect("~/browser-not-supported.htm");
            }

            if (CoreContext.Configuration.YourDocsDemo && Web.Core.Mobile.MobileDetector.IsRequestMatchesMobile(Context.Request.UserAgent, true))
            {
                Response.Redirect("~/mobile-not-supported.htm");
            }

            if (!EmailActivated && !CoreContext.Configuration.YourDocsDemo && SecurityContext.IsAuthenticated)
            {
                activateEmailPanel.Controls.Add(LoadControl(ActivateEmailPanel.Location));
            }

            if (!(Page is Auth || Page is Tariffs || Page is confirm || Page is Wizard || Page is ServerError || Page is Welcome))
            {
                var curTariff = TenantExtra.GetCurrentTariff();
                if (CoreContext.Configuration.Standalone && curTariff.QuotaId.Equals(Tenant.DEFAULT_TENANT))
                {
                    _contentHolder.Controls.Add(LoadControl(TariffLicenseOver.Location));
                }
            }
            if (AffiliateHelper.BannerAvailable)
            {
                BannerHolder.Controls.Add(LoadControl(Banner.Location));
            }

            if (!DisabledHelpTour)
            {
                HeaderContent.Controls.Add(LoadControl(UserControls.Common.HelpTour.HelpTour.Location));
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page
            .RegisterBodyScripts("~/UserControls/Management/TariffSettings/js/tariffcustom.js",
                                 "~/js/asc/plugins/countries.js",
                                 "~/js/asc/plugins/phonecontroller.js")
            .RegisterStyle(
                "~/skins/default/phonecontroller.css",
                "~/UserControls/Management/TariffSettings/css/tariff.less",
                "~/UserControls/Management/TariffSettings/css/tariffusage.less",
                "~/UserControls/Management/TariffSettings/css/tariffcustom.less")
            .RegisterClientScript(new CountriesResources());

            CurrentRegion = RegionDefault;

            UsersCount    = TenantStatisticsProvider.GetUsersCount();
            UsedSize      = TenantStatisticsProvider.GetUsedSize();
            CurrentTariff = TenantExtra.GetCurrentTariff();
            CurrentQuota  = TenantExtra.GetTenantQuota();

            if (_quotaList == null || !_quotaList.Any())
            {
                _quotaList = TenantExtra.GetTenantQuotas();
            }
            else if (!CurrentQuota.Trial)
            {
                CurrentQuota = _quotaList.FirstOrDefault(q => q.Id == CurrentQuota.Id) ?? CurrentQuota;
            }
            _quotaList = _quotaList.OrderBy(r => r.ActiveUsers).ToList().Where(r => !r.Trial);
            QuotasYear = _quotaList.Where(r => r.Year).ToList();

            MonthIsDisable = !CurrentQuota.Free && (CurrentQuota.Year || CurrentQuota.Year3) && CurrentTariff.State == TariffState.Paid;
            YearIsDisable  = !CurrentQuota.Free && CurrentQuota.Year3 && CurrentTariff.State == TariffState.Paid;

            var minYearQuota = QuotasYear.FirstOrDefault(q => q.ActiveUsers >= UsersCount && q.MaxTotalSize >= UsedSize);

            MinActiveUser = minYearQuota != null ? minYearQuota.ActiveUsers : (QuotasYear.Count > 0 ? QuotasYear.Last().ActiveUsers : 0 + 1);

            MonthPrice = Convert.ToInt32(ConfigurationManager.AppSettings["core.custom-mode.month-price"] ?? "290");
            YearPrice  = Convert.ToInt32(ConfigurationManager.AppSettings["core.custom-mode.year-price"] ?? "175");

            AjaxPro.Utility.RegisterTypeForAjax(GetType());

            CurrencyCheck();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Page
            .RegisterBodyScripts(
                "~/js/uploader/jquery.fileupload.js",
                "~/UserControls/Management/TariffSettings/js/tariffstandalone.js")
            .RegisterStyle("~/UserControls/Management/TariffSettings/css/tariff.less",
                           "~/UserControls/Management/TariffSettings/css/tariffstandalone.less");

            UsersCount    = TenantStatisticsProvider.GetUsersCount();
            CurrentTariff = TenantExtra.GetCurrentTariff();
            CurrentQuota  = TenantExtra.GetTenantQuota();

            Settings = AdditionalWhiteLabelSettings.Instance;
            Settings.LicenseAgreementsUrl  = CommonLinkUtility.GetRegionalUrl(Settings.LicenseAgreementsUrl, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
            Settings.FeedbackAndSupportUrl = CommonLinkUtility.GetRegionalUrl(Settings.FeedbackAndSupportUrl, CultureInfo.CurrentCulture.TwoLetterISOLanguageName);

            AjaxPro.Utility.RegisterTypeForAjax(GetType());
        }
Пример #24
0
        private void BlockNotPaidPortal(Tenant tenant)
        {
            if (tenant == null)
            {
                return;
            }

            var passthroughtRequestEndings = new[] { ".htm", ".ashx", ".png", ".ico", ".less", ".css", ".js" };

            if (passthroughtRequestEndings.Any(path => Request.Url.AbsolutePath.EndsWith(path, StringComparison.InvariantCultureIgnoreCase)))
            {
                return;
            }

            if (!TenantExtra.EnableTarrifSettings && TenantExtra.GetCurrentTariff().State >= TariffState.NotPaid)
            {
                if (string.IsNullOrEmpty(AdditionalWhiteLabelSettings.Instance.BuyUrl) ||
                    AdditionalWhiteLabelSettings.Instance.BuyUrl == AdditionalWhiteLabelSettings.DefaultBuyUrl)
                {
                    LogManager.GetLogger(typeof(Global)).WarnFormat("Tenant {0} is not paid", tenant.TenantId);
                    Response.StatusCode = (int)HttpStatusCode.PaymentRequired;
                    Response.End();
                }
                else if (!Request.Url.AbsolutePath.EndsWith(CommonLinkUtility.ToAbsolute(PaymentRequired.Location)))
                {
                    ResponseRedirect(PaymentRequired.Location, HttpStatusCode.PaymentRequired);
                }
                return;
            }

            if (CoreContext.Configuration.Standalone)
            {
                var licenseDay = TenantExtra.GetCurrentTariff().LicenseDate.Date;
                if (licenseDay < DateTime.Today && licenseDay < TenantExtra.VersionReleaseDate)
                {
                    LogManager.GetLogger(typeof(Global)).Fatal("The installation was updated without a license");
                    Response.StatusCode = (int)HttpStatusCode.PaymentRequired;
                    Response.End();
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(GetType());
            Page.RegisterBodyScripts(ResolveUrl("~/usercontrols/Management/StudioSettings/studiosettings.js"));

            //timezone & language
            _timelngHolder.Controls.Add(LoadControl(TimeAndLanguage.Location));

            if (SetupInfo.IsVisibleSettings <PromoCode>() &&
                TenantExtra.GetCurrentTariff().State == ASC.Core.Billing.TariffState.Trial &&
                string.IsNullOrEmpty(CoreContext.TenantManager.GetCurrentTenant().PartnerId))
            {
                promoCodeSettings.Controls.Add(LoadControl(PromoCode.Location));
            }

            //Portal version
            if (SetupInfo.IsVisibleSettings <VersionSettings.VersionSettings>() && 1 < CoreContext.TenantManager.GetTenantVersions().Count())
            {
                _portalVersionSettings.Controls.Add(LoadControl(VersionSettings.VersionSettings.Location));
            }

            //greeting settings
            _greetingSettings.Controls.Add(LoadControl(GreetingSettings.Location));
        }
Пример #26
0
        private static Tuple <string, string> GetTariffNotify()
        {
            var tariff = TenantExtra.GetCurrentTariff();

            var count = tariff.DueDate.Date.Subtract(DateTime.Today).Days;

            if (tariff.State == TariffState.Trial)
            {
                if (count <= 5)
                {
                    var text = String.Format(CoreContext.Configuration.Standalone ? Resource.TariffLinkStandalone : Resource.TrialPeriodInfoText,
                                             "<a href=\"" + TenantExtra.GetTariffPageLink() + "\">", "</a>");

                    if (count <= 0)
                    {
                        return(new Tuple <string, string>(Resource.TrialPeriodExpired, text));
                    }

                    var end = GetNumeralResourceByCount(count, Resource.Day, Resource.DaysOne, Resource.DaysTwo);
                    return(new Tuple <string, string>(string.Format(Resource.TrialPeriod, count, end), text));
                }

                if (CoreContext.Configuration.Standalone)
                {
                    return(new Tuple <string, string>(Resource.TrialPeriodInfoTextLicense, string.Empty));
                }
            }

            if (tariff.State == TariffState.Paid)
            {
                if (CoreContext.Configuration.Standalone && count < 10)
                {
                    var text = String.Format(Resource.TariffLinkStandalone,
                                             "<a href=\"" + TenantExtra.GetTariffPageLink() + "\">", "</a>");
                    if (count <= 0)
                    {
                        return(new Tuple <string, string>(Resource.PaidPeriodExpiredStandalone, text));
                    }

                    var end = GetNumeralResourceByCount(count, Resource.Day, Resource.DaysOne, Resource.DaysTwo);
                    return(new Tuple <string, string>(string.Format(Resource.PaidPeriodStandalone, count, end), text));
                }

                var  quota = TenantExtra.GetTenantQuota();
                long notifySize;
                long.TryParse(ConfigurationManager.AppSettings["web.tariff-notify.storage"] ?? "314572800", out notifySize); //300 MB
                if (notifySize > 0 && quota.MaxTotalSize - TenantStatisticsProvider.GetUsedSize() < notifySize)
                {
                    var head = string.Format(Resource.TariffExceedLimit, FileSizeComment.FilesSizeToString(quota.MaxTotalSize));
                    var text = String.Format(Resource.TariffExceedLimitInfoText, "<a href=\"" + TenantExtra.GetTariffPageLink() + "\">", "</a>");
                    return(new Tuple <string, string>(head, text));
                }
            }

            if (tariff.State == TariffState.Delay)
            {
                var text = String.Format(Resource.TariffPaymentDelayText,
                                         "<a href=\"" + TenantExtra.GetTariffPageLink() + "\">", "</a>",
                                         tariff.DelayDueDate.Date.ToLongDateString());
                return(new Tuple <string, string>(Resource.TariffPaymentDelay, text));
            }

            return(null);
        }
Пример #27
0
 public static bool IsNotPaid()
 {
     return(TenantExtra.EnableTarrifSettings && TenantExtra.GetCurrentTariff().State >= TariffState.NotPaid);
 }
 public static bool IsNotPaid()
 {
     return(TenantExtra.GetCurrentTariff().State >= TariffState.NotPaid);
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            InitScripts();

            if (!DisabledSidePanel)
            {
                EnabledWebChat = Convert.ToBoolean(ConfigurationManager.AppSettings["web.chat"] ?? "false") &&
                                 WebItemManager.Instance.GetItems(WebZoneType.CustomProductList, ItemAvailableState.Normal).
                                 Any(id => id.ID == WebItemManager.TalkProductID);
                if (EnabledWebChat)
                {
                    IsMobile = MobileDetector.IsMobile;
                    if (!IsMobile)
                    {
                        SmallChatHolder.Controls.Add(LoadControl(UserControls.Common.SmallChat.SmallChat.Location));
                    }
                }
            }

            if (!DisabledTopStudioPanel)
            {
                TopContent.Controls.Add(TopStudioPanel);
            }

            if (_browserNotSupported == null && !string.IsNullOrEmpty(WebConfigurationManager.AppSettings["web.browser-not-supported"]))
            {
                _browserNotSupported = new Regex(WebConfigurationManager.AppSettings["web.browser-not-supported"], RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.CultureInvariant);
            }
            if (_browserNotSupported != null && !string.IsNullOrEmpty(Request.Headers["User-Agent"]) && _browserNotSupported.Match(Request.Headers["User-Agent"]).Success)
            {
                Response.Redirect("~/browser-not-supported.htm");
            }

            if (!EmailActivated && !CoreContext.Configuration.Personal && SecurityContext.IsAuthenticated)
            {
                activateEmailPanel.Controls.Add(LoadControl(ActivateEmailPanel.Location));
            }

            if (AffiliateHelper.BannerAvailable || CoreContext.Configuration.Personal)
            {
                BannerHolder.Controls.Add(LoadControl(Banner.Location));
            }

            if (!DisabledHelpTour)
            {
                HeaderContent.Controls.Add(LoadControl(UserControls.Common.HelpTour.HelpTour.Location));
            }

            if (!SecurityContext.IsAuthenticated || !TenantExtra.EnableTarrifSettings || CoreContext.Configuration.Personal ||
                CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID).IsVisitor())
            {
                DisableTariffNotify = true;
            }
            else
            {
                TariffNotify     = TenantExtra.GetTariffNotify();
                TariffNotifyText = TenantExtra.GetTariffNotifyText();
                if (string.IsNullOrEmpty(TariffNotify) ||
                    (TenantExtra.GetCurrentTariff().State == TariffState.Trial && TenantExtra.GetCurrentTariff().DueDate.Subtract(DateTime.Today.Date).Days > 5))
                {
                    DisableTariffNotify = true;
                }
            }

            if (!DisableTariffNotify)
            {
                var stringBuilder = new StringBuilder();
                stringBuilder.Append("if (jq('div.mainPageLayout table.mainPageTable').hasClass('with-mainPageTableSidePanel'))jq('#infoBoxTariffNotify').removeClass('display-none');");
                Page.RegisterInlineScript(stringBuilder.ToString());
            }

            if (CoreContext.Configuration.PartnerHosted)
            {
                IsAutorizePartner = false;
                var partner = CoreContext.PaymentManager.GetApprovedPartner();
                if (partner != null)
                {
                    IsAutorizePartner = !string.IsNullOrEmpty(partner.AuthorizedKey);
                    Partner           = partner;
                }
            }
            DisablePartnerPanel = !(IsAutorizePartner.HasValue && !IsAutorizePartner.Value);

            if (!DisablePartnerPanel)
            {
                var stringBuilder = new StringBuilder();
                stringBuilder.Append("if (jq('div.mainPageLayout table.mainPageTable').hasClass('with-mainPageTableSidePanel'))jq('#infoBoxPartnerPanel').removeClass('display-none');");
                Page.RegisterInlineScript(stringBuilder.ToString());
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var currentProductId = string.IsNullOrEmpty(Request["productID"]) ? CommonLinkUtility.GetProductID() : new Guid(Request["productID"]);

            CurrentProduct = WebItemManager.Instance[currentProductId] as IProduct;

            if (CurrentProduct != null)
            {
                CurrentProductClassName = CurrentProduct.ProductClassName;
                CurrentProductName      = CurrentProduct.Name;
            }
            else
            {
                GetAddonNameAndClass();
            }

            if (!DisableSearch)
            {
                RenderSearchProducts();
                DisableSearch = DisableSearch || !SearchProducts.Any() || CoreContext.Configuration.Personal;
            }

            if (SecurityContext.IsAuthenticated)
            {
                CurrentUser = CoreContext.UserManager.GetUsers(SecurityContext.CurrentAccount.ID);

                if (CurrentUser.IsOutsider())
                {
                    DisableUserInfo = true;
                }

                UserInfoVisible = !DisableUserInfo.HasValue || !DisableUserInfo.Value;
            }

            if (!SecurityContext.IsAuthenticated ||
                !TenantExtra.EnableTariffSettings ||
                CoreContext.Configuration.Personal ||
                CurrentUser.IsVisitor() ||
                (!CurrentUser.IsAdmin() && (TariffSettings.HidePricingPage || CoreContext.Configuration.Standalone)))
            {
                DisableTariff = true;
            }

            _customNavItems = WebItemManager.Instance.GetItems(WebZoneType.CustomProductList, ItemAvailableState.Normal);

            if (DisableProductNavigation && SecurityContext.IsAuthenticated)
            {
                _productListHolder.Visible = false;
            }
            else
            {
                var productsList = WebItemManager.Instance.GetItems(WebZoneType.TopNavigationProductList, ItemAvailableState.Normal);

                DisplayModuleList = productsList.Any() && !CoreContext.Configuration.Personal;

                Modules       = new List <IWebItem>();
                CustomModules = new List <IWebItem>();

                foreach (var webItem in productsList)
                {
                    if (webItem.ID != WebItemManager.DocumentsProductID &&
                        webItem.ID != WebItemManager.ProjectsProductID &&
                        webItem.ID != WebItemManager.CRMProductID &&
                        webItem.ID != WebItemManager.PeopleProductID &&
                        webItem.ID != WebItemManager.CommunityProductID)
                    {
                        CustomModules.Add(webItem);
                    }
                }

                var currentItem = productsList.Find(r => r.ID == WebItemManager.DocumentsProductID);
                if (currentItem != null)
                {
                    Modules.Add(currentItem);
                    productsList.Remove(currentItem);
                }
                currentItem = productsList.Find(r => r.ID == WebItemManager.ProjectsProductID);
                if (currentItem != null)
                {
                    Modules.Add(currentItem);
                    productsList.Remove(currentItem);
                }
                currentItem = productsList.Find(r => r.ID == WebItemManager.CRMProductID);
                if (currentItem != null)
                {
                    Modules.Add(currentItem);
                    productsList.Remove(currentItem);
                }
                if (CurrentUser != null && !CurrentUser.IsOutsider())
                {
                    currentItem = _customNavItems.Find(r => r.ID == WebItemManager.MailProductID);
                    if (currentItem != null)
                    {
                        Modules.Add(currentItem);
                    }
                }
                currentItem = productsList.Find(r => r.ID == WebItemManager.PeopleProductID);
                if (currentItem != null)
                {
                    Modules.Add(currentItem);
                    productsList.Remove(currentItem);
                }
                currentItem = productsList.Find(r => r.ID == WebItemManager.CommunityProductID);
                if (currentItem != null)
                {
                    Modules.Add(currentItem);
                    productsList.Remove(currentItem);
                }

                var isEnabledTalk = ConfigurationManagerExtension.AppSettings["web.talk"] ?? "false";
                Addons = _customNavItems
                         .Where(item =>
                                (item.ID == WebItemManager.CalendarProductID ||
                                 (item.ID == WebItemManager.TalkProductID && isEnabledTalk == "true")))
                         .OrderBy(item => item.Context.DefaultSortOrder);

                CustomNavigationItems = CustomNavigationSettings.Load().Items.Where(x => x.ShowInMenu);
            }

            foreach (var item in _customNavItems)
            {
                var render = WebItemManager.Instance[item.ID] as IRenderCustomNavigation;
                if (render == null)
                {
                    continue;
                }

                try
                {
                    var control = render.LoadCustomNavigationControl(Page);
                    if (control != null)
                    {
                        _customNavControls.Controls.Add(control);
                    }
                }
                catch (Exception ex)
                {
                    LogManager.GetLogger("ASC.Web.Studio").Error(ex);
                }
            }

            if (!DisableTariff)
            {
                var tariff = TenantExtra.GetCurrentTariff();
                TariffDays = tariff.DueDate.Date.Subtract(DateTime.Today).Days;

                if (tariff.State == TariffState.Trial && TariffDays >= 0)
                {
                    DisplayTrialCountDays = true;
                }
            }

            Settings = CompanyWhiteLabelSettings.Instance;

            ShowAppsNavItem = SetupInfo.IsVisibleSettings("AppsNavItem");

            ShowDesktopNavItem = !CoreContext.Configuration.CustomMode;

            if (!DisableGift)
            {
                DisableGift = !SecurityContext.IsAuthenticated ||
                              CoreContext.Configuration.Personal ||
                              !TenantExtra.Opensource ||
                              string.IsNullOrEmpty(SetupInfo.ControlPanelUrl) ||
                              OpensourceGiftSettings.LoadForCurrentUser().Readed;
            }

            Startup = !CoreContext.Configuration.CustomMode && TenantExtra.Saas && TenantExtra.GetTenantQuota().Free;
        }