Skip to main content
jP_web_icon

Examples

Go Search
Home
  
Examples > src > jPUserProfile  

Web Part Page Title Bar image
jPUserProfile

 jP.UserProfile

 Description

The jPoint.userprofile plugin retrieves the current user profile and make information available through the jPoint object model.
 
Sign In as
 
username:
demouser
password:
sharejPoint!
Information is based on the content from /_layouts/userdisp.aspx

Usage:

Initialize UserProfile

  • jP.getUserProfile();     //read userdisp.aspx, then populate and return jP.UserProfile object

Access profile data with

  • jP.UserProfile.Name
  • jP.UserProfile.Account
  • jP.UserProfile.Title
  • jP.UserProfile.EMail
  • jP.UserProfile.Notes
  • jP.UserProfile.AboutMe
  • jP.UserProfile.Picture
  • jP.UserProfile.Department
  • jP.UserProfile.JobTitle
  • jP.UserProfile.SipAddress
  • jP.UserProfile.SIPAddress
  • jP.UserProfile.FieldCount  //count of fields
  • jP.UserProfile.Fields  //array of field names
  • jP.UserProfile.Items[0].Name ... SipAddress
Source Code in CEWP above:
 
<script src="http://sharejpoint.googlecode.com/files/jPointLoader.js"></script>
<script src="http://www.sharejpoint.com/src/jpoint/plugins/jPoint.userprofile.js"></script>
<div id=outdiv />
<script>
$(document).ready(function(){
  var user = jP.getUserProfile();
  if(!user) {alert("User not found. Please sign in!"); return;}
  var out = "";
  out += "<b>The current login user account is <font color=red>"+user.Account+"</font></b>"
  out += "<table>";
  out += "<tr><th>Field Name</th><th>Field Value</th><th>jPoint Code</th></tr>";
  $.each(user.Fields, function(i, field){
    out += "<tr><td>"+field+"</td><td>"+user[field]+"</td><td>jP.UserProfile."+field+"</td></tr>";
  });
  out += "</table>";
  $("#outdiv").html(out);
});
</script>