Last active
February 11, 2016 17:03
-
-
Save vman/4701670 to your computer and use it in GitHub Desktop.
Revisions
-
spfxadmin revised this gist
Mar 5, 2013 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,6 +21,9 @@ //Domain\Username of the user (If you are on SharePoint Online) var targetUser = "i:0#.f|membership|vardhaman@yoursite.onmicrosoft.com"; //If you are on On-Premise: //var targetUser = domain\\username //Create new instance of UserProfilePropertiesForUser var userProfilePropertiesForUser = new SP.UserProfiles.UserProfilePropertiesForUser(clientContext, targetUser, profilePropertyNames); userProfileProperties = peopleManager.getUserProfilePropertiesFor(userProfilePropertiesForUser); -
spfxadmin revised this gist
Feb 3, 2013 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,9 @@ SP.SOD.executeOrDelayUntilScriptLoaded(loadUserData, 'SP.UserProfiles.js'); }); var userProfileProperties = []; function loadUserData(){ //Get Current Context var clientContext = new SP.ClientContext.get_current(); @@ -40,8 +40,8 @@ } function onFail(sender, args) { alert("Error: " + args.get_message()); } })(jQuery); -
spfxadmin revised this gist
Feb 3, 2013 . 1 changed file with 30 additions and 33 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,47 +1,44 @@ (function($){ $(document).ready(function(){ // Ensure that the SP.UserProfiles.js file is loaded before the custom code runs. SP.SOD.executeOrDelayUntilScriptLoaded(loadUserData, 'SP.UserProfiles.js'); }); var userProfileProperties = []; function loadUserData(){ //Get Current Context var clientContext = new SP.ClientContext.get_current(); //Get Instance of People Manager Class var peopleManager = new SP.UserProfiles.PeopleManager(clientContext); //Properties to fetch from the User Profile var profilePropertyNames = ["PreferredName","PictureURL"]; //Domain\Username of the user (If you are on SharePoint Online) var targetUser = "i:0#.f|membership|vardhaman@yoursite.onmicrosoft.com"; //Create new instance of UserProfilePropertiesForUser var userProfilePropertiesForUser = new SP.UserProfiles.UserProfilePropertiesForUser(clientContext, targetUser, profilePropertyNames); userProfileProperties = peopleManager.getUserProfilePropertiesFor(userProfilePropertiesForUser); //Execute the Query. clientContext.load(userProfilePropertiesForUser); clientContext.executeQueryAsync(onSuccess, onFail); } function onSuccess() { var messageText = "\"Preffered Name\" property is " + userProfileProperties[0]; messageText += "\"PictureURL\" property is " + userProfileProperties[1]; alert(messageText); } function onFail(sender, args) { alert("Error: " + args.get_message()); -
spfxadmin revised this gist
Feb 3, 2013 . 1 changed file with 18 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,25 +10,25 @@ function loadUserData(){ //Get Current Context var clientContext = new SP.ClientContext.get_current(); //Get Instance of People Manager Class var peopleManager = new SP.UserProfiles.PeopleManager(clientContext); //Properties to fetch from the User Profile var profilePropertyNames = ["PreferredName","PictureURL"]; //Domain\Username of the user (If you are on SharePoint Online) var targetUser = "i:0#.f|membership|vardhaman@yoursite.onmicrosoft.com"; //Create new instance of UserProfilePropertiesForUser var userProfilePropertiesForUser = new SP.UserProfiles.UserProfilePropertiesForUser(clientContext, targetUser, profilePropertyNames); userProfileProperties = peopleManager.getUserProfilePropertiesFor(userProfilePropertiesForUser); //Execute the Query. clientContext.load(userProfilePropertiesForUser); clientContext.executeQueryAsync(onSuccess, onFail); } -
spfxadmin revised this gist
Feb 3, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,8 +27,8 @@ userProfileProperties = peopleManager.getUserProfilePropertiesFor(userProfilePropertiesForUser); //Execute the Query. clientContext.load(userProfilePropertiesForUser); clientContext.executeQueryAsync(onSuccess, onFail); } -
spfxadmin revised this gist
Feb 3, 2013 . 1 changed file with 9 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ (function($){ $(document).ready(function(){ // Ensure that the SP.UserProfiles.js file is loaded before the custom code runs. SP.SOD.executeOrDelayUntilScriptLoaded(loadUserData, 'SP.UserProfiles.js'); }); var userProfileProperties = []; @@ -20,17 +20,17 @@ var profilePropertyNames = ["PreferredName","PictureURL"]; //Domain\Username of the user (If you are on SharePoint Online) var targetUser = "i:0#.f|membership|vardhaman@yoursite.onmicrosoft.com"; //Create new instance of UserProfilePropertiesForUser var userProfilePropertiesForUser = new SP.UserProfiles.UserProfilePropertiesForUser(clientContext, targetUser, profilePropertyNames); userProfileProperties = peopleManager.getUserProfilePropertiesFor(userProfilePropertiesForUser); //Execute the Query. clientContext.load(userProfilePropertiesForUser); clientContext.executeQueryAsync(onSuccess, onFail); } function onSuccess() { -
spfxadmin revised this gist
Feb 3, 2013 . 1 changed file with 13 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ (function($){ $(document).ready(function(){ // Ensure that the SP.UserProfiles.js file is loaded before the custom code runs. SP.SOD.executeOrDelayUntilScriptLoaded(loadUserData, 'SP.UserProfiles.js'); }); @@ -10,23 +10,23 @@ function loadUserData(){ //Get Current Context var clientContext = new SP.ClientContext.get_current(); //Get Instance of People Manager Class var peopleManager = new SP.UserProfiles.PeopleManager(clientContext); //Properties to fetch from the User Profile var profilePropertyNames = ["PreferredName","PictureURL"]; //Domain\Username of the user (If you are on SharePoint Online) var targetUser = "i:0#.f|membership|vardhaman@yoursite.onmicrosoft.com"; //Create new instance of UserProfilePropertiesForUser var userProfilePropertiesForUser = new SP.UserProfiles.UserProfilePropertiesForUser(clientContext, targetUser, profilePropertyNames); userProfileProperties = peopleManager.getUserProfilePropertiesFor(userProfilePropertiesForUser); //Execute the Query. clientContext.load(userProfilePropertiesForUser); clientContext.executeQueryAsync(onSuccess, onFail); -
spfxadmin created this gist
Feb 3, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,50 @@ (function($){ $(document).ready(function(){ // Ensure that the SP.UserProfiles.js file is loaded before the custom code runs. SP.SOD.executeOrDelayUntilScriptLoaded(loadUserData, 'SP.UserProfiles.js'); }); var userProfileProperties = []; function loadUserData(){ //Get Current Context var clientContext = new SP.ClientContext.get_current(); //Get Instance of People Manager Class var peopleManager = new SP.UserProfiles.PeopleManager(clientContext); //Properties to fetch from the User Profile var profilePropertyNames = ["PreferredName","PictureURL"]; //Domain\Username of the user (If you are on SharePoint Online) var targetUser = "i:0#.f|membership|vardhaman@yoursite.onmicrosoft.com"; //Create new instance of UserProfilePropertiesForUser var userProfilePropertiesForUser = new SP.UserProfiles.UserProfilePropertiesForUser(clientContext, targetUser, profilePropertyNames); userProfileProperties = peopleManager.getUserProfilePropertiesFor(userProfilePropertiesForUser); //Execute the Query. clientContext.load(userProfilePropertiesForUser); clientContext.executeQueryAsync(onSuccess, onFail); } function onSuccess() { var messageText = "\"Preffered Name\" property is " + userProfileProperties[0]; messageText += "\"PictureURL\" property is " + userProfileProperties[1]; alert(messageText); } function onFail(sender, args) { alert("Error: " + args.get_message()); } })(jQuery);