aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/User
diff options
context:
space:
mode:
authorMelanie Thielker2009-06-30 21:48:03 +0000
committerMelanie Thielker2009-06-30 21:48:03 +0000
commit858b0a2efd4790042c3e248ce895a426462a2576 (patch)
tree2d9e9f61b5ca0219537e6debbcf75c703be52854 /OpenSim/Services/Connectors/User
parentFrom: Chris Yeoh <yeohc@au1.ibm.com> (diff)
downloadopensim-SC_OLD-858b0a2efd4790042c3e248ce895a426462a2576.zip
opensim-SC_OLD-858b0a2efd4790042c3e248ce895a426462a2576.tar.gz
opensim-SC_OLD-858b0a2efd4790042c3e248ce895a426462a2576.tar.bz2
opensim-SC_OLD-858b0a2efd4790042c3e248ce895a426462a2576.tar.xz
Updated services to allow external applications like web interfaces to
authenticate against the services. This paves the way for such apps to directly talk to services.
Diffstat (limited to 'OpenSim/Services/Connectors/User')
-rw-r--r--OpenSim/Services/Connectors/User/UserServiceConnector.cs60
1 files changed, 58 insertions, 2 deletions
diff --git a/OpenSim/Services/Connectors/User/UserServiceConnector.cs b/OpenSim/Services/Connectors/User/UserServiceConnector.cs
index 8b136b5..12afb29 100644
--- a/OpenSim/Services/Connectors/User/UserServiceConnector.cs
+++ b/OpenSim/Services/Connectors/User/UserServiceConnector.cs
@@ -133,15 +133,71 @@ namespace OpenSim.Services.Connectors
133 return data; 133 return data;
134 } 134 }
135 135
136 public bool SetUserData(UserData data) 136 public bool SetHomePosition(UserData data, UUID regionID, UUID regionSecret)
137 { 137 {
138 string uri = m_ServerURI + "/user/"; 138 string uri = m_ServerURI + "/user/";
139 bool result = false; 139 bool result = false;
140 140
141 UserDataMessage msg = new UserDataMessage();
142
143 msg.Data = data;
144 msg.RegionID = regionID;
145 msg.RegionSecret = regionSecret;
146
147 try
148 {
149 result = SynchronousRestObjectRequester.
150 MakeRequest<UserDataMessage, bool>("POST", uri, msg);
151 }
152 catch (Exception e)
153 {
154 m_log.WarnFormat("[USER CONNECTOR]: Unable to send request to user server. Reason: {1}", e.Message);
155 return false;
156 }
157
158 return result;
159 }
160
161 public bool SetUserData(UserData data, UUID principalID, UUID sessionID)
162 {
163 string uri = m_ServerURI + "/user/";
164 bool result = false;
165
166 UserDataMessage msg = new UserDataMessage();
167
168 msg.Data = data;
169 msg.PrincipalID = principalID;
170 msg.SessionID = sessionID;
171
172 try
173 {
174 result = SynchronousRestObjectRequester.
175 MakeRequest<UserDataMessage, bool>("POST", uri, msg);
176 }
177 catch (Exception e)
178 {
179 m_log.WarnFormat("[USER CONNECTOR]: Unable to send request to user server. Reason: {1}", e.Message);
180 return false;
181 }
182
183 return result;
184 }
185
186 public bool CreateUserData(UserData data, UUID principalID, UUID sessionID)
187 {
188 string uri = m_ServerURI + "/newuser/";
189 bool result = false;
190
191 UserDataMessage msg = new UserDataMessage();
192
193 msg.Data = data;
194 msg.PrincipalID = principalID;
195 msg.SessionID = sessionID;
196
141 try 197 try
142 { 198 {
143 result = SynchronousRestObjectRequester. 199 result = SynchronousRestObjectRequester.
144 MakeRequest<UserData, bool>("POST", uri, data); 200 MakeRequest<UserDataMessage, bool>("POST", uri, msg);
145 } 201 }
146 catch (Exception e) 202 catch (Exception e)
147 { 203 {