0

Along with the thumbnail photo, I may want to display other properties in my master pages that are imported from AD such as "company" using User Profile sync

If I use SPServices.SPGetCurrentUser() (https://spservices.codeplex.com/documentation), I can get selected properties held in user profile settings. However, I can't make this call since the property does not exist here (yet).

 var company = $().SPServices.SPGetCurrentUser({
fieldName: "Company",
 debug: false
});

It is however, is displayed both in http://mysite.mydomain.com/_layouts/EditProfile.aspx when in Mysite and _layouts/ProfAdminEdit.aspx (Edit user properties in Central Admin). I guess my question is then to be able to use SPServices, do I somehow edit the default properties and include my "Company" attribute held in the user' mysite profile? Alternatively, is there another way to access the properties held in the user profile with JavaScript ?

Thanks

Daniel

4

1 回答 1

0

$().SPServices.SPGetCurrentUser 调用此页面:http://you.site.com/_layouts/userdisp.aspx?Force=True&1376982818371。对我来说,该函数无法正确解析页面,但您可以简单地使用 jQuery(或纯 JS 或其他)自己获取相同的页面,然后解析它以找到您想要的数据。

否则,您可以使用$SP().people()查询用户配置文件服务并获取用户的信息。请参阅提供的链接中的示例。从理论上讲,这应该会返回相同的信息甚至更多信息。

于 2013-08-20T07:19:57.030 回答