GetCurrentUserId
Description: Gets the ID of the currently logged-in user.
Signaturepublic static int GetCurrentUserId()
RemoveUser
Description: Permanently removes a user from the database (hard delete).
Signaturepublic static void RemoveUser(int portalId, int userId, bool notify = false, bool deleteAdmin = false)
DeleteUser
Description: Moves a user to the recycle bin (soft delete).
Signaturepublic static void DeleteUser(int portalId, int userId, bool notify = false, bool deleteAdmin = false)
UnDeleteUser
Description: Restores a user from the recycle bin.
Signaturepublic static void UnDeleteUser(int portalId, int userId)
GetCurrentUserDisplayName
Description: Gets the display name of the currently logged-in user.
Signaturepublic static string GetCurrentUserDisplayName()
SetCurrentUserDisplayName
Description: Sets the display name for the currently logged-in user.
Signaturepublic static void SetCurrentUserDisplayName(string displayName)
GetCurrentUserName
Description: Gets the username of the currently logged-in user.
Signaturepublic static string GetCurrentUserName()
GetCurrentUserEmail
Description: Gets the email address of the currently logged-in user.
Signaturepublic static string GetCurrentUserEmail()
GetUserRoles
Description: Gets a list of roles for a specified user or the current user.
Signaturepublic static List<string> GetUserRoles(int portalid = -1, int userId = -1)
ResetPass
Description: Initiates the password reset process for a user by their email address.
Signaturepublic static bool ResetPass(string emailaddress, bool sendEmail)
ChangePassword
Description: Changes the password for a specified user.
Signaturepublic static bool ChangePassword(int portalId, int userId, string newPassword)
DoLogin
Description: Logs a user in with the provided credentials.
Signaturepublic static bool DoLogin(SessionParams sessionParams, string username, string password, bool rememberme)
UserLogin
Description: Performs a user login action.
Signaturepublic static bool UserLogin(string userHostAddress, string username, string password, bool rememberme)
UserLogin
Description: Logs in a user programmatically without a password check, assuming they are already authenticated.
Signaturepublic static void UserLogin(int portalId, string portalName, string userHostAddress, string username, bool rememberme)
DoLogin
Description: Logs a user in using data from a generic login form (SimplisityInfo).
Signaturepublic static bool DoLogin(SimplisityInfo postInfo, SimplisityInfo paramInfo)
LoginForm
Description: Renders a login form using a Razor template.
Signaturepublic static string LoginForm(string systemkey, SimplisityInfo sInfo, string interfacekey, int userid)
RegisterForm
Description: Renders a user registration form using a Razor template.
Signaturepublic static string RegisterForm(SimplisityInfo systemInfo, SimplisityInfo sInfo, string interfacekey, int userid)
RegisterUser
Description: Registers a new user based on data from a SimplisityInfo object.
Signaturepublic static string RegisterUser(SimplisityInfo sInfo, string currentCulture = "")
RegisterUser
Description: Registers a new user with the specified details.
Signaturepublic static string RegisterUser(string displayname, string username, string useremail, string password, string confirmpassword, string currentCulture, bool approved)
CreateUser
Description: Creates a new user in the specified portal and optionally assigns them to a role.
Signaturepublic static string CreateUser(int portalId, string username, string email, string roleName = "")
GetUserDataByUsername
Description: Gets a UserData object for a user by their username.
Signaturepublic static UserData GetUserDataByUsername(int portalId, string username)
GetUserDataByEmail
Description: Gets a UserData object for a user by their email address.
Signaturepublic static UserData GetUserDataByEmail(int portalId, string email)
GetUserData
Description: Gets a UserData object containing detailed information about a user.
Signaturepublic static UserData GetUserData(int portalId, int userId)
IsAuthorised
Description: Checks if the current user is authorized (approved).
Signaturepublic static bool IsAuthorised()
IsAuthorised
Description: Checks if a specific user is authorized (approved).
Signaturepublic static bool IsAuthorised(int portalId, int userId)
UnAuthoriseUser
Description: Marks a user as not approved.
Signaturepublic static void UnAuthoriseUser(int portalId, int userId)
AuthoriseUser
Description: Marks a user as approved.
Signaturepublic static void AuthoriseUser(int portalId, int userId)
UpdateEmail
Description: Updates the email address for a user.
Signaturepublic static UserData UpdateEmail(int portalId, int userId, string email)
GetUserProfileProperties
Description: Gets a dictionary of all profile properties for a user.
Signaturepublic static Dictionary<string, string> GetUserProfileProperties(int portalId, int userId)
GetUserProfileProperties
Description: Gets a dictionary of all profile properties for a user by their user ID as a string.
Signaturepublic static Dictionary<string, string> GetUserProfileProperties(string userId)
SetUserProfileProperties
Description: Sets multiple profile properties for a user.
Signaturepublic static void SetUserProfileProperties(String userId, Dictionary<string, string> properties)
SetUserProfileProperties
Description: Sets multiple profile properties for a user.
Signaturepublic static void SetUserProfileProperties(int portalId, int userId, Dictionary<string, string> properties)
GetUserIdByUserName
Description: Gets a user's ID from their username.
Signaturepublic static int GetUserIdByUserName(int portalId, string username)
GetUsers
Description: Gets a list of users as SimplisityRecord objects, optionally filtered by role.
Signaturepublic static List<SimplisityRecord> GetUsers(int portalId, string inRole = "")
GetUsers
Description: Gets a paginated list of users as SimplisityRecord objects.
Signaturepublic static List<SimplisityRecord> GetUsers(int portalId, int pageNumber, int pageSize, ref int totalRecord, bool includeDeleted = false, bool superUsersOnly = false)
GetUsers
Description: Searches for users by a text string and returns a list of SimplisityRecord objects.
Signaturepublic static List<SimplisityRecord> GetUsers(int portalId, string searchtext, int returnLimit = 100)
GetUsersUserData
Description: Searches for users by a text string and returns a list of UserData objects.
Signaturepublic static List<UserData> GetUsersUserData(int portalId, string searchtext, int returnLimit = 100)
GetSuperUsers
Description: Gets a list of all super users as SimplisityRecord objects.
Signaturepublic static List<SimplisityRecord> GetSuperUsers()
GetUserIdByEmail
Description: Gets a user's ID from their email address.
Signaturepublic static int GetUserIdByEmail(int portalId, string email)
IsInRole
Description: Checks if a specific user is in a given role.
Signaturepublic static bool IsInRole(int portalId, int userId, string role)
IsInRole
Description: Checks if the current user is in a given role.
Signaturepublic static bool IsInRole(string role)
IsSuperUser
Description: Checks if a specific user is a super user.
Signaturepublic static bool IsSuperUser(int portalId, int userId)
IsSuperUser
Description: Checks if the current user is a super user.
Signaturepublic static bool IsSuperUser()
IsClientOnly
Description: Checks if the current user has only the 'Collaborator' role and no higher-level roles.
Signaturepublic static Boolean IsClientOnly()
IsManager
Description: Checks if the current user is in the 'Manager' or 'Administrators' role.
Signaturepublic static Boolean IsManager()
IsEditor
Description: Checks if the current user has at least 'Collaborator' level permissions.
Signaturepublic static Boolean IsEditor()
IsAdministrator
Description: Checks if the current user is in the 'Administrators' role.
Signaturepublic static Boolean IsAdministrator()
IsAdministrator
Description: Checks if a specific user is an administrator.
Signaturepublic static bool IsAdministrator(int portalId, int userId)
GetValidUser
Description: Validates a user's credentials and returns the UserInfo object if valid.
Signaturepublic static UserInfo GetValidUser(int PortalId, string username, string password)
IsValidUser
Description: Checks if a user exists by username.
Signaturepublic static bool IsValidUser(int PortalId, string username)
IsValidUser
Description: Checks if a user's credentials are valid.
Signaturepublic static bool IsValidUser(int PortalId, string username, string password)
IsValidUser
Description: Checks if a user exists by user ID.
Signaturepublic static bool IsValidUser(int portalId, int userId)
GetRoleById
Description: Gets role information as a SimplisityRecord by role ID.
Signaturepublic static SimplisityRecord GetRoleById(int portalId, int roleId)
GetRoles
Description: Gets a dictionary of all roles in a portal.
Signaturepublic static Dictionary<int, string> GetRoles(int portalId)
GetRoleByName
Description: Gets role information as a SimplisityRecord by role name.
Signaturepublic static SimplisityRecord GetRoleByName(int portalId, string roleName)
AddUserRole
Description: Adds a user to a role.
Signaturepublic static void AddUserRole(int portalId, int userId, int roleId)
AddUserRole
Description: Adds a user to a role and optionally notifies the user.
Signaturepublic static void AddUserRole(int portalId, int userId, int roleId, bool notifyUser)
RemoveUserRole
Description: Removes a user from a role.
Signaturepublic static void RemoveUserRole(int portalId, int userId, int roleId)
SignOut
Description: Signs the current user out.
Signaturepublic static void SignOut()
HasModuleAccess
Description: Checks if a user has a specific level of access to a module.
Signaturepublic static bool HasModuleAccess(int portalId, int userId, int moduleId, string permissionKey = "VIEW")
UpdateOrCreateUserProfileProperty
Description: Updates or creates a DNN user profile property. If the property definition doesn't exist, it will be created.
Signaturepublic static bool UpdateOrCreateUserProfileProperty(int userId, string key, string value, int portalId = 0, string category = "Custom", bool visibilityAllUsers = false)