Example #1
0
 private void PopulateProtocolSettings(CASMailbox mailbox)
 {
     this.AddConnectionSettingDetails(mailbox, ServiceType.Pop3, true, FrontEndLocator.GetFrontEndPop3SettingsForLocalServer());
     this.AddConnectionSettingDetails(mailbox, ServiceType.Imap4, true, FrontEndLocator.GetFrontEndImap4SettingsForLocalServer());
     this.AddConnectionSettingDetails(mailbox, ServiceType.Smtp, true, FrontEndLocator.GetFrontEndSmtpSettingsForLocalServer());
     this.AddConnectionSettingDetails(mailbox, ServiceType.Pop3, false, FrontEndLocator.GetInternalPop3SettingsForLocalServer());
     this.AddConnectionSettingDetails(mailbox, ServiceType.Imap4, false, FrontEndLocator.GetInternalImap4SettingsForLocalServer());
     this.AddConnectionSettingDetails(mailbox, ServiceType.Smtp, false, FrontEndLocator.GetInternalSmtpSettingsForLocalServer());
 }
Example #2
0
        protected override void PrepareRecipientObject(ADUser user)
        {
            TaskLogger.LogEnter();
            ADUser aduser = this.mailboxPlanObject;

            if (aduser != null)
            {
                user.MailboxPlan = aduser.Id;
            }
            else if (user.MailboxPlan != null)
            {
                if (user.MailboxPlanObject != null)
                {
                    aduser = user.MailboxPlanObject;
                }
                else
                {
                    MailboxPlanIdParameter mailboxPlanIdParameter = new MailboxPlanIdParameter(user.MailboxPlan);
                    aduser = (ADUser)base.GetDataObject <ADUser>(mailboxPlanIdParameter, base.TenantGlobalCatalogSession, null, new LocalizedString?(Strings.ErrorMailboxPlanNotFound(mailboxPlanIdParameter.ToString())), new LocalizedString?(Strings.ErrorMailboxPlanNotUnique(mailboxPlanIdParameter.ToString())), ExchangeErrorCategory.Client);
                }
                this.mailboxPlanObject = aduser;
            }
            user.MailboxPlanObject = null;
            user.propertyBag.ResetChangeTracking(ADRecipientSchema.MailboxPlanObject);
            if (aduser != null)
            {
                using (new CmdletMonitoredScope(base.CurrentTaskContext.UniqueId, "BizLogic", "NewMailboxOrSyncMailbox.PrepareRecipientObject", LoggerHelper.CmdletPerfMonitors))
                {
                    ADUser aduser2 = new ADUser();
                    aduser2.StampPersistableDefaultValues();
                    aduser2.StampDefaultValues(RecipientType.UserMailbox);
                    aduser2.ResetChangeTracking();
                    User.FromDataObject(aduser2).ApplyCloneableProperties(User.FromDataObject(aduser));
                    Mailbox.FromDataObject(aduser2).ApplyCloneableProperties(Mailbox.FromDataObject(aduser));
                    CASMailbox.FromDataObject(aduser2).ApplyCloneableProperties(CASMailbox.FromDataObject(aduser));
                    UMMailbox.FromDataObject(aduser2).ApplyCloneableProperties(UMMailbox.FromDataObject(aduser));
                    bool            litigationHoldEnabled = user.LitigationHoldEnabled;
                    ElcMailboxFlags elcMailboxFlags       = user.ElcMailboxFlags;
                    user.CopyChangesFrom(aduser2);
                    if (base.SoftDeletedObject != null)
                    {
                        if (litigationHoldEnabled != user.LitigationHoldEnabled)
                        {
                            user.LitigationHoldEnabled = litigationHoldEnabled;
                        }
                        if (elcMailboxFlags != user.ElcMailboxFlags)
                        {
                            user.ElcMailboxFlags = elcMailboxFlags;
                        }
                    }
                }
            }
            base.PrepareRecipientObject(user);
            MailboxTaskHelper.WriteWarningWhenMailboxIsUnlicensed(user, new Task.TaskWarningLoggingDelegate(this.WriteWarning));
            TaskLogger.LogExit();
        }
Example #3
0
        private void AddConnectionSettingDetails(CASMailbox mailbox, ServiceType settingType, bool isExternal, ProtocolConnectionSettings settings)
        {
            if (settings == null)
            {
                return;
            }
            string text;

            if (settings.EncryptionType != null)
            {
                text = Strings.ProtocolSettingsFullDetails(settings.Hostname.ToString(), settings.Port.ToString(), settings.EncryptionType.ToString());
            }
            else
            {
                text = Strings.ProtocolSettingsDetails(settings.Hostname.ToString(), settings.Port.ToString());
            }
            switch (settingType)
            {
            case ServiceType.Pop3:
                if (isExternal)
                {
                    mailbox.ExternalPopSettings = text;
                    return;
                }
                mailbox.InternalPopSettings = text;
                return;

            case ServiceType.Imap4:
                if (isExternal)
                {
                    mailbox.ExternalImapSettings = text;
                    return;
                }
                mailbox.InternalImapSettings = text;
                return;

            case ServiceType.Smtp:
                if (isExternal)
                {
                    mailbox.ExternalSmtpSettings = text;
                    return;
                }
                mailbox.InternalSmtpSettings = text;
                return;

            default:
                throw new InvalidOperationException("Invalid settingType: " + settingType);
            }
        }
Example #4
0
 public EASMailboxFeatureInfo(CASMailbox mailbox) : base(mailbox)
 {
     base.UseModalDialogForEdit = false;
     base.Name = Strings.EASMailboxFeatureName;
     base.PropertiesDialogHeight = new int?(460);
     base.PropertiesDialogWidth  = new int?(700);
     if (mailbox != null && mailbox.ActiveSyncEnabled)
     {
         this.Status = ClientStrings.EnabledDisplayText;
     }
     else
     {
         this.Status = ClientStrings.DisabledDisplayText;
     }
     base.EnableCommandUrl = null;
     base.EditCommandUrl   = "/ecp/UsersGroups/EditMobileMailbox.aspx?id=" + HttpUtility.UrlEncode(base.Identity.RawIdentity) + "&DataTransferMode=Isolation";
     this.CanChangeStatus  = RbacPrincipal.Current.IsInRole("Set-CasMailbox?Identity&ActiveSyncEnabled@W:Organization");
 }
Example #5
0
        protected override IConfigurable ConvertDataObjectToPresentationObject(IConfigurable dataObject)
        {
            if (dataObject == null)
            {
                return(null);
            }
            ADUser aduser = (ADUser)dataObject;

            if (null != aduser.MasterAccountSid)
            {
                aduser.LinkedMasterAccount = SecurityPrincipalIdParameter.GetFriendlyUserName(aduser.MasterAccountSid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose));
                aduser.ResetChangeTracking();
            }
            CASMailbox casmailbox = CASMailbox.FromDataObject(aduser);

            if ((this.GetPopProtocolLog || this.GetImapProtocolLog || this.ActiveSyncDebugLogging) && CmdletProxy.TryToProxyOutputObject(casmailbox, base.CurrentTaskContext, aduser, this.Identity == null, this.ConfirmationMessage, CmdletProxy.AppendIdentityToProxyCmdlet(aduser)))
            {
                return(casmailbox);
            }
            if (casmailbox.ActiveSyncMailboxPolicy == null && !casmailbox.ExchangeVersion.IsOlderThan(CASMailboxSchema.ActiveSyncMailboxPolicy.VersionAdded))
            {
                ADObjectId defaultPolicyId = base.GetDefaultPolicyId(aduser);
                if (defaultPolicyId != null)
                {
                    casmailbox.SetActiveSyncMailboxPolicyLocally(defaultPolicyId);
                    casmailbox.ActiveSyncMailboxPolicyIsDefaulted = true;
                }
            }
            if (this.GetPopProtocolLog || this.GetImapProtocolLog)
            {
                this.GetProtocolLogs(aduser);
            }
            if (this.ProtocolSettings)
            {
                this.PopulateProtocolSettings(casmailbox);
            }
            if (this.ActiveSyncDebugLogging)
            {
                casmailbox.ActiveSyncDebugLogging = this.GetActiveSyncLoggingEnabled(aduser);
            }
            return(casmailbox);
        }
Example #6
0
 public static Identity ToIdentity(this CASMailbox entry)
 {
     return(entry.Id.ToIdentity(entry.DisplayName));
 }
 public ProtocolSettingsData(CASMailbox casMailbox) : base(casMailbox.ToIdentity(), casMailbox)
 {
     this.casMailbox = casMailbox;
 }