1. First Place one Login Control within a Master Page and Take IT's ID from the View Source of the Page.
2. Download the SPAPI_Core.JS File
3. Download the SPAPLI_UserGroup.JS File
var strSiteUrl="http://SPSERVER:100";
var objGroup=new SPAPI_UserGroup(strSiteUrl);
function checkAdminUser()
{
var strValidUser=false;
var strCurrentUser=$("#ctl00_lgnUser").html();
var ug1 = objGroup.getGroupCollectionFromUser(strCurrentUser);
$(ug1.responseXML).find("Group").each(function()
{
if($(this).attr("ID")==3)
{
strValidUser=true;
}
});
if(strValidUser==true)
{
alert('The User Logged is Admin User');
}
}
$(document).ready(function()
{
checkAdminUser();
});
No comments:
Post a Comment