Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / Security / ADMembershipUser.cs / 1 / 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; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [Serializable] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 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. //------------------------------------------------------------------------------ //// 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; [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [Serializable] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 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
- OutputCacheSettingsSection.cs
- CroppedBitmap.cs
- ObservableCollection.cs
- SessionStateSection.cs
- BuilderPropertyEntry.cs
- ToolStripComboBox.cs
- SynchronizationLockException.cs
- StreamWithDictionary.cs
- ToolStripRenderer.cs
- XsltCompileContext.cs
- EntityCommandDefinition.cs
- NamespaceQuery.cs
- SQLGuidStorage.cs
- NameValuePermission.cs
- SqlCrossApplyToCrossJoin.cs
- ValueQuery.cs
- SqlDataSource.cs
- CompModSwitches.cs
- OptimalBreakSession.cs
- VirtualDirectoryMapping.cs
- SortDescriptionCollection.cs
- RedirectionProxy.cs
- ZipIOBlockManager.cs
- HtmlForm.cs
- ProjectionAnalyzer.cs
- DataTableMapping.cs
- OdbcCommandBuilder.cs
- OdbcHandle.cs
- FlowPosition.cs
- DependentList.cs
- UnconditionalPolicy.cs
- CheckPair.cs
- CalendarDataBindingHandler.cs
- SynchronizationContext.cs
- DefaultWorkflowSchedulerService.cs
- AuthenticationManager.cs
- WindowsFormsHost.cs
- SBCSCodePageEncoding.cs
- ProjectionPlan.cs
- DrawingBrush.cs
- WorkBatch.cs
- IndexedString.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- Pen.cs
- XmlNodeChangedEventManager.cs
- ListViewDesigner.cs
- SymLanguageType.cs
- RecipientInfo.cs
- ConfigXmlAttribute.cs
- IgnoreDeviceFilterElementCollection.cs
- DrawingCollection.cs
- GlobalizationSection.cs
- Track.cs
- InfoCardArgumentException.cs
- DeflateStreamAsyncResult.cs
- TempEnvironment.cs
- SvcMapFileSerializer.cs
- DeploymentSection.cs
- RuleConditionDialog.Designer.cs
- XamlInt32CollectionSerializer.cs
- CryptoStream.cs
- MULTI_QI.cs
- DataGridViewToolTip.cs
- ArglessEventHandlerProxy.cs
- ListBoxItemWrapperAutomationPeer.cs
- IISMapPath.cs
- ClientBuildManagerCallback.cs
- RemoveStoryboard.cs
- AncestorChangedEventArgs.cs
- SqlReferenceCollection.cs
- DependencyPropertyHelper.cs
- Propagator.cs
- InputLanguageCollection.cs
- ToolBarButton.cs
- SendParametersContent.cs
- TextServicesCompartmentEventSink.cs
- processwaithandle.cs
- ExpressionBuilder.cs
- SiteMapNode.cs
- SkipStoryboardToFill.cs
- MemberHolder.cs
- FontUnitConverter.cs
- DateTimePickerDesigner.cs
- X509RawDataKeyIdentifierClause.cs
- BulletChrome.cs
- SeverityFilter.cs
- PluralizationServiceUtil.cs
- DesignerActionService.cs
- XamlToRtfParser.cs
- UpdateManifestForBrowserApplication.cs
- DataGridState.cs
- CodeAttributeDeclaration.cs
- WasHostedComPlusFactory.cs
- EditorServiceContext.cs
- QilTernary.cs
- CoreChannel.cs
- MustUnderstandBehavior.cs
- FieldAccessException.cs
- FormsIdentity.cs
- CompilationSection.cs