Esempio n. 1
0
        public TenantAuditSettings SetAuditSettings(TenantAuditSettings settings)
        {
            SecurityContext.DemandPermissions(SecutiryConstants.EditPortalSettings);

            if (settings.LoginHistoryLifeTime <= 0 || settings.LoginHistoryLifeTime > TenantAuditSettings.MaxLifeTime)
            {
                throw new ArgumentException("LoginHistoryLifeTime");
            }

            if (settings.AuditTrailLifeTime <= 0 || settings.AuditTrailLifeTime > TenantAuditSettings.MaxLifeTime)
            {
                throw new ArgumentException("AuditTrailLifeTime");
            }

            settings.SaveForTenant(TenantProvider.CurrentTenantID);

            MessageService.Send(Request, MessageAction.AuditSettingsUpdated);

            return(settings);
        }
Esempio n. 2
0
        public TenantAuditSettings SetAuditSettings(TenantAuditSettings settings)
        {
            if (!TenantExtra.GetTenantQuota().Audit || !SetupInfo.IsVisibleSettings(ManagementType.LoginHistory.ToString()))
            {
                throw new BillingException(Resource.ErrorNotAllowedOption, "Audit");
            }
            SecurityContext.DemandPermissions(SecutiryConstants.EditPortalSettings);

            if (settings.LoginHistoryLifeTime <= 0 || settings.LoginHistoryLifeTime > TenantAuditSettings.MaxLifeTime)
            {
                throw new ArgumentException("LoginHistoryLifeTime");
            }

            if (settings.AuditTrailLifeTime <= 0 || settings.AuditTrailLifeTime > TenantAuditSettings.MaxLifeTime)
            {
                throw new ArgumentException("AuditTrailLifeTime");
            }

            settings.SaveForTenant(TenantProvider.CurrentTenantID);

            MessageService.Send(Request, MessageAction.AuditSettingsUpdated);

            return(settings);
        }