Hi strikingknife,
In you chat provider, you have the below code. In this method we provide the "loginName" for you to get the user, so please do not use the current user string LoginName = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString(); to get the user info.
Try change
SPUser mSPUser = mWeb.AllUsers[LoginName];
To
SPUser mSPUser = mWeb.AllUsers[loginName];
- public override bool GetUserInfo(string loginName, ref string nickName, ref bool isAdmin)
- {
- bool User = false;
- string NickName = string.Empty;
- string LoginName = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();
- bool Admin = false;
- SPSecurity.RunWithElevatedPrivileges(delegate()
- {
- using (SPSite mSite = new SPSite(GetCurrentSiteURL()))
- {
- using (SPWeb mWeb = mSite.OpenWeb())
- {
- SPUser mSPUser = mWeb.AllUsers[LoginName];
- if (mSPUser == null)
- {
- User = false;
- }
-
- if (mSPUser.IsSiteAdmin == true)
- {
- Admin = true;
- }
-
- User = true;
- NickName = Convert.ToString(mSPUser.Name);
-
- }
- }
- });
-
- nickName = NickName;
- isAdmin = Admin;
- return User;
-
- }
Regards,
Ken