Пример #1
0
        public ISettings GetDefault()
        {
            var settings = new WebItemSettings();

            WebItemManager.Instance.GetItemsAll().ForEach(w =>
            {
                var opt = new WebItemOption()
                {
                    ItemID    = w.ID,
                    SortOrder = WebItemManager.GetSortOrder(w),
                    Disabled  = false,
                };
                settings.SettingsCollection.Add(opt);
            });
            return(settings);
        }
 public NotifyServiceLauncher(
     IOptions <NotifyServiceCfg> notifyServiceCfg,
     NotifySender notifySender,
     NotifyService notifyService,
     NotifyCleaner notifyCleaner,
     WebItemManager webItemManager,
     IServiceProvider serviceProvider,
     IOptionsMonitor <ILog> options)
 {
     NotifyServiceCfg = notifyServiceCfg.Value;
     NotifyService    = notifyService;
     NotifySender     = notifySender;
     NotifyCleaner    = notifyCleaner;
     WebItemManager   = webItemManager;
     ServiceProvider  = serviceProvider;
     Log = options.Get("ASC.Notify");
 }
Пример #3
0
        public QuotaWrapper(
            Tenant tenant,
            CoreBaseSettings coreBaseSettings,
            CoreConfiguration configuration,
            TenantExtra tenantExtra,
            TenantStatisticsProvider tenantStatisticsProvider,
            AuthContext authContext,
            SettingsManager settingsManager,
            WebItemManager webItemManager,
            Constants constants)
        {
            TenantExtra = tenantExtra;
            TenantStatisticsProvider = tenantStatisticsProvider;
            WebItemManager           = webItemManager;
            var quota     = TenantExtra.GetTenantQuota();
            var quotaRows = TenantStatisticsProvider.GetQuotaRows(tenant.TenantId).ToList();

            StorageSize   = (ulong)Math.Max(0, quota.MaxTotalSize);
            UsedSize      = (ulong)Math.Max(0, quotaRows.Sum(r => r.Counter));
            MaxUsersCount = quota.ActiveUsers;
            UsersCount    = coreBaseSettings.Personal ? 1 : TenantStatisticsProvider.GetUsersCount();
            MaxVisitors   = coreBaseSettings.Standalone ? -1 : constants.CoefficientOfVisitors * quota.ActiveUsers;
            VisitorsCount = coreBaseSettings.Personal ? 0 : TenantStatisticsProvider.GetVisitorsCount();

            StorageUsage = quotaRows
                           .Select(x => new QuotaUsage {
                Path = x.Path.TrimStart('/').TrimEnd('/'), Size = x.Counter,
            })
                           .ToList();

            if (coreBaseSettings.Personal && SetupInfo.IsVisibleSettings("PersonalMaxSpace"))
            {
                UserStorageSize = configuration.PersonalMaxSpace(settingsManager);

                var webItem = WebItemManager[WebItemManager.DocumentsProductID];
                if (webItem.Context.SpaceUsageStatManager is IUserSpaceUsage spaceUsageManager)
                {
                    UserUsedSize = spaceUsageManager.GetUserSpaceUsage(authContext.CurrentAccount.ID);
                }
            }

            MaxFileSize = Math.Min(AvailableSize, (ulong)quota.MaxFileSize);
        }
Пример #4
0
 public StudioNotifyService(
     UserManager userManager,
     StudioNotifyHelper studioNotifyHelper,
     StudioNotifyServiceHelper studioNotifyServiceHelper,
     TenantExtra tenantExtra,
     AuthManager authentication,
     AuthContext authContext,
     IConfiguration configuration,
     TenantManager tenantManager,
     CoreBaseSettings coreBaseSettings,
     CommonLinkUtility commonLinkUtility,
     SetupInfo setupInfo,
     IServiceProvider serviceProvider,
     DisplayUserSettingsHelper displayUserSettingsHelper,
     SettingsManager settingsManager,
     WebItemSecurity webItemSecurity,
     WebItemManager webItemManager,
     IOptionsMonitor <ILog> option)
 {
     Log                       = option.Get("ASC.Notify");
     client                    = studioNotifyServiceHelper;
     TenantExtra               = tenantExtra;
     Authentication            = authentication;
     AuthContext               = authContext;
     Configuration             = configuration;
     TenantManager             = tenantManager;
     CoreBaseSettings          = coreBaseSettings;
     CommonLinkUtility         = commonLinkUtility;
     SetupInfo                 = setupInfo;
     ServiceProvider           = serviceProvider;
     DisplayUserSettingsHelper = displayUserSettingsHelper;
     SettingsManager           = settingsManager;
     WebItemSecurity           = webItemSecurity;
     WebItemManager            = webItemManager;
     UserManager               = userManager;
     StudioNotifyHelper        = studioNotifyHelper;
 }
Пример #5
0
 public GlobalFolder(
     CoreBaseSettings coreBaseSettings,
     WebItemManager webItemManager,
     WebItemSecurity webItemSecurity,
     AuthContext authContext,
     TenantManager tenantManager,
     UserManager userManager,
     SettingsManager settingsManager,
     GlobalStore globalStore,
     IOptionsMonitor <ILog> options,
     IServiceProvider serviceProvider
     )
 {
     CoreBaseSettings = coreBaseSettings;
     WebItemManager   = webItemManager;
     WebItemSecurity  = webItemSecurity;
     AuthContext      = authContext;
     TenantManager    = tenantManager;
     UserManager      = userManager;
     SettingsManager  = settingsManager;
     GlobalStore      = globalStore;
     ServiceProvider  = serviceProvider;
     Logger           = options.Get("ASC.Files");
 }
Пример #6
0
 public ServiceLauncher(WebItemManager webItemManager, StudioNotifyServiceSender studioNotifyServiceSender, IServiceProvider serviceProvider)
 {
     WebItemManager            = webItemManager;
     StudioNotifyServiceSender = studioNotifyServiceSender;
     ServiceProvider           = serviceProvider;
 }
Пример #7
0
 public WebImageSupplier(WebItemManager webItemManager, WebPath webPath, IHttpContextAccessor httpContextAccessor, IConfiguration configuration)
     : this(webItemManager, webPath, configuration)
 {
     HttpContextAccessor = httpContextAccessor;
 }
Пример #8
0
 public WebImageSupplier(WebItemManager webItemManager, WebPath webPath, IConfiguration configuration)
 {
     WebItemManager = webItemManager;
     WebPath        = webPath;
     FolderName     = configuration["web:images"];
 }