aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/LLLoginService
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/LLLoginService')
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs30
1 files changed, 20 insertions, 10 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 2ca2d15..a5a728b 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -804,16 +804,13 @@ namespace OpenSim.Services.LLLoginService
804 // Old style: get the service keys from the DB 804 // Old style: get the service keys from the DB
805 foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) 805 foreach (KeyValuePair<string, object> kvp in account.ServiceURLs)
806 { 806 {
807 if (kvp.Value == null || (kvp.Value != null && kvp.Value.ToString() == string.Empty)) 807 if (kvp.Value != null)
808 {
809 aCircuit.ServiceURLs[kvp.Key] = m_LoginServerConfig.GetString(kvp.Key, string.Empty);
810 }
811 else
812 { 808 {
813 aCircuit.ServiceURLs[kvp.Key] = kvp.Value; 809 aCircuit.ServiceURLs[kvp.Key] = kvp.Value;
810
811 if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/"))
812 aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/";
814 } 813 }
815 if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/"))
816 aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/";
817 } 814 }
818 815
819 // New style: service keys start with SRV_; override the previous 816 // New style: service keys start with SRV_; override the previous
@@ -821,16 +818,29 @@ namespace OpenSim.Services.LLLoginService
821 818
822 if (keys.Length > 0) 819 if (keys.Length > 0)
823 { 820 {
821 bool newUrls = false;
824 IEnumerable<string> serviceKeys = keys.Where(value => value.StartsWith("SRV_")); 822 IEnumerable<string> serviceKeys = keys.Where(value => value.StartsWith("SRV_"));
825 foreach (string serviceKey in serviceKeys) 823 foreach (string serviceKey in serviceKeys)
826 { 824 {
827 string keyName = serviceKey.Replace("SRV_", ""); 825 string keyName = serviceKey.Replace("SRV_", "");
828 aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty); 826 string keyValue = m_LoginServerConfig.GetString(serviceKey, string.Empty);
829 if (!aCircuit.ServiceURLs[keyName].ToString().EndsWith("/")) 827 if (!keyValue.EndsWith("/"))
830 aCircuit.ServiceURLs[keyName] = aCircuit.ServiceURLs[keyName] + "/"; 828 keyValue = keyValue + "/";
829
830 if (!account.ServiceURLs.ContainsKey(keyName) || (account.ServiceURLs.ContainsKey(keyName) && account.ServiceURLs[keyName] != keyValue))
831 {
832 account.ServiceURLs[keyName] = keyValue;
833 newUrls = true;
834 }
835 aCircuit.ServiceURLs[keyName] = keyValue;
831 836
832 m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); 837 m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]);
833 } 838 }
839
840 // The grid operator decided to override the defaults in the
841 // [LoginService] configuration. Let's store the correct ones.
842 if (newUrls)
843 m_UserAccountService.StoreUserAccount(account);
834 } 844 }
835 845
836 } 846 }