C# Class ScrewTurn.Wiki.Users

Manages all the User Accounts data.
显示文件 Open project: mono/ScrewTurnWiki

Public Methods

Method Description
AddUser ( string username, string displayName, string password, string email, bool active, IUsersStorageProviderV30 provider ) : bool

Adds a new User.

AddUserGroup ( string name, string description ) : bool

Adds a new user group to the default provider.

AddUserGroup ( string name, string description, IUsersStorageProviderV30 provider ) : bool

Adds a new user group to a specific provider.

ChangeEmail ( UserInfo user, string newEmail ) : bool

Changes the Email address of a User.

ChangePassword ( UserInfo user, string newPassword ) : bool

Changes the Password of a User.

ComputeLoginKey ( string username, string email, System.DateTime dateTime ) : string

Copmputes the login key.

FindUser ( string username ) : UserInfo

Finds a user.

FindUserByEmail ( string email ) : UserInfo

Finds a user by email.

FindUserGroup ( string name ) : UserGroup

Finds a user group.

GetAdministratorAccount ( ) : UserInfo

Gets the built-in administrator account.

GetAnonymousAccount ( ) : UserInfo

Gets the fake anonymous account.

GetDisplayName ( UserInfo user ) : string

Gets the display name of a user.

GetEmailNotification ( UserInfo user, NamespaceInfo nspace, bool &pageChanges, bool &discussionMessages ) : void

Gets the email notification status for a namespace.

GetEmailNotification ( UserInfo user, System.PageInfo page, bool &pageChanges, bool &discussionMessages ) : void

Gets the email notification status for a page.

GetUserData ( UserInfo user, string key ) : string

Gets user data.

GetUserGroups ( ) : List

Gets all the user groups.

GetUserGroups ( IUsersStorageProviderV30 provider ) : List

Gets all the user groups in a provider.

GetUserGroupsForUser ( UserInfo user ) : List

Gets all the user groups a user is member of.

GetUsers ( ) : List

Gets all the Users that the providers declare to manage.

GetUsersToNotifyForDiscussionMessages ( System.PageInfo page ) : UserInfo[]

Gets all the users that must be notified of a discussion message.

GetUsersToNotifyForPageChange ( System.PageInfo page ) : UserInfo[]

Gets all the users that must be notified of a page change.

ModifyUser ( UserInfo user, string displayName, string password, string email, bool active ) : bool

Updates a new User.

ModifyUserGroup ( UserGroup group, string description ) : bool

Modifies a user group.

NotifyLogout ( string username ) : void

Notifies to the proper provider that a user has logged out.

RemoveUser ( UserInfo user ) : bool

Removes a User.

RemoveUserGroup ( UserGroup group ) : bool

Removes a user group.

SendPasswordResetMessage ( string username, string email, System.DateTime dateTime ) : void

Sends the password reset message to a user.

SetActivationStatus ( UserInfo user, bool active ) : bool

Sets the Active/Inactive status of a User.

SetEmailNotification ( UserInfo user, NamespaceInfo nspace, bool pageChanges, bool discussionMessages ) : bool

Sets the email notification status for a namespace.

SetEmailNotification ( UserInfo user, System.PageInfo page, bool pageChanges, bool discussionMessages ) : bool

Sets the email notification status for a page.

SetUserData ( UserInfo user, string key, string data ) : bool

Sets user data.

SetUserMembership ( UserInfo user, string groups ) : bool

Sets the group memberships of a user account.

TryAutoLogin ( HttpContext context ) : UserInfo

Tries to automatically login a user using the current HttpContext, through any provider that supports the operation.

TryCookieLogin ( string username, string loginKey ) : UserInfo

Tries to login a user through the cookie-stored authentication data.

TryLogin ( string username, string password ) : UserInfo

Tries to manually login a user using all the available methods.

UserLink ( string username ) : string

Creates the correct link of a User.

UserLink ( string username, bool newWindow ) : string

Creates the correct link of a User.

Private Methods

Method Description
GetUsersToNotify ( NamespaceInfo nspace, string key ) : UserInfo[]

Gets the users to notify for either a page change or a discussion message in a namespace.

GetUsersToNotify ( System.PageInfo page, string key ) : UserInfo[]

Gets the users to notify for either a page change or a discussion message.

ListDirectories ( IFilesStorageProviderV30 provider ) : List

Lists all directories in a provider, including the root.

ListDirectoriesRecursive ( IFilesStorageProviderV30 provider, string current, List output ) : void
MergeArrays ( UserInfo array1, UserInfo array2 ) : UserInfo[]

Merges two arrays of users, removing duplicates.

RemovePermissions ( UserGroup group ) : void

Removes all permissions for a group.

RemovePermissions ( UserInfo user ) : void

Removes all permissions for a user.

Method Details

AddUser() public static method

Adds a new User.
public static AddUser ( string username, string displayName, string password, string email, bool active, IUsersStorageProviderV30 provider ) : bool
username string The Username.
displayName string The display name.
password string The Password (plain text).
email string The Email address.
active bool A value specifying whether or not the account is active.
provider IUsersStorageProviderV30 The Provider. If null, the default provider is used.
return bool

AddUserGroup() public static method

Adds a new user group to the default provider.
public static AddUserGroup ( string name, string description ) : bool
name string The name of the group.
description string The description of the group.
return bool

AddUserGroup() public static method

Adds a new user group to a specific provider.
public static AddUserGroup ( string name, string description, IUsersStorageProviderV30 provider ) : bool
name string The name of the group.
description string The description of the group.
provider IUsersStorageProviderV30 The target provider.
return bool

ChangeEmail() public static method

Changes the Email address of a User.
public static ChangeEmail ( UserInfo user, string newEmail ) : bool
user UserInfo The User to change the Email address of.
newEmail string The new Email address.
return bool

ChangePassword() public static method

Changes the Password of a User.
public static ChangePassword ( UserInfo user, string newPassword ) : bool
user UserInfo The User to change the password of.
newPassword string The new Password (plain text).
return bool

ComputeLoginKey() public static method

Copmputes the login key.
public static ComputeLoginKey ( string username, string email, System.DateTime dateTime ) : string
username string The username.
email string The email.
dateTime System.DateTime The registration date/time.
return string

FindUser() public static method

Finds a user.
public static FindUser ( string username ) : UserInfo
username string The username.
return UserInfo

FindUserByEmail() public static method

Finds a user by email.
public static FindUserByEmail ( string email ) : UserInfo
email string The email address.
return UserInfo

FindUserGroup() public static method

Finds a user group.
public static FindUserGroup ( string name ) : UserGroup
name string The name of the user group to find.
return UserGroup

GetAdministratorAccount() public static method

Gets the built-in administrator account.
public static GetAdministratorAccount ( ) : UserInfo
return UserInfo

GetAnonymousAccount() public static method

Gets the fake anonymous account.
public static GetAnonymousAccount ( ) : UserInfo
return UserInfo

GetDisplayName() public static method

Gets the display name of a user.
public static GetDisplayName ( UserInfo user ) : string
user UserInfo The user.
return string

GetEmailNotification() public static method

Gets the email notification status for a namespace.
public static GetEmailNotification ( UserInfo user, NamespaceInfo nspace, bool &pageChanges, bool &discussionMessages ) : void
user UserInfo The user for which to get the notification status.
nspace NamespaceInfo The namespace subject of the notification (null for the root).
pageChanges bool A value indicating whether page changes should be notified.
discussionMessages bool A value indicating whether discussion messages should be notified.
return void

GetEmailNotification() public static method

Gets the email notification status for a page.
public static GetEmailNotification ( UserInfo user, System.PageInfo page, bool &pageChanges, bool &discussionMessages ) : void
user UserInfo The user for which to get the notification status.
page System.PageInfo The page subject of the notification.
pageChanges bool A value indicating whether page changes should be notified.
discussionMessages bool A value indicating whether discussion messages should be notified.
return void

GetUserData() public static method

Gets user data.
public static GetUserData ( UserInfo user, string key ) : string
user UserInfo The user.
key string The data key.
return string

GetUserGroups() public static method

Gets all the user groups.
public static GetUserGroups ( ) : List
return List

GetUserGroups() public static method

Gets all the user groups in a provider.
public static GetUserGroups ( IUsersStorageProviderV30 provider ) : List
provider IUsersStorageProviderV30 The provider.
return List

GetUserGroupsForUser() public static method

Gets all the user groups a user is member of.
public static GetUserGroupsForUser ( UserInfo user ) : List
user UserInfo The user.
return List

GetUsers() public static method

Gets all the Users that the providers declare to manage.
public static GetUsers ( ) : List
return List

GetUsersToNotifyForDiscussionMessages() public static method

Gets all the users that must be notified of a discussion message.
public static GetUsersToNotifyForDiscussionMessages ( System.PageInfo page ) : UserInfo[]
page System.PageInfo The page.
return UserInfo[]

GetUsersToNotifyForPageChange() public static method

Gets all the users that must be notified of a page change.
public static GetUsersToNotifyForPageChange ( System.PageInfo page ) : UserInfo[]
page System.PageInfo The page.
return UserInfo[]

ModifyUser() public static method

Updates a new User.
public static ModifyUser ( UserInfo user, string displayName, string password, string email, bool active ) : bool
user UserInfo The user to modify.
displayName string The display name.
password string The Password (plain text, null or empty for no change).
email string The Email address.
active bool A value specifying whether or not the account is active.
return bool

ModifyUserGroup() public static method

Modifies a user group.
public static ModifyUserGroup ( UserGroup group, string description ) : bool
group UserGroup The user group to modify.
description string The new description.
return bool

NotifyLogout() public static method

Notifies to the proper provider that a user has logged out.
public static NotifyLogout ( string username ) : void
username string The username.
return void

RemoveUser() public static method

Removes a User.
public static RemoveUser ( UserInfo user ) : bool
user UserInfo The User to remove.
return bool

RemoveUserGroup() public static method

Removes a user group.
public static RemoveUserGroup ( UserGroup group ) : bool
group UserGroup The user group to remove.
return bool

SendPasswordResetMessage() public static method

Sends the password reset message to a user.
public static SendPasswordResetMessage ( string username, string email, System.DateTime dateTime ) : void
username string The username.
email string The email.
dateTime System.DateTime The user registration date/time.
return void

SetActivationStatus() public static method

Sets the Active/Inactive status of a User.
public static SetActivationStatus ( UserInfo user, bool active ) : bool
user UserInfo The User.
active bool The status.
return bool

SetEmailNotification() public static method

Sets the email notification status for a namespace.
public static SetEmailNotification ( UserInfo user, NamespaceInfo nspace, bool pageChanges, bool discussionMessages ) : bool
user UserInfo The user for which to set the notification status.
nspace NamespaceInfo The namespace subject of the notification.
pageChanges bool A value indicating whether page changes should be notified.
discussionMessages bool A value indicating whether discussion messages should be notified.
return bool

SetEmailNotification() public static method

Sets the email notification status for a page.
public static SetEmailNotification ( UserInfo user, System.PageInfo page, bool pageChanges, bool discussionMessages ) : bool
user UserInfo The user for which to set the notification status.
page System.PageInfo The page subject of the notification.
pageChanges bool A value indicating whether page changes should be notified.
discussionMessages bool A value indicating whether discussion messages should be notified.
return bool

SetUserData() public static method

Sets user data.
public static SetUserData ( UserInfo user, string key, string data ) : bool
user UserInfo The user.
key string The data key.
data string The data value.
return bool

SetUserMembership() public static method

Sets the group memberships of a user account.
public static SetUserMembership ( UserInfo user, string groups ) : bool
user UserInfo The user account.
groups string The groups the user account is member of.
return bool

TryAutoLogin() public static method

Tries to automatically login a user using the current HttpContext, through any provider that supports the operation.
public static TryAutoLogin ( HttpContext context ) : UserInfo
context System.Web.HttpContext The current HttpContext.
return UserInfo

TryCookieLogin() public static method

Tries to login a user through the cookie-stored authentication data.
public static TryCookieLogin ( string username, string loginKey ) : UserInfo
username string The username.
loginKey string The login key.
return UserInfo

TryLogin() public static method

Tries to manually login a user using all the available methods.
public static TryLogin ( string username, string password ) : UserInfo
username string The username.
password string The password.
return UserInfo

UserLink() public static method

Creates the correct link of a User.
public static UserLink ( string username ) : string
username string The Username.
return string

UserLink() public static method

Creates the correct link of a User.
public static UserLink ( string username, bool newWindow ) : string
username string The Username.
newWindow bool A value indicating whether to open the link in a new window.
return string