I recently installed DNN 4.02 and setup a quick Intranet. I like the DNN user, profiles, and roles and would like to somehow integrate the membership with some existing apps I created outside of DNN. In my apps, I just need to verify the user is on the appropriate role, and get some basic info like name, email, etc.
I tried creating a subfolder under the root of my DNN install containing the existing app, then I created a DNN page linked (to external page) to this directory. I changed the page load of my test app to include the following:
Imports DotNetNuke.Framework
Imports DotNetNuke.Entities.Users
Partial Class test
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim objUserInfo As UserInfo
objUserInfo = UserController.GetCurrentUserInfo()
TextBox1.Text = CType(objUserInfo.Username, String)
End Sub
End Class
After logging in to the DNN site, then clicking the link to my pre-existing app (within the DNN root directory) the texbox is just supposed to show me the username of the current user. I know I must just be missing something obvious, but I can't seem to access any User Info from my application. I didn't really want to rebuild my apps as modules to use the DNN framework and like I said, all I need is to verify a role and get basic user info.
Any help would be appreciated.
Phil