AddUserRole
public static void AddUserRole(int portalId, int userId, int roleId)
Example
AddUserRole(portalId, userId, roleId)
Signature
public static void AddUserRole(int portalId, int userId, int roleId, bool notifyUser)
Example
AddUserRole(portalId, userId, roleId, notifyUser)
AuthoriseUser
public static void AuthoriseUser(int portalId, int userId)
Example
AuthoriseUser(portalId, userId)
ChangePassword
public static bool ChangePassword(int portalId, int userId, string newPassword)
Example
ChangePassword(portalId, userId, newPassword)
ChangePasswordAction
Description: 0 = OK 1 = password length fail 2 = Validate minimum non-alphanumeric characters fail 3 = Validate password strength regex fail 4 = general fail
Signaturepublic static int ChangePasswordAction(int portalId, int userId, string newPassword)
Example
ChangePasswordAction(portalId, userId, newPassword)
CreateUser
public static string CreateUser(int portalId, string username, string email, string roleName = "")
Example
CreateUser(portalId, username, email, roleName)
DeleteUser
Description: Move user to recycle bin.
Signaturepublic static void DeleteUser(int portalId, int userId, bool notify = false, bool deleteAdmin = false)
Example
DeleteUser(portalId, userId, notify, deleteAdmin)
DoLogin
Description: Do login using gereric login form data. xpath must use... var username = postInfo.GetXmlProperty("genxml/text/username"); var password = postInfo.GetXmlProperty("genxml/hidden/password"); var rememberme = postInfo.GetXmlPropertyBool("genxml/checkbox/rememberme");
Signaturepublic static bool DoLogin(SessionParams sessionParams, string username, string password, bool rememberme)
Example
DoLogin(sessionParams, username, password, rememberme)
Signature
public static bool DoLogin(SimplisityInfo postInfo, SimplisityInfo paramInfo)
Example
DoLogin(postInfo, paramInfo)
GetCurrentUserDisplayName
public static string GetCurrentUserDisplayName()
Example
GetCurrentUserDisplayName()
GetCurrentUserEmail
public static string GetCurrentUserEmail()
Example
GetCurrentUserEmail()
GetCurrentUserId
public static int GetCurrentUserId()
Example
GetCurrentUserId()
GetCurrentUserName
public static string GetCurrentUserName()
Example
GetCurrentUserName()
GetRoleById
public static SimplisityRecord GetRoleById(int portalId, int roleId)
Example
GetRoleById(portalId, roleId)
GetRoleByName
public static SimplisityRecord GetRoleByName(int portalId, string roleName)
Example
GetRoleByName(portalId, roleName)
GetRoles
public static Dictionary<int, string> GetRoles(int portalId)
Example
GetRoles(portalId)
GetSuperUsers
public static List<SimplisityRecord> GetSuperUsers()
Example
GetSuperUsers()
GetUserData
public static UserData GetUserData(int portalId, int userId)
Example
GetUserData(portalId, userId)
GetUserDataByEmail
public static UserData GetUserDataByEmail(int portalId, string email)
Example
GetUserDataByEmail(portalId, email)
GetUserDataByUsername
public static UserData GetUserDataByUsername(int portalId, string username)
Example
GetUserDataByUsername(portalId, username)
GetUserIdByEmail
public static int GetUserIdByEmail(int portalId, string email)
Example
GetUserIdByEmail(portalId, email)
GetUserIdByUserName
public static int GetUserIdByUserName(int portalId, string username)
Example
GetUserIdByUserName(portalId, username)
GetUserProfileListField
Description: Returns the key/value pairs of a DNN profile list field (e.g. a dropdown such as "Location"). The list entries are looked up from the DNN Lists table using the profile property's list name.
Signaturepublic static Dictionary<string, string> GetUserProfileListField(int portalId, string fieldName)
Example
GetUserProfileListField(portalId, fieldName)
GetUserProfileProperties
public static Dictionary<string, string> GetUserProfileProperties(int portalId, int userId)
Example
GetUserProfileProperties(portalId, userId)
Signature
public static Dictionary<string, string> GetUserProfileProperties(string userId)
Example
GetUserProfileProperties(userId)
GetUserRoles
public static List<string> GetUserRoles(int portalid = -1, int userId = -1)
Example
GetUserRoles(portalid, userId)
GetUsers
Description: Return list of users in XML SimplisityRecord. XML Format "user/email user/username user/userid user/displayname"
Signaturepublic static List<SimplisityRecord> GetUsers(int portalId, string inRole = "")
Example
GetUsers(portalId, inRole)
Signature
public static List<SimplisityRecord> GetUsers(int portalId, int pageNumber, int pageSize, ref int totalRecord, bool includeDeleted = false, bool superUsersOnly = false)
Example
GetUsers(portalId, pageNumber, pageSize, totalRecord, includeDeleted, superUsersOnly)
Signature
public static List<SimplisityRecord> GetUsers(int portalId, string searchtext, int returnLimit = 100)
Example
GetUsers(portalId, searchtext, returnLimit)
GetUsersUserData
public static List<UserData> GetUsersUserData(int portalId, string searchtext, int returnLimit = 100)
Example
GetUsersUserData(portalId, searchtext, returnLimit)
GetValidUser
public static UserInfo GetValidUser(int PortalId, string username, string password)
Example
GetValidUser(PortalId, username, password)
HasModuleAccess
Description: Check if a user has access to a specific module
Signaturepublic static bool HasModuleAccess(int portalId, int userId, int moduleId, string permissionKey = "VIEW")
Example
HasModuleAccess(portalId, userId, moduleId, permissionKey)
IsAdministrator
public static Boolean IsAdministrator()
Example
IsAdministrator()
Signature
public static bool IsAdministrator(int portalId, int userId)
Example
IsAdministrator(portalId, userId)
IsAuthorised
public static bool IsAuthorised()
Example
IsAuthorised()
Signature
public static bool IsAuthorised(int portalId, int userId)
Example
IsAuthorised(portalId, userId)
IsClientOnly
public static Boolean IsClientOnly()
Example
IsClientOnly()
IsEditor
public static Boolean IsEditor()
Example
IsEditor()
IsInRole
public static bool IsInRole(int portalId, int userId, string role)
Example
IsInRole(portalId, userId, role)
Signature
public static bool IsInRole(string role)
Example
IsInRole(role)
IsManager
public static Boolean IsManager()
Example
IsManager()
IsSuperUser
public static bool IsSuperUser(int portalId, int userId)
Example
IsSuperUser(portalId, userId)
Signature
public static bool IsSuperUser()
Example
IsSuperUser()
IsValidUser
public static bool IsValidUser(int PortalId, string username)
Example
IsValidUser(PortalId, username)
Signature
public static bool IsValidUser(int PortalId, string username, string password)
Example
IsValidUser(PortalId, username, password)
Signature
public static bool IsValidUser(int portalId, int userId)
Example
IsValidUser(portalId, userId)
LoginForm
public static string LoginForm(string systemkey, SimplisityInfo sInfo, string interfacekey, int userid)
Example
LoginForm(systemkey, sInfo, interfacekey, userid)
RegisterForm
public static string RegisterForm(SimplisityInfo systemInfo, SimplisityInfo sInfo, string interfacekey, int userid)
Example
RegisterForm(systemInfo, sInfo, interfacekey, userid)
RegisterUser
public static string RegisterUser(SimplisityInfo sInfo, string currentCulture = "")
Example
RegisterUser(sInfo, currentCulture)
Signature
public static string RegisterUser(string displayname, string username, string useremail, string password, string confirmpassword, string currentCulture, bool approved)
Example
RegisterUser(displayname, username, useremail, password, confirmpassword, currentCulture, approved)
RemoveUser
Description: Remove user from recyclebin (hard delete)
Signaturepublic static void RemoveUser(int portalId, int userId, bool notify = false, bool deleteAdmin = false)
Example
RemoveUser(portalId, userId, notify, deleteAdmin)
RemoveUserRole
public static void RemoveUserRole(int portalId, int userId, int roleId)
Example
RemoveUserRole(portalId, userId, roleId)
ResetPass
public static bool ResetPass(string emailaddress, bool sendEmail)
Example
ResetPass(emailaddress, sendEmail)
SetCurrentUserDisplayName
public static void SetCurrentUserDisplayName(string displayName)
Example
SetCurrentUserDisplayName(displayName)
SetRemovalRequest
public static void SetRemovalRequest(int portalId, int userId, bool remove = true)
Example
SetRemovalRequest(portalId, userId, remove)
SetUserProfileProperties
public static void SetUserProfileProperties(String userId, Dictionary<string, string> properties)
Example
SetUserProfileProperties(userId, properties)
Signature
public static void SetUserProfileProperties(int portalId, int userId, Dictionary<string, string> properties)
Example
SetUserProfileProperties(portalId, userId, properties)
SignOut
public static void SignOut()
Example
SignOut()
UnAuthoriseUser
public static void UnAuthoriseUser(int portalId, int userId)
Example
UnAuthoriseUser(portalId, userId)
UnDeleteUser
public static void UnDeleteUser(int portalId, int userId)
Example
UnDeleteUser(portalId, userId)
UnlockUser
Description: Unlocks a user account that has been locked out by DNN's membership provider (e.g. after too many failed login attempts). Also clears any pending "update password" requirement so the user can log in normally again.
Signaturepublic static bool UnlockUser(int portalId, int userId)
Example
UnlockUser(portalId, userId)
Signature
public static bool UnlockUser(int portalId, string usernameOrEmail)
Example
UnlockUser(portalId, usernameOrEmail)
UpdateEmail
Description: Updates the user's email address and, if the portal is configured to use email as username, also updates the username to match the new email.
Signaturepublic static UserData UpdateEmail(int portalId, int userId, string newEmail)
Example
UpdateEmail(portalId, userId, newEmail)
UpdateOrCreateUserProfileProperty
Description: Updates or creates a DNN user profile property for a user in the specified portal. If the property definition doesn't exist in the portal, it will be created.
Signaturepublic static bool UpdateOrCreateUserProfileProperty(int userId, string key, string value, int portalId = 0, string category = "Custom", bool visibilityAllUsers = false)
Example
UpdateOrCreateUserProfileProperty(userId, key, value, portalId, category, visibilityAllUsers)
UserLogin
Description: Validates and logs in a user, using an explicit portalId rather than ambient PortalSettings.Current. This ensures the correct portal-level lockout/security settings (MaxInvalidPasswordAttempts, etc.) are enforced, which is critical in AJAX/API request pipelines where PortalSettings.Current may not be reliably populated.
Signaturepublic static bool UserLogin(int portalId, string userHostAddress, string username, string password, bool rememberme)
Example
UserLogin(portalId, userHostAddress, username, password, rememberme)
UserLoginNoPassword
Description: Logs a user in WITHOUT password verification. Used for trust-based flows (e.g. SSO token consumption, auto-login) where identity has already been established by another mechanism (signed token, etc).
Signaturepublic static void UserLoginNoPassword(int portalId, string portalName, string userHostAddress, string username, bool rememberme)
Example
UserLoginNoPassword(portalId, portalName, userHostAddress, username, rememberme)