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

Forum

Subject: How to Hide Register Link in User Login module
Prev Next
You are not authorized to post a reply.

Author Messages
aliasncnu
Nuke Newbie
Nuke Newbie
Posts:6

06 Dec 2007 9:45 PM  

Hi,
I place a User Account module on my homepage. How can I hide the Register Link upon it?
Someone told me to remove the in my skin should work well. But after making a experiment, it seems not working for DNN 4.7.

Finally, I found under admin/Authentication/ there is a Login.ascx. I comment the markup
    

and register link is hidden.

is there any more flexibile way to achieve instead modifying the DNN core?

Regards,
Ricky.

Joseph Craig
DNN Creative Staff
Nuke Master V
Nuke Master V
Posts:5326


07 Dec 2007 9:28 AM  
You will find some code similar to these in your skins:

               < dnn:USER runat="server" id="dnnUSER" / >
               < dnn:LOGIN runat="server" id="dnnLOGIN" / >

The first on displays Register/DisplayName and the second displays Login/Logout.  You can remove either or both of these from a skin.

If you are interested in some possibilities for conditionally including these or other items in your skin or pages, take a look at this thread in the Snapsis.com.

I've use techniques found in that thread on a site that I run.  The USER and LOGIN controls aren't displayed when the site is viewed by an unauthenticated visitor.  Instead, they see the Login module (visibility controlled by Security Role).  When a user logs in, the Login module disappears and the USER and LOGIN links, as well as some other stuff) is shown in the upper right.  Turning USER and LOGIN on and off is accomplished with conditional code in the skin.

Joe Craig
DNN Creative Support
Subscribe to the website
tlyczko
Nuke Ace
Nuke Ace
Posts:41

07 Dec 2007 1:02 PM  
I figured it out partway from a post in that thread, this pseudocode is what one needs in the ascx file instead of the standard call to the USER token:

<%=IIf(Request.IsAuthenticated, "Show the user name", "")%>

How would one code showing the username within this IIf statement??

Thanks, Tom
Joseph Craig
DNN Creative Staff
Nuke Master V
Nuke Master V
Posts:5326


07 Dec 2007 4:24 PM  
Here is some code that I have used:

            < %  If DotNetNuke.Security.PortalSecurity.IsInRole("Registered Users")  Then% >
                < td align="right" height="100%" style="width: 100%"  >
                    < div id="LoginUserContainer" >
                        < dnn:User cssclass="BannerLinks" runat="server" id="dnnUser" url="" / >  
                    
                        < %  If DotNetNuke.Security.PortalSecurity.IsInRole("Registered Users") % > 
                
                               user code goes in here!

                        < % End If % >
                       
                                              
                        < dnn:Login runat="server" cssclass="BannerLinks" id="dnnLogin" / >                       
                    < /div >
                < /td >         
             < % End If % >


Maybe this will give you some ideas.

Joe Craig
DNN Creative Support
Subscribe to the website
tlyczko
Nuke Ace
Nuke Ace
Posts:41

07 Dec 2007 7:00 PM  
Use this code, I got it from John Mitchell at Snapsis, we went back and forth a bit on it.

<% If NOT Request.IsAuthenticated Then dnnUser.Visible = "false" %>

The user control must not be commented out.

http://www.snapsis.com/Support/DotNetNukeSupport/tabid/560/forumid/12/tpage/3/view/topic/postid/5003/Default.aspx#7894, this goes to page three of the thread for this specific stuff, though there's other useful things in too.

This will display "Login" only for non-authenticated users, and the User Name for authenticated users, such as host, admin, people in site/portal-based roles.

I put this in my SKIN only -- not anywhere else.

See also: http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/12/threadid/165067/scope/posts/Default.aspx

See also:
http://www.snapsis.com/DNN-Tips-And-Tricks/tabid/560/forumid/12/postid/7893/view/topic/Tip--Change-DNN-system-text-labels.aspx

The first one is in the Admin panel of the host/portal and is site-wide for not showing user registration.
The second one is for editing language files etc.

HTH Tom
aliasncnu
Nuke Newbie
Nuke Newbie
Posts:6

09 Dec 2007 6:52 PM  

I am not sure whether this workaround is goes well in previous versions, but for 4.7.x this should not work. See the reply in http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/108/threadid/184743/scope/posts/threadpage/1/Default.aspx by Bilal Al-Ghazi. Of course, I am uncetain whether it is correct!

Now, I must comment asp:Linkbutton id="cmdRegister" resourcekey="cmdRegister" cssclass="CommandButton" text="Register" runat="server"/ within admin/authentication/Login.ascx to hide the link.

Any suggestion is welcome.

Regards,
Ricky.

Lee Sykes
DNN Creative Staff
Nuke Master V
Nuke Master V
Posts:5287


10 Dec 2007 3:21 AM  
Posted By aliasncnu on 06 Dec 2007 9:45 PM

Hi,
I place a User Account module on my homepage. How can I hide the Register Link upon it?


There is a much easier way to remove the Register link from the account module and the skin.

go to the admin menu/site settings
advanced settings
security settings
under 'user registration' select none

Thanks,


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 > How to Hide Register Link in User Login module



ActiveForums 3.7

Latest Forum Posts

Module Advanced Setting by booth
I need to understand the operation of the “Display Module On All Pages ” control on the setting page...
Efficient Contacts Manager by etadmin
Currently I'm using the Forms and List module, it has about 1500 contacts and 40-50 fields per conta...
RE: How to do links? by leesykes
I think the easiest way to set this up would be to use the default NAV Menu that comes with DNN. It ...
RE: DataSprings / Aweber by leesykes
Yes you probably used an IFrame over a HTML file which included the form, IFrame still exists.Here i...
RE: ITextSharp by leesykes
thanks for the info
RE: Change Registration Redirect? by leesykes
and for the Aweber section you should be able to setup a Form completion event on that form which se...
RE: Creating Portals before setting the host by jncraig
You shouldn't have to delete and recreate. The internal (to DotNetNuke) addressing is handled by th...
RE: Creating Portals before setting the host by cyborama
I think I have figured out the answer myself. In my host is something called A Records. This is equ...
RE: Saving site settings error by jncraig
When you say that you "published" the site, do you mean published from within Visual Studio?I'd reco...
RE: Regular Expression by jncraig
Google for "Regular Expression Library" and search around. You should be able to find something tha...
RE: Change Registration Redirect? by jncraig
Dynamic Registration will permit you to use a "redirect after login" page.
RE: Removing View and Edit Buttons by jncraig
Most likely, the View and Edit buttons are there because either the page or a module on it has edit ...
RE: Removing View and Edit Buttons by jumatthey
o.O ... weird. This should only display if you are logged on as admin or host.
RE: Removing View and Edit Buttons by mikehj
I was able to remove the register in admin settings and I had already gone into the skins file and m...
RE: Removing View and Edit Buttons by jumatthey
Can you post a screeshot of what you are refering to more precisely ? Thanks. I personnaly remove...
Regular Expression by jumatthey
Hey all.I need to find out a regular expression for a DotNetNuke module I am building.This is my ASP...
RE: ITextSharp by jumatthey
The key line was this one : PdfWriter.GetInstance(document, new FileStream(HttpContext.Current.Se...
Removing View and Edit Buttons by mikehj
I have removed the Register and Login controls from the default page. I still have the Edit and Vie...
Saving site settings error by directaccess
Hey folks, Recently started looking at DNN. And did some nice tests out of VisualStudio using the...
RE: Change Registration Redirect? by ollep
Then again, I have a problem leaving things too simple. I will link to Aweber, most likely u...
DNN Creative Subscribe
RSS Feeds