/// <summary>
        /// Update method implmentation
        /// </summary>
        public void Load(PSHost host)
        {
            ManagementService.Initialize(host, true);
            MFAConfig    cfg  = ManagementService.Config;
            MailProvider mail = cfg.MailProvider;

            IsDirty            = cfg.IsDirty;
            Enabled            = mail.Enabled;
            EnrollWizard       = mail.EnrollWizard;
            EnrollWizardStrict = mail.EnrollWizardStrict;
            From        = mail.From;
            UserName    = mail.UserName;
            Password    = mail.Password;
            Host        = mail.Host;
            Port        = mail.Port;
            UseSSL      = mail.UseSSL;
            Company     = mail.Company;
            PinRequired = mail.PinRequired;
            Anonymous   = mail.Anonymous;
            MailOTPContent.Clear();
            foreach (SendMailFileName itm in mail.MailOTPContent)
            {
                MailOTPContent.Add((FlatConfigMailFileName)itm);
            }
            MailAdminContent.Clear();
            foreach (SendMailFileName itm in mail.MailAdminContent)
            {
                MailAdminContent.Add((FlatConfigMailFileName)itm);
            }
            MailKeyContent.Clear();
            foreach (SendMailFileName itm in mail.MailKeyContent)
            {
                MailKeyContent.Add((FlatConfigMailFileName)itm);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Update method implmentation
        /// </summary>
        public void Load(PSHost host)
        {
            ManagementService.Initialize(host, true);
            MFAConfig cfg  = ManagementService.Config;
            SendMail  mail = cfg.SendMail;

            IsDirty  = cfg.IsDirty;
            From     = mail.From;
            UserName = mail.UserName;
            Password = mail.Password;
            Host     = mail.Host;
            Port     = mail.Port;
            UseSSL   = mail.UseSSL;
            Company  = mail.Company;
            MailOTPContent.Clear();
            foreach (SendMailFileName itm in mail.MailOTPContent)
            {
                MailOTPContent.Add((FlatConfigMailFileName)itm);
            }
            MailAdminContent.Clear();
            foreach (SendMailFileName itm in mail.MailAdminContent)
            {
                MailAdminContent.Add((FlatConfigMailFileName)itm);
            }
            MailKeyContent.Clear();
            foreach (SendMailFileName itm in mail.MailKeyContent)
            {
                MailKeyContent.Add((FlatConfigMailFileName)itm);
            }
        }
        /// <summary>
        /// Update method implmentation
        /// </summary>
        public override void Load(PSHost host)
        {
            ManagementService.Initialize(host, true);
            MFAConfig    cfg  = ManagementService.Config;
            MailProvider mail = cfg.MailProvider;

            IsDirty                     = cfg.IsDirty;
            Enabled                     = mail.Enabled;
            EnrollWizard                = mail.EnrollWizard;
            ForceWizard                 = mail.ForceWizard;
            From                        = mail.From;
            UserName                    = mail.UserName;
            Password                    = mail.Password;
            Host                        = mail.Host;
            Port                        = mail.Port;
            UseSSL                      = mail.UseSSL;
            Company                     = mail.Company;
            PinRequired                 = mail.PinRequired;
            Anonymous                   = mail.Anonymous;
            DeliveryNotifications       = mail.DeliveryNotifications;
            FullQualifiedImplementation = mail.FullQualifiedImplementation;
            Parameters                  = mail.Parameters.Data;

            AllowedDomains.Clear();
            foreach (string itm in mail.AllowedDomains)
            {
                AllowedDomains.AddDomain(itm);
            }

            BlockedDomains.Clear();
            foreach (string itm in mail.BlockedDomains)
            {
                BlockedDomains.AddDomain(itm);
            }

            MailOTPContent.Clear();
            foreach (SendMailFileName itm in mail.MailOTPContent)
            {
                MailOTPContent.Add((FlatConfigMailFileName)itm);
            }
            MailAdminContent.Clear();
            foreach (SendMailFileName itm in mail.MailAdminContent)
            {
                MailAdminContent.Add((FlatConfigMailFileName)itm);
            }
            MailKeyContent.Clear();
            foreach (SendMailFileName itm in mail.MailKeyContent)
            {
                MailKeyContent.Add((FlatConfigMailFileName)itm);
            }
            MailNotifications.Clear();
            foreach (SendMailFileName itm in mail.MailNotifications)
            {
                MailNotifications.Add((FlatConfigMailFileName)itm);
            }
        }