Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WSS Site, how to hide the Create and SiteSettings buttons

Status
Not open for further replies.

DotNetNewbie

Programmer
Mar 3, 2004
344
GB
Hi there,

I've made a series of WSS sites and would like to hide or even remove the Create and Site Settings buttons. I think ideally id like to create an Admin site and have all the links located there, however im interested to know the best way to do that as I have about 30+ subsites and each have a Create and Site Settings button.

Many thanks in advance

D.
 
Hi D.,

I believe that once you made the site you have to remove the buttons manually from each page. And i recommend to replace the links with a webpart some where on the page.

Webpart example:
Code:
SiteCollection = new SPSite(<servername>);
SPWeb Web = SiteCollection.OpenWeb(*);
//* make a function that always looks up the current (sub)site

if (Web.Permissions.DoesUserHavePermissions(SPRights.ManageWeb) == true)
{	
   text += "<table border='0'><tr><td><hr></td></tr>"
   + "<tr><td><a href=\"_layouts/1043/settings.aspx\">Site-settings</a></td></tr>"
   + "<tr><td><a href=\"_layouts/1043/create.aspx\">Create</a></td></tr>"
   + "<tr><td><hr></td></tr></table>";

}

output.Write(text);

And for you new sites make site templates where the links are already removed and the webpart is already placed.


Greetings ChaserNL


BTW. this code does not require any more than readers rights to execute, so no impersonation needed!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top