Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Security / ADMembershipUser.cs / 1305376 / ADMembershipUser.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Security { using System.Web; using System.Web.Configuration; using System.Security.Principal; using System.Security.Permissions; using System.Globalization; using System.Runtime.Serialization; using System.Diagnostics; [Serializable] public class ActiveDirectoryMembershipUser : MembershipUser { internal bool emailModified = true; internal bool commentModified = true; internal bool isApprovedModified = true; // // private variables needed for the providerUserKey // (We need to store the provider user key here rather than the base class // to be able to do custom serialization) // private byte[] sidBinaryForm = null; [NonSerialized] private SecurityIdentifier sid = null; public override DateTime LastLoginDate { get { throw new NotSupportedException(SR.GetString(SR.ADMembership_UserProperty_not_supported, "LastLoginDate")); } set { throw new NotSupportedException(SR.GetString(SR.ADMembership_UserProperty_not_supported, "LastLoginDate")); } } public override DateTime LastActivityDate { get { throw new NotSupportedException(SR.GetString(SR.ADMembership_UserProperty_not_supported, "LastActivityDate")); } set { throw new NotSupportedException(SR.GetString(SR.ADMembership_UserProperty_not_supported, "LastActivityDate")); } } public override string Email { get { return base.Email; } set { base.Email = value; emailModified = true; } } public override string Comment { get { return base.Comment; } set { base.Comment = value; commentModified = true; } } public override bool IsApproved { get { return base.IsApproved; } set { base.IsApproved = value; isApprovedModified = true; } } public override object ProviderUserKey { get { if (sid == null && sidBinaryForm != null) sid = new SecurityIdentifier(sidBinaryForm, 0); return sid; } } public ActiveDirectoryMembershipUser(string providerName, string name, object providerUserKey, string email, string passwordQuestion, string comment, bool isApproved, bool isLockedOut, DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate, DateTime lastPasswordChangedDate, DateTime lastLockoutDate) :base(providerName, name, null, email, passwordQuestion, comment, isApproved, isLockedOut, creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockoutDate) { if ((providerUserKey != null) && !(providerUserKey is SecurityIdentifier)) throw new ArgumentException( SR.GetString( SR.ADMembership_InvalidProviderUserKey ), "providerUserKey" ); sid = (SecurityIdentifier) providerUserKey; if (sid != null) { // // store the sid in binary form for serialization // sidBinaryForm = new byte[sid.BinaryLength]; sid.GetBinaryForm(sidBinaryForm, 0); } } internal ActiveDirectoryMembershipUser(string providerName, string name, byte[] sidBinaryForm, object providerUserKey, string email, string passwordQuestion, string comment, bool isApproved, bool isLockedOut, DateTime creationDate, DateTime lastLoginDate, DateTime lastActivityDate, DateTime lastPasswordChangedDate, DateTime lastLockoutDate, bool valuesAreUpdated) :base(providerName, name, null, email, passwordQuestion, comment, isApproved, isLockedOut, creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockoutDate) { if (valuesAreUpdated) { emailModified = false; commentModified = false; isApprovedModified = false; } Debug.Assert(sidBinaryForm != null); this.sidBinaryForm = sidBinaryForm; Debug.Assert((providerUserKey != null) && (providerUserKey is SecurityIdentifier)); sid = (SecurityIdentifier) providerUserKey; } protected ActiveDirectoryMembershipUser() { } // Default CTor: Callable by derived class only. } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- _AutoWebProxyScriptHelper.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- CallbackHandler.cs
- wgx_exports.cs
- SynchronizedInputHelper.cs
- GetTokenRequest.cs
- MachineKeySection.cs
- MeshGeometry3D.cs
- Collection.cs
- SiteMapNode.cs
- SignedXmlDebugLog.cs
- TreeViewCancelEvent.cs
- NativeMethods.cs
- LeaseManager.cs
- ProfileSettings.cs
- DataSourceCacheDurationConverter.cs
- WebConfigManager.cs
- PersistNameAttribute.cs
- JournalEntryStack.cs
- JavaScriptObjectDeserializer.cs
- WindowVisualStateTracker.cs
- ResourceType.cs
- Ref.cs
- HtmlFormWrapper.cs
- IDataContractSurrogate.cs
- ParentQuery.cs
- SqlRemoveConstantOrderBy.cs
- GeometryDrawing.cs
- TextFormatterHost.cs
- DefaultIfEmptyQueryOperator.cs
- X509Certificate2Collection.cs
- OperationInfo.cs
- HttpWebRequestElement.cs
- ConnectorEditor.cs
- MdiWindowListItemConverter.cs
- X509SecurityTokenParameters.cs
- SpellerHighlightLayer.cs
- LiteralControl.cs
- DecimalStorage.cs
- LogicalExpressionTypeConverter.cs
- ReleaseInstanceMode.cs
- DataContract.cs
- MultipleViewPattern.cs
- InteropDesigner.xaml.cs
- PipeStream.cs
- TabControlCancelEvent.cs
- DesignerCategoryAttribute.cs
- ProfileEventArgs.cs
- StyleBamlTreeBuilder.cs
- MimeTypeAttribute.cs
- webeventbuffer.cs
- AccessibleObject.cs
- ColorContextHelper.cs
- xdrvalidator.cs
- ConditionalAttribute.cs
- BitmapEffectGroup.cs
- CombinedGeometry.cs
- LinqDataSourceSelectEventArgs.cs
- ItemContainerGenerator.cs
- GeometryModel3D.cs
- HandlerBase.cs
- TimeSpanValidator.cs
- CloudCollection.cs
- FileDialog_Vista.cs
- EntityParameterCollection.cs
- WebConfigurationManager.cs
- RangeValuePattern.cs
- ProfileParameter.cs
- ConfigXmlText.cs
- FileDialogCustomPlace.cs
- CommentEmitter.cs
- ViewCellRelation.cs
- LookupNode.cs
- Int64Converter.cs
- ServiceNameElement.cs
- DescendentsWalker.cs
- OdbcConnectionHandle.cs
- Rules.cs
- ClientConfigurationHost.cs
- DataServiceBehavior.cs
- Fx.cs
- TreeNodeBindingCollection.cs
- ControlDesigner.cs
- XPathScanner.cs
- PropertyValueUIItem.cs
- MSG.cs
- ItemsControl.cs
- ParseChildrenAsPropertiesAttribute.cs
- InputBindingCollection.cs
- Size.cs
- DataGridCellsPresenter.cs
- EndpointConfigContainer.cs
- Rect.cs
- SerializationTrace.cs
- RelationshipManager.cs
- DateTimeOffsetConverter.cs
- SystemNetHelpers.cs
- WebPart.cs
- UTF8Encoding.cs
- ScriptBehaviorDescriptor.cs