Hey everyone,
I have inherited a DNN portal that an old programmer setup and that is slightly customized already with some auto login logic.
Users log into a ERP system which then redirects to a DNN portal, with some of the user information in the query string. My question to you all is there a way to store a custom feild like "Employee_Number". I would like to be able to use that employee number in links to specific information that the employee would need access to.
The problem right now, is that we put that employee number in a cookie, but seems to be having some issues on some user machines.
Any advice or direction would be great. I am pretty new to .net and DNN so i this is all doable.
--------------------------------------------------------------------------------------
DotNetNuke.ModulesDotNetNuke.Security.Membership
Public
UserController.UserLogin(_portalID, objUser, PortalSettings.PortalName, _IPAddress,
Class SSOAutoInherits DotNetNuke.Entities.Modules.PortalModuleBaseSub AutoLogin(ByVal _portalID As Long, ByVal _username As String, ByVal _password As String, ByVal _IPAddress As String)Dim loginStatus As UserLoginStatusDim objUser As UserInfo = UserController.ValidateUser(_portalID, _username, _password, "", PortalSettings.PortalName, _IPAddress, loginStatus)False) 'UserAuthorized(objUser, False)
End Sub
Sub AutoUserTest(ByVal _portalid As Long, ByVal _username As String, ByVal _password As String, ByVal _lastname As String, ByVal _firstname As String, ByVal _email As String)' Add New User to Portal User Database
Dim objSecurity As New PortalSecurityDim objUserInfo As UserInfoDim _test As Boolean
objUserInfo = UserController.GetUserByName(_portalid, _username,
False)If Not objUserInfo Is Nothing Then 'And UserControl.UserName <> _UserName Then
_test =
False
Else
_test =
True
objNewUser.PortalID = _portalid
objNewUser.Profile.FirstName = _firstname
Dim userCreateStatus As UserCreateStatus = userCreateStatus.AddUserDim AffiliateId As Integer = Null.NullIntegerDim objNewUser As New UserInfo'UserControl.FirstName
objNewUser.Profile.LastName = _lastname
'UserControl.LastName
objNewUser.FirstName = _firstname
objNewUser.LastName = _lastname
objNewUser.DisplayName = _firstname &
objNewUser.Username = _username
" " & _lastname'UserControl.UserName
objNewUser.Email = _email
'+"monty.alger@ge.com" 'UserControl.Email
objNewUser.Membership.Password = _password
'UserControl.Password
objNewUser.Membership.Approved =
True 'Convert.ToBoolean(IIf(PortalSettings.UserRegistration <> PortalRegistrationType.PublicRegistration, False, True))
objNewUser.AffiliateID = AffiliateId
userCreateStatus = UserController.CreateUser(objNewUser)
If userCreateStatus = userCreateStatus.Success Then
'store preferredlocale in cookie
DotNetNuke.Services.Localization.Localization.SetLanguage(objNewUser.Profile.PreferredLocale)
End If
End If
'AutoUserTest = _test
End Sub
Sub DoAutoLogin(ByVal _username As String, ByVal _password As String, ByVal _lastname As String, ByVal _firstname As String, ByVal _email As String)Dim _pw As String
AutoUserTest(
_pw = _password
End
Dim _IPaddress As String = HttpContext.Current.Request.UserHostAddress.ToString()Me.PortalId, _username, _password, _lastname, _firstname, _email)Call AutoLogin(Me.PortalId, _username, _pw, _IPaddress)End Sub Class
Imports
Imports