This was needed for the prior commit.
parent
23c88c2f4d
commit
6204f23230
|
@ -26,6 +26,7 @@
|
|||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenMetaverse;
|
||||
|
@ -114,5 +115,28 @@ namespace OpenSim.Framework.Communications.Clients
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool VerifySession(string authurl, UUID userID, UUID sessionID)
|
||||
{
|
||||
Hashtable requestData = new Hashtable();
|
||||
requestData["avatar_uuid"] = userID.ToString();
|
||||
requestData["session_id"] = sessionID.ToString();
|
||||
ArrayList SendParams = new ArrayList();
|
||||
SendParams.Add(requestData);
|
||||
XmlRpcRequest UserReq = new XmlRpcRequest("check_auth_session", SendParams);
|
||||
XmlRpcResponse UserResp = UserReq.Send(authurl, 3000);
|
||||
|
||||
Hashtable responseData = (Hashtable)UserResp.Value;
|
||||
if (responseData.ContainsKey("auth_session") && responseData["auth_session"].ToString() == "TRUE")
|
||||
{
|
||||
System.Console.WriteLine("[Authorization]: userserver reported authorized session for user " + userID);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Console.WriteLine("[Authorization]: userserver reported unauthorized session for user " + userID);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue