Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Show Current Users?

  Asked By: Christopher    Date: Aug 31    Category: Sharepoint    Views: 1027

i have created my own site definition for WSS2003. I am currently
modifying the contents and zones of the default.aspx. Is there a way
to show the currently logged in user so that we can display "Welcome

We are also planning to hide the "Home Documents and Setting
Create..." toolbar so that only administrators can access them.

by the way, we don't have frontpage so i can only edit the codes
on .net or notepad.

Any help?



2 Answers Found

Answer #1    Answered By: Doris Leach     Answered On: Aug 31

you can create either a WebPart or server control to achieve

The code looks like this:

Microsoft.SharePoint.SPWeb web =
Microsoft.SharePoint.WebControls.SPControl.GetContextWeb (this.Context

String name= web.CurrentUser.LoginName ;

Once you create a WebPart or server control and have added it to the
web.config, you are free to add it to the template like any other
WebPart or server control.

Answer #2    Answered By: Sumitra 2004     Answered On: Aug 31

How do i get the user's role i.e. if he is and adminnistrator or not.

Didn't find what you were looking for? Find more on Show Current Users? Or get search suggestion and latest updates.