//****************************************************************************************************** // IUserInfo.cs - Gbtc // // Copyright © 2010, Grid Protection Alliance. All Rights Reserved. // // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See // the NOTICE file distributed with this work for additional information regarding copyright ownership. // The GPA licenses this file to you under the MIT License (MIT), the "License"; you may // not use this file except in compliance with the License. You may obtain a copy of the License at: // // http://www.opensource.org/licenses/MIT // // Unless agreed to in writing, the subject software distributed under the License is distributed on an // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the // License for the specific language governing permissions and limitations. // // Code Modification History: // ---------------------------------------------------------------------------------------------------- // 08/27/2014 - J. Ritchie Carroll // Generated original version of source code. // //****************************************************************************************************** using System; namespace GSF.Identity { /// /// Internal interface that represents common properties and methods needed by /// implemented in both Windows and Unix flavors. /// internal interface IUserInfo : IDisposable { /// /// Gets flag that determines if domain is responding to user existence. /// /// true if domain responds and user exists; otherwise false. /// /// Note that when the domain is unavailable, this function will return false. /// bool DomainRespondsForUser { get; } /// /// Gets flag that determines if user exists. /// /// true if user is found to exist; otherwise false. bool Exists { get; } /// /// Gets or sets enabled state. /// bool Enabled { get; set; } /// /// Gets the last login time of the user. /// DateTime LastLogon { get; } /// /// Gets the when the account was created. /// DateTime AccountCreationDate { get; } /// /// Gets the , in UTC, of next password change for the user. /// DateTime NextPasswordChangeDate { get; } /// /// Gets the account control information of the local user. /// int LocalUserAccountControl { get; } /// /// Gets this maximum password age for the user. /// Ticks MaximumPasswordAge { get; } /// /// Gets all the groups associated with the user - this includes local groups and Active Directory groups if applicable. /// /// /// /// Groups names are prefixed with their associated domain, computer name or BUILTIN. /// /// string[] Groups { get; } /// /// Gets the local groups the user is a member of. /// /// /// /// Groups names are prefixed with BUILTIN or computer name. /// /// string[] LocalGroups { get; } /// /// Gets the full user name for local accounts. /// string FullLocalUserName { get; } /// /// Gets flag that determines if this instance is based on a local WinNT account instead of found through LDAP. /// bool IsLocalAccount { get; } /// /// Initializes the object. /// /// true if successfully initialized; otherwise, false. bool Initialize(); /// /// Attempts to change the user's password. /// /// Old password. /// New password. void ChangePassword(string oldPassword, string newPassword); /// /// Returns the value for specified active directory property. /// /// Name of the active directory property whose value is to be retrieved. /// value for the specified active directory property. string GetUserPropertyValue(string propertyName); } }