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(); } UMMailbox ummailbox = UMMailbox.FromDataObject(aduser); if (ummailbox.UMDialPlan != null) { UMDialPlan dialPlan = ummailbox.GetDialPlan(); if (dialPlan != null && (dialPlan.URIType == UMUriType.E164 || dialPlan.URIType == UMUriType.SipName)) { ummailbox.SIPResourceIdentifier = UMMailbox.GetPrimaryExtension(ummailbox.EmailAddresses, ProxyAddressPrefix.UM); } if (dialPlan != null) { ummailbox.PhoneNumber = ummailbox.GetEUMPhoneNumber(dialPlan); } ummailbox.AccessTelephoneNumbers = dialPlan.AccessTelephoneNumbers; ummailbox.CallAnsweringRulesExtensions = new MultiValuedProperty <string>(Utils.GetExtensionsInDialPlanValidForPAA(dialPlan, aduser)); } return(ummailbox); }
protected void SubmitResetPINMessage(string notifyEmail) { ADUser dataObject = this.DataObject; if (string.IsNullOrEmpty(notifyEmail)) { notifyEmail = dataObject.PrimarySmtpAddress.ToString(); } UMMailbox ummailbox = new UMMailbox(dataObject); UMDialPlan dialPlan = ummailbox.GetDialPlan(); string[] accessNumbers = null; if (dialPlan.AccessTelephoneNumbers != null && dialPlan.AccessTelephoneNumbers.Count > 0) { accessNumbers = dialPlan.AccessTelephoneNumbers.ToArray(); } string extension = null; if (!Utils.TryGetNumericExtension(dialPlan, dataObject, out extension)) { extension = null; } try { Utils.SendPasswordResetMail(dataObject, accessNumbers, extension, this.PinInfo.PIN, notifyEmail); } catch (LocalizedException ex) { base.WriteError(new RecipientTaskException(Strings.SendPINResetMailError(dataObject.PrimarySmtpAddress.ToString(), ex.LocalizedString), ex), ErrorCategory.NotSpecified, null); } }
public GetVoiceMailBase(UMMailbox mailbox) : base(mailbox) { this.UMMailbox = mailbox; this.UMDialPlan = mailbox.GetDialPlan(); }