Hide "User" link for Site / Site Collection Reports
This may sound like an odd question, but may make perfect sense in a certain context nevertheless:
What is the easiest way to hide the "User" link from the Site Reports / Site Collection Reports pages?
Here's what we came up with:
1. Rename the following files:
SpUsageSiteUsers.aspx ⇒ SpUsageSiteUsers_renamed.aspx
SpUsageWebUsers.aspx ⇒ SpUsageWebUsers_renamed.aspx
2. Add the following code section at the end of the application.master page:
</BODY>
<!-- customization start -->
<script>
function Hide_FromSite() {
if (document.getElementById('ctl00_PlaceHolderLeftNavBar_QuickLaunchMenun3'))
document.getElementById('ctl00_PlaceHolderLeftNavBar_QuickLaunchMenun3').style.display = "none";
else
Hide_FromSite();
}
if (document.location.href.indexOf ('/_layouts/SpUsageWeb.aspx') != -1)
Hide_FromSite();
if (document.location.href.indexOf ('/_layouts/SpUsageSite.aspx') != -1)
Hide_FromSite();
</script>
<!-- customization end -->
</HTML>
The following links may be of additional interest in case you may want to do this customization:
https://support.microsoft.com/kb/944105
https://blogs.msdn.com/uksharepoint/archive/2009/06/19/modifying-out-of-the-box-sharepoint-files.aspx
https://msdn.microsoft.com/en-us/library/bb803457.aspx