This project is read-only.

User login display

Topics: Customizing Orchard, Writing themes
Jul 20, 2011 at 7:15 PM
Edited Jul 20, 2011 at 7:19 PM


What is the best way to hide the following markup generated from a custom theme (based on theme machine)?

Without just using CSS (display:none;) - is there something in the Views or Core for this?

<div class="user-display">
  <span class="user-actions"><a href="/Users/Account/LogOn?ReturnUrl=%2F">Sign In</a></span>


Just for security as showing the login on a public site will encourage hackers to have a go at breaking into the admin.

So users would have to access admin via http://localhost/Users/Account/LogOn?ReturnUrl=%2F  

So once logged in the user display should show.

<div class="user-display">
  <span class="user-actions welcome">
  Welcome, <strong><a href="/Users/Account/ChangePassword">admin</a></strong>!
  <span class="user-actions">
  <a href="/Users/Account/LogOff?ReturnUrl=%2F">Sign Out</a>
  <a href="/Admin">Dashboard</a>
Jul 20, 2011 at 8:44 PM

Well, you would really be fooling yourself by thinking that hiding a link will discourage hackers. But oh well, if you really want to do that (penalize your users by trying to deter the most incompetent hackers), you can have your own copy of User.cshtml (copied from Orchard.Core/Shapes/Views into your theme's Views folder) and customize that at will (removing everything from it if you want). Or you can go into layout.cshtml in your theme and remove the line that says WorkContext.Layout.Footer.Add(New.User(), "10");

Jul 21, 2011 at 11:24 AM

thanks and good point, prob leave the login as is - I will use some of the views in Orchard.Core/Shapes/Views anyway to override as needed.

The document.chtml in here is different from the one in SafeMode theme - should I use this instead?

It has extra code for html5.js and page title function I mentioned in an earlier post.

Jul 22, 2011 at 12:17 AM

Why are we talking about document.cshtml now?