Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesRedirect to a module control after loginRedirect to a module control after login
Previous
 
Next
New Post
6/4/2011 12:31 PM
 
I have a module with 2 view controls. I want View1 control to be viewable to all users but  View2 to be viewable only to registered users. There's a link on View1 that takes a user to View2. I want unregistered users to be prompted to login when they click the link then returned to View2 after login. I can easily do this by changing view2 to "edit" type then give give registered users permission to edit module. Dotnetnuke generates a url with a returnurl like this: mysite/login.aspx?ReturnUrl=%2fproper... . The problem is when I do this, there's a bar that appears above the website in the browser with view and edit radiobuttons. Not Good.

The solution I came up with is to add the following code to the page load event of View2 is

If Not Request.IsAuthenticated Then
    Response.Redirect(Globals.NavigateURL(PortalSettings.LoginTabId, True, PortalSettings, "Login", "returnurl=" & server.UrlEncode(Request.Url.ToString)))
End If

This redirects the user to the login page if they are not authenticated but it does not return them to View2 of the module after they log in. How do I do add a returnurl like dotnetnuke does for you when a control is an edit control? - Thanks

Mackeny

pendelea.com -The #1 website for properties in Kenya
 
New Post
6/5/2011 5:36 AM
 
To get rid of that bar:
1. In page settinngs set permissions view to "All Users" nothing else.
2. In Admin->SiteSettings-> AdvencedSettings-> UsabilitySettings-> Control Panel Security set "PageEditors"
3. In your module in Settings tab in Permissions section set "Edit Module" for "Registered Users"
 
New Post
6/6/2011 6:23 PM
 
Bartlomiej Waluszko wrote:
To get rid of that bar:
1. In page settinngs set permissions view to "All Users" nothing else.
2. In Admin->SiteSettings-> AdvencedSettings-> UsabilitySettings-> Control Panel Security set "PageEditors"
3. In your module in Settings tab in Permissions section set "Edit Module" for "Registered Users"

Thanks Bartlomiei. That removed the bar. This solves my problem in the short term since this is a custom module, but  if I decide to let the module go public in the future, I don't expect my customers to have to do this. There have to be a way to pass the returnurl with the page and module control  to the login page, i just can't figure it out now. I'll keep this thread marked as unresolved but meanwhile your method will do. Thanks


Mackeny

pendelea.com -The #1 website for properties in Kenya
 
New Post
8/30/2011 7:54 PM
 
I found a solution to the above problem - Just in case someone else might be interested;

                            If Not Request.IsAuthenticated Then
                    Dim ReturnUrl As String = HttpContext.Current.Request.RawUrl
                    If ReturnUrl.IndexOf("?returnurl=") <> -1 Then
                        ReturnUrl = ReturnUrl.Substring(0, ReturnUrl.IndexOf("?returnurl="))
                    End If
                    ReturnUrl = HttpUtility.UrlEncode(ReturnUrl)
                    If PortalSettings.LoginTabId <> -1 And Request.QueryString("override") Is Nothing Then
                        ' user defined tab
                        Response.Redirect(NavigateURL(PortalSettings.LoginTabId, "", "returnurl=" & ReturnUrl), True)
                    Else
                        ' portal tab
                        If PortalSettings.HomeTabId <> -1 Then
                            Response.Redirect(NavigateURL(PortalSettings.HomeTabId, "Login", "returnurl=" & ReturnUrl), True)
                        Else
                            Response.Redirect(NavigateURL(PortalSettings.ActiveTab.TabID, "Login", "returnurl=" & ReturnUrl), True)
                        End If
                    End If
 
                End If

Mackeny

pendelea.com -The #1 website for properties in Kenya
 
New Post
8/30/2011 8:23 PM
 
I forgot to add a link to the forum I found the solution in;

http://www.dotnetnuke.com/Resources/Forums/forumid/-1/postid/218921/scope/posts.aspx

Thanks to Brian Dukes.

Mackeny

pendelea.com -The #1 website for properties in Kenya
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesRedirect to a module control after loginRedirect to a module control after login


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out