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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...anonymous/registered access in dnn custom modulesanonymous/registered access in dnn custom modules
Previous
 
Next
New Post
8/26/2008 4:19 PM
 

I am developing a module in which some parts can access by anonymous user as well as registered users and some parts can only be allowed to access by registered users. I will explain it in detail :

My module have 5 ascx controls other than view.ascx and settings.ascx. In the 5 ascx control, 3 of them can access by anonymous users as well as registered users and the other 2 control pages can only be allowed to access by registered users.

This is a module developing for product search. so search, results, and detail of each results can be viewed by all users.
When an anonymous user check the home page of the module which we can name 1.ascx in which the search options included and submits for search; it will displays the results, i.e., 2.ascx.

Now there are some selection property set for each row shown with various products, and here the user can select any product(checkbox) and can send the selected products to his email. so when he clicks "send to email" link i have to check whether the user is registered or on anonymous status. If he is on anonymous mode, the login module should show and successfull login will direct him to the email sending page, 3.ascx.

I know on module settings, we can set the module to allow access to "ALL" or "registered" users. if i 'check' the registered users, then all parts of the module can only be accessed by registered users, but here in this case, only some parts of the module to be set for registered users. How can i direct him to the dnn login page if he is not yet login. and how can i direct to email page once he successfully login.

hope the question is clear ... I am developing a module in which some parts can access by anonymous user as well as registered users and some parts can only be allowed to access by registered users. I will explain it in detail :

My module have 5 ascx controls other than view.ascx and settings.ascx. In the 5 ascx control, 3 of them can access by anonymous users as well as registered users and the other 2 control pages can only be allowed to access by registered users.

This is a module developing for product search. so search, results, and detail of each results can be viewed by all users.
When an anonymous user check the home page of the module which we can name 1.ascx in which the search options included and submits for search; it will displays the results, i.e., 2.ascx.

Now there are some selection property set for each row shown with various products, and here the user can select any product(checkbox) and can send the selected products to his email. so when he clicks "send to email" link i have to check whether the user is registered or on anonymous status. If he is on anonymous mode, the login module should show and successfull login will direct him to the email sending page, 3.ascx.

I know on module settings, we can set the module to allow access to "ALL" or "registered" users. if i 'check' the registered users, then all parts of the module can only be accessed by registered users, but here in this case, only some parts of the module to be set for registered users. How can i direct him to the dnn login page if he is not yet login. and how can i direct to email page once he successfully login.

hope the question is clear ...

 
New Post
8/26/2008 5:47 PM
 

Hi Jikubhai,

If I understand your question correctly, you are attempting to aggregate multiple ASCX controls inside one module instance (probably View.ascx), and wish to toggle visibility of these child controls based upon the authenticated status of the current user.

To accomplish this, you will not be able to use the Settings control to specify visibility, because, as you noticed, it only controls display of the entire module, and not the subcontrols therein.

So, you'll need to add code in the Page_Load event of each of the controls to handle the authenticated and unauthenticated cases. 

This will probably take the form of something like:

DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo().IsInRole("Registered Users")

Hope this helps!

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post
8/26/2008 11:14 PM
 

Exactly you understand how i am working and sure i will give a try on that hope i can jump the first hurdle.  There is another problem that how i can call the login module page of dnn on false return of isinrole("registeredusers").  I mean not login mode, i should display the login part of dnn.  and successfull login get back the page user was directed ... how this can be achieved.  thank you.

 
New Post
8/27/2008 10:17 AM
 

Hi Jikubhai,

To redirect to the DNN login page, use the following call:

Response.Redirect(NavigateURL(PortalSettings.ActiveTab.TabID,

"Login", "returnurl=" & HttpUtility.UrlEncode(HttpContext.Current.Request.RawUrl)))

Note that you can specify any returnurl you wish (the above code uses the current url).  Omitting the returnurl parameter will cause DNN to redirect to the portal-specified user tab upon authentication.

Hope this helps!

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post
8/27/2008 6:00 PM
 

Yes! ........... The solution obtained .... thank you Brandon. 

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...anonymous/registered access in dnn custom modulesanonymous/registered access in dnn custom modules


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