protected override IConfigurable ConvertDataObjectToPresentationObject(IConfigurable dataObject) { PINInfo pininfo = null; ADUser aduser = dataObject as ADUser; this.userObject = aduser; if (UMSubscriber.IsValidSubscriber(aduser)) { this.matchFound = true; try { using (IUMUserMailboxStorage umuserMailboxAccessor = InterServerMailboxAccessor.GetUMUserMailboxAccessor(aduser, false)) { pininfo = umuserMailboxAccessor.GetUMPin(); } goto IL_84; } catch (LocalizedException ex) { throw new InvalidOperationForGetUMMailboxPinException(Strings.GetPINInfoError(aduser.PrimarySmtpAddress.ToString(), ex.LocalizedString), ex); } goto IL_64; IL_84: return(new UMMailboxPin(aduser, pininfo.PinExpired, pininfo.LockedOut, pininfo.FirstTimeUser, base.NeedSuppressingPiiData)); } IL_64: throw new InvalidOperationForGetUMMailboxPinException(Strings.InvalidUMUserName(aduser.PrimarySmtpAddress.ToString())); }
protected PINInfo ValidateOrGeneratePIN(string pin, Guid umUserMailboxPolicyGuid) { ADUser dataObject = this.DataObject; PINInfo pininfo = null; try { using (IUMUserMailboxStorage umuserMailboxAccessor = InterServerMailboxAccessor.GetUMUserMailboxAccessor(dataObject, false)) { pininfo = umuserMailboxAccessor.ValidateUMPin(pin, umUserMailboxPolicyGuid); } } catch (LocalizedException ex) { base.WriteError(new RecipientTaskException(Strings.ValidateGeneratePINError(dataObject.PrimarySmtpAddress.ToString(), ex.LocalizedString), ex), ErrorCategory.NotSpecified, null); } if (!pininfo.IsValid) { if (string.IsNullOrEmpty(pin)) { base.WriteError(new DefaultPinGenerationException(), ErrorCategory.NotSpecified, null); } else { base.WriteError(this.CreateWeakPinException(dataObject), ErrorCategory.InvalidArgument, null); } } return(pininfo); }
protected void ResetUMMailbox(bool keepProperties) { ADUser dataObject = this.DataObject; try { using (IUMUserMailboxStorage umuserMailboxAccessor = InterServerMailboxAccessor.GetUMUserMailboxAccessor(dataObject, false)) { umuserMailboxAccessor.ResetUMMailbox(keepProperties); } } catch (LocalizedException ex) { base.WriteError(new RecipientTaskException(Strings.ResetUMMailboxError(dataObject.PrimarySmtpAddress.ToString(), ex.LocalizedString), ex), ErrorCategory.NotSpecified, null); } }
protected void SavePIN(Guid umUserMailboxPolicyGuid) { ADUser dataObject = this.DataObject; try { using (IUMUserMailboxStorage umuserMailboxAccessor = InterServerMailboxAccessor.GetUMUserMailboxAccessor(dataObject, false)) { umuserMailboxAccessor.SaveUMPin(this.PinInfo, umUserMailboxPolicyGuid); } } catch (LocalizedException ex) { base.WriteError(new RecipientTaskException(Strings.SavePINError(dataObject.PrimarySmtpAddress.ToString(), ex.LocalizedString), ex), ErrorCategory.NotSpecified, null); } }