Version

User.getUser

This method is used to get the SharePoint user information from a web’s URL. The site containing that web needs to be configured in SharePlus and already been accessed within the application at least once.

Syntax

SPlus.User.getUser (url, function (userProfile){
        var username = userProfile['loginName'];//Getting one of the user properties
        //TODO: Get more properties
        //TODO: Implement what to do with the user profile information
}, function (errorResponse){
        var error = errorResponse['error#displayValue']; //Getting the error
        //TODO: Implement how to handle errors
});

User.getUser Parameters

Parameter

Type

Description

url

String

URL to the SharePoint site.

onSuccess callback function

Parameter

Description

function (userProfile)

Success callback function to be implemented, which receives a JavaScript Object with the current SharePoint user properties. Retrieved properties depend entirely on the current user and may be a subset of the properties in the table below.

onError callback function

Parameter

Description

function (eResponse)

Error callback function to be implemented, which receives the eResponse JavaScript Object.

onCancel callback function

Parameter

Description

function (result)

Cancel callback function to be implemented.

For further details about the user properties, see the SPUser Properties MSDN topic.