Skip to content

Instantly share code, notes, and snippets.

@Sinetheta
Last active December 22, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sinetheta/6401627 to your computer and use it in GitHub Desktop.
Save Sinetheta/6401627 to your computer and use it in GitHub Desktop.
Exposing user data through javascript on a SharePoint 2010 master page.
<%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<SPSWC:ProfilePropertyLoader runat="server"/>
<script>
CurrentUser = {
UserName: '<SPSWC:ProfilePropertyValue PropertyName="UserName" TitleMode="true" runat="server" />',
FirstName: '<SPSWC:ProfilePropertyValue PropertyName="FirstName" TitleMode="true" runat="server" />',
Lastname: '<SPSWC:ProfilePropertyValue PropertyName="LastName" TitleMode="true" runat="server" />',
PictureURL: '<SPSWC:ProfilePropertyValue PropertyName="PictureURL" TitleMode="true" runat="server" />',
Status: '<SPSWC:ProfilePropertyValue PropertyName="SPS-StatusNotes" TitleMode="true" runat="server" />'
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment