You need to Register for free and Login to post a message in the forum.

Forum

Subject: Only registered users can access some parts of the module
Prev Next
You are not authorized to post a reply.

Author Messages
nukedoubt
Nuke Active Member
Nuke Active Member
Posts:24

25 Aug 2008 10:09 AM  

.  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 once the login credentials successfully passed in login module then and how can i direct to email page.

hope the question is clear ... thank you

 

nukedoubt
Nuke Active Member
Nuke Active Member
Posts:24

27 Aug 2008 5:08 PM  
Solution Obtained !!!!!!!

Follow the steps :

To Checked In login mode as registered users or not -

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

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.


thats it !!!

Thanks.....................

leesykes
DNN Creative Staff
Nuke Master III
Nuke Master III
Posts:3375

28 Aug 2008 3:11 AM  
thanks for posting info,

Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/leesykes

Lee Sykes's Facebook Profile
You are not authorized to post a reply.
Forums > DotNetNuke® > DotNetNuke® Questions > Only registered users can access some parts of the module



ActiveForums 3.7

Latest Forum Posts

Restricting DateEditControl till date by coder247
Hi All,   We are using the DateEditControl (for obvious reasons!!) in our application. But we want t...
RE: Email Set UP per Portal by jncraig
I think that the answer depends on how email is configured at your host. You'll probably have to co...
RE: skin/container error load by jncraig
I would suggest checking permissions for directories. Does this occur only when you upload a skin...
RE: Add New Profile Properties by jncraig
Hmmm ... I don't have an answer. Does anyone else?
RE: No Access for me too by ristori
it is ok now. Thanks for this action.
skin/container error load by islandman
Has anyone else run across this error when loading skins or containers from site settings?I am using...
Email Set UP per Portal by islandman
How do I set up a unique email address per domain name off 1 hosting environment. for example...m...
RE: localhost Install issues by cdees
Lee: I wanted to follow up on this for anyone following this thread. I have been unable to solve t...
RE: Add New Profile Properties by WSI
HI Joe, The DNN version is 4.5.5. Thanks, Cliff
Change Skin on URL by vinita
Hi,Can the skin be changed based on the url used to access a portal. Multiple portal aliases may be ...
problem creating child portal by kabamaro
  Hello all i have 4 Aliases for my parent portal , lets call them X,y,Z,WIn all Aliases i can creat...
problem creating child portal by kabamaro
  Hello all i have 4 Aliases for my parent portal , lets call them X,y,Z,WIn all Aliases i can creat...
Best DNN portal ever! by derpir
I have been a subscriber since august 2008, and DNNCreative.com is simply the best DNN Portal, their...
RE: skinning trouble by derpir
Hello Yes could you be so kind and take a look att the htm-file and css-file.I would be very gratef...
Search function is not working by kishorpawar
I am using Seach module in my project but not working, i have set   host setting alsoHost --> Schedu...
RE: backend is changing from sql2005 to sql2008 by leesykes
hello,There should not be any code changes needed, but you'll need to make sure that SQL 2008 upgrad...
RE: skinning trouble by leesykes
Hello,I would need to see your code to help you with this one, you can zip up your files and attach ...
RE: Installing DotNetNuke 4.9.00 on VWD 2005 w/ SQL server 2008 by leesykes
I have run a test with SQL Server 2008 express and DotNetNuke installed in exactly the the same way ...
RE: Issue 39 Interview by leesykes
thanks Bill, glad it was useful, we will have a think about the best way to approach this,Thanks,
RE: Issue 39 Authentication by leesykes
yes I have a live site in 4.9.0 at it seems stable as well.
AppTheory
RSS Feeds