How to Hide Register Link in User Login module
Last Post 12/10/2007 3:21 AM by Lee Sykes. 6 Replies.
Author Messages
aliasncnu
Nuke Newbie
Nuke Newbie
Posts:6


--

      <td id="tdRegister" runat="server" colspan="2" align="left"><asp:Linkbutton id="cmdRegister" resourcekey="cmdRegister" cssclass="CommandButton" text="Register" runat="server"/>
     -->

and register link is hidden.

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

Regards,
Ricky.

12/06/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 <dnn:USER runat="server" id="dnnUSER" /> 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
     <!--

Joseph Craig
DNN MVP
Posts:11667


--
12/07/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, Patapsco Research Group
Complete DNN Support
tlyczko
Nuke Ace
Nuke Ace
Posts:41


--
12/07/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 MVP
Posts:11667


--
12/07/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, Patapsco Research Group
Complete DNN Support
tlyczko
Nuke Ace
Nuke Ace
Posts:41


--
12/07/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" %><dnn:USER runat="server" id="dnnUSER" CssClass="SkinItem" />

The user control must not be commented out.

http://www.snapsis.com/Support/DotN...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...fault.aspx

See also:
http://www.snapsis.com/DNN-Tips-And...abels.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


--
12/09/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...fault.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 VI
Nuke Master VI
Posts:4945


--
12/10/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/DNNCreative

Lee Sykes's Facebook Profile


---