C# Класс ScrewTurn.Wiki.Plugins.ActiveDirectory.ActiveDirectoryProvider

Implements a Users Storage Provider for Active Directory.
Наследование: IUsersStorageProviderV30
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
BuildOctetString string
CreatePrimaryGroupSID void
GeneratePassword string
InitConfig void
LogEntry void
ParseConfig Config

Открытые методы

Метод Описание
AddUser ( string username, string displayName, string password, string email, bool active, System.DateTime dateTime ) : UserInfo

Adds a new User.

AddUserGroup ( string name, string description ) : UserGroup

Adds a new user group.

GetUser ( string username ) : UserInfo

Gets the user info object for the currently logged in user.

GetUserByEmail ( string email ) : UserInfo

Gets a user account. Not Implemented - Passed Directly to the IUsersStorageProviderV30

GetUserGroups ( ) : UserGroup[]

Gets all the user groups.

GetUsers ( ) : UserInfo[]

Gets the complete list of Users.

GetUsersWithData ( string key ) : string>.IDictionary

Gets all the users that have the specified element in their data. Not Implemented - Passed Directly to the IUsersStorageProviderV30

Init ( IHostV30 host, string config ) : void

Initializes the Storage Provider.

ModifyUser ( UserInfo user, string newDisplayName, string newPassword, string newEmail, bool newActive ) : UserInfo

Modifies a User.

ModifyUserGroup ( UserGroup group, string description ) : UserGroup

Modifies a user group.

NotifyCookieLogin ( UserInfo user ) : void

Notifies the provider that a user has logged in through the authentication cookie. Not Implemented - Passed Directly to the IUsersStorageProviderV30

NotifyLogout ( UserInfo user ) : void

Notifies the provider that a user has logged out. Not Implemented - Passed Directly to the IUsersStorageProviderV30

RemoveUser ( UserInfo user ) : bool

Removes a User.

RemoveUserGroup ( UserGroup group ) : bool

Removes a user group.

RetrieveAllUserData ( UserInfo user ) : string>.IDictionary

Retrieves all the user data elements for a user. Not Implemented - Passed Directly to the IUsersStorageProviderV30

RetrieveUserData ( UserInfo user, string key ) : string

Gets a user data element, if any. Not Implemented - Passed Directly to the IUsersStorageProviderV30

SetUserMembership ( UserInfo user, string groups ) : UserInfo

Sets the group memberships of a user account.

Shutdown ( ) : void

Method invoked on shutdown. Ignored

This method might not be invoked in some cases.

StoreUserData ( UserInfo user, string key, string value ) : bool

Stores a user data element, overwriting the previous one if present. Not Implemented - Passed Directly to the IUsersStorageProviderV30

TestAccount ( UserInfo user, string password ) : bool

Tests a Password for a User account.

TryAutoLogin ( HttpContext context ) : UserInfo

Tries to login a user directly through the provider using the current HttpContext and without username/password.

TryManualLogin ( string username, string password ) : UserInfo

Tries to login a user directly through the provider.

Приватные методы

Метод Описание
BuildOctetString ( byte bytes ) : string

Builds the octet string. http://dunnry.com/blog/DeterminingYourPrimaryGroupInActiveDirectoryUsingNET.aspx

CreatePrimaryGroupSID ( byte userSid, int primaryGroupID ) : void

Creates the primary group SID. http://dunnry.com/blog/DeterminingYourPrimaryGroupInActiveDirectoryUsingNET.aspx

GeneratePassword ( ) : string

Generate a random password of garbage since a non-zero length password is required

InitConfig ( string config ) : void

Configures the plugin based on the configuration settings.

LogEntry ( LogEntryType entryType, string message ) : void

Logs a message from this plugin.

ParseConfig ( string config ) : Config

Parses the plugin configuration string.

Описание методов

AddUser() публичный Метод

Adds a new User.
If , or are null. If , or are empty.
public AddUser ( string username, string displayName, string password, string email, bool active, System.DateTime dateTime ) : UserInfo
username string The Username.
displayName string The display name (can be null).
password string The Password.
email string The Email address.
active bool A value indicating whether the account is active.
dateTime System.DateTime The Account creation Date/Time.
Результат UserInfo

AddUserGroup() публичный Метод

Adds a new user group.
If or are null. If is empty.
public AddUserGroup ( string name, string description ) : UserGroup
name string The name of the group.
description string The description of the group.
Результат UserGroup

GetUser() публичный Метод

Gets the user info object for the currently logged in user.
If is null. If is empty.
public GetUser ( string username ) : UserInfo
username string The username.
Результат UserInfo

GetUserByEmail() публичный Метод

Gets a user account. Not Implemented - Passed Directly to the IUsersStorageProviderV30
If is null. If is empty.
public GetUserByEmail ( string email ) : UserInfo
email string The email address.
Результат UserInfo

GetUserGroups() публичный Метод

Gets all the user groups.
public GetUserGroups ( ) : UserGroup[]
Результат UserGroup[]

GetUsers() публичный Метод

Gets the complete list of Users.
public GetUsers ( ) : UserInfo[]
Результат UserInfo[]

GetUsersWithData() публичный Метод

Gets all the users that have the specified element in their data. Not Implemented - Passed Directly to the IUsersStorageProviderV30
If is null. If is empty.
public GetUsersWithData ( string key ) : string>.IDictionary
key string The key of the data.
Результат string>.IDictionary

Init() публичный Метод

Initializes the Storage Provider.
If or are null. If is not valid or is incorrect.
public Init ( IHostV30 host, string config ) : void
host IHostV30 The Host of the Component.
config string The Configuration data, if any.
Результат void

ModifyUser() публичный Метод

Modifies a User.
If or are null. If is empty.
public ModifyUser ( UserInfo user, string newDisplayName, string newPassword, string newEmail, bool newActive ) : UserInfo
user UserInfo The Username of the user to modify.
newDisplayName string The new display name (can be null).
newPassword string The new Password (null or blank to keep the current password).
newEmail string The new Email address.
newActive bool A value indicating whether the account is active.
Результат UserInfo

ModifyUserGroup() публичный Метод

Modifies a user group.
If or are null.
public ModifyUserGroup ( UserGroup group, string description ) : UserGroup
group UserGroup The group to modify.
description string The new description of the group.
Результат UserGroup

NotifyCookieLogin() публичный Метод

Notifies the provider that a user has logged in through the authentication cookie. Not Implemented - Passed Directly to the IUsersStorageProviderV30
If is null.
public NotifyCookieLogin ( UserInfo user ) : void
user UserInfo The user who has logged in.
Результат void

NotifyLogout() публичный Метод

Notifies the provider that a user has logged out. Not Implemented - Passed Directly to the IUsersStorageProviderV30
If is null.
public NotifyLogout ( UserInfo user ) : void
user UserInfo The user who has logged out.
Результат void

RemoveUser() публичный Метод

Removes a User.
If is null.
public RemoveUser ( UserInfo user ) : bool
user UserInfo The User to remove.
Результат bool

RemoveUserGroup() публичный Метод

Removes a user group.
If is null.
public RemoveUserGroup ( UserGroup group ) : bool
group UserGroup The group to remove.
Результат bool

RetrieveAllUserData() публичный Метод

Retrieves all the user data elements for a user. Not Implemented - Passed Directly to the IUsersStorageProviderV30
If is null.
public RetrieveAllUserData ( UserInfo user ) : string>.IDictionary
user UserInfo The user.
Результат string>.IDictionary

RetrieveUserData() публичный Метод

Gets a user data element, if any. Not Implemented - Passed Directly to the IUsersStorageProviderV30
If or are null. If is empty.
public RetrieveUserData ( UserInfo user, string key ) : string
user UserInfo The user the data belongs to.
key string The key of the data element.
Результат string

SetUserMembership() публичный Метод

Sets the group memberships of a user account.
If or are null.
public SetUserMembership ( UserInfo user, string groups ) : UserInfo
user UserInfo The user account.
groups string The groups the user account is member of.
Результат UserInfo

Shutdown() публичный Метод

Method invoked on shutdown. Ignored
This method might not be invoked in some cases.
public Shutdown ( ) : void
Результат void

StoreUserData() публичный Метод

Stores a user data element, overwriting the previous one if present. Not Implemented - Passed Directly to the IUsersStorageProviderV30
If or are null. If is empty.
public StoreUserData ( UserInfo user, string key, string value ) : bool
user UserInfo The user the data belongs to.
key string The key of the data element (case insensitive).
value string The value of the data element, null for deleting the data.
Результат bool

TestAccount() публичный Метод

Tests a Password for a User account.
If or are null.
public TestAccount ( UserInfo user, string password ) : bool
user UserInfo The User account.
password string The Password to test.
Результат bool

TryAutoLogin() публичный Метод

Tries to login a user directly through the provider using the current HttpContext and without username/password.
If is null.
public TryAutoLogin ( HttpContext context ) : UserInfo
context System.Web.HttpContext The current HttpContext.
Результат UserInfo

TryManualLogin() публичный Метод

Tries to login a user directly through the provider.
If or are null.
public TryManualLogin ( string username, string password ) : UserInfo
username string The username.
password string The password.
Результат UserInfo