Exemplo n.º 1
0
        public void Add(ApprovedDomain domain)
        {
            var domains = this.Get();
            domains.Add(domain);

            this.Save(domains);
        }
Exemplo n.º 2
0
        public void Add(ApprovedDomain domain)
        {
            var domains = this.Get();

            domains.Add(domain);

            this.Save(domains);
        }
Exemplo n.º 3
0
        public void Add(ApprovedDomain domain)
        {
            var  domains = this.Get();
            bool found   = domains.Any(x => x.DomainName.ToUpperInvariant().Equals(domain.DomainName.ToUpperInvariant()));

            if (!found)
            {
                domains.Add(domain);
                this.Save(domains);
            }
        }
Exemplo n.º 4
0
        public static void Setup(ApprovedDomain domain)
        {
            var factory = new StdSchedulerFactory();
            var scheduler = factory.GetScheduler();
            scheduler.Start();

            var job = JobBuilder.Create<InstallJob>().WithIdentity(domain.DomainName, "install").Build();
            var trigger = TriggerBuilder.Create().WithIdentity(domain.DomainName, "install-trigger").StartAt(DateTimeOffset.UtcNow.AddSeconds(5)).Build();

            scheduler.ScheduleJob(job, trigger);
        }
Exemplo n.º 5
0
        public void Add(ApprovedDomain domain)
        {
            var domains = this.Get();
            bool found = domains.Any(x => x.DomainName.ToUpperInvariant().Equals(domain.DomainName.ToUpperInvariant()));

            if (!found)
            {
                domains.Add(domain);
                this.Save(domains);
            }
        }
Exemplo n.º 6
0
        public string GetBackupDirectory(ApprovedDomain domain, string tenant)
        {
            if (domain.BackupDirectoryIsFixedPath &&
                !string.IsNullOrWhiteSpace(domain.BackupDirectory))
            {
                return domain.BackupDirectory;
            }

            if (!string.IsNullOrWhiteSpace(domain.BackupDirectory))
            {
                return HostingEnvironment.MapPath(domain.BackupDirectory);
            }

            string path = $"/Backups/{tenant}/backup";
            return HostingEnvironment.MapPath(path);
        }
Exemplo n.º 7
0
 public void Add(ApprovedDomain domain)
 {
     this.Domains.Add(domain);
 }
Exemplo n.º 8
0
 public static async Task AddAsync(ApprovedDomain tenant)
 {
     string database = TenantConvention.GetDbNameByConvention(tenant.DomainName);
     var sql = new Sql("INSERT INTO account.installed_domains(domain_name, admin_email) SELECT @0, @1;", tenant.DomainName, tenant.AdminEmail);
     await Factory.NonQueryAsync(database, sql).ConfigureAwait(false);
 }