aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/Local/LocalUserServices.cs
diff options
context:
space:
mode:
authorMW2007-08-11 11:59:51 +0000
committerMW2007-08-11 11:59:51 +0000
commit114807b9d1caeffad1f245982baa2c07e88ee470 (patch)
treef3a3ed3c24de47085192d7215a81ef25254fceda /OpenSim/Region/Communications/Local/LocalUserServices.cs
parentFew small fixes (diff)
downloadopensim-SC-114807b9d1caeffad1f245982baa2c07e88ee470.zip
opensim-SC-114807b9d1caeffad1f245982baa2c07e88ee470.tar.gz
opensim-SC-114807b9d1caeffad1f245982baa2c07e88ee470.tar.bz2
opensim-SC-114807b9d1caeffad1f245982baa2c07e88ee470.tar.xz
Made account Authentication optional in "sandbox/standalone" mode. Just change "standalone_authenticate = false" to be true in OpenSim.ini. Then as per grid mode, you can use the "create user" command to create new accounts.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Communications/Local/LocalUserServices.cs23
1 files changed, 19 insertions, 4 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index cc80c81..223c157 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -15,13 +15,15 @@ namespace OpenSim.Region.Communications.Local
15 private NetworkServersInfo serversInfo; 15 private NetworkServersInfo serversInfo;
16 private uint defaultHomeX ; 16 private uint defaultHomeX ;
17 private uint defaultHomeY; 17 private uint defaultHomeY;
18 private bool authUsers = false;
18 19
19 public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo) 20 public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo, bool authenticate)
20 { 21 {
21 m_Parent = parent; 22 m_Parent = parent;
22 this.serversInfo = serversInfo; 23 this.serversInfo = serversInfo;
23 defaultHomeX = this.serversInfo.DefaultHomeLocX; 24 defaultHomeX = this.serversInfo.DefaultHomeLocX;
24 defaultHomeY = this.serversInfo.DefaultHomeLocY; 25 defaultHomeY = this.serversInfo.DefaultHomeLocY;
26 this.authUsers = authenticate;
25 } 27 }
26 28
27 public UserProfileData GetUserProfile(string firstName, string lastName) 29 public UserProfileData GetUserProfile(string firstName, string lastName)
@@ -68,9 +70,22 @@ namespace OpenSim.Region.Communications.Local
68 70
69 public override bool AuthenticateUser(UserProfileData profile, string password) 71 public override bool AuthenticateUser(UserProfileData profile, string password)
70 { 72 {
71 //for now we will accept any password in sandbox mode 73 if (!authUsers)
72 Console.WriteLine("authorising user"); 74 {
73 return true; 75 //for now we will accept any password in sandbox mode
76 Console.WriteLine("authorising user");
77 return true;
78 }
79 else
80 {
81 Console.WriteLine( "Authenticating " + profile.username + " " + profile.surname);
82
83 password = password.Remove(0, 3); //remove $1$
84
85 string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
86
87 return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
88 }
74 } 89 }
75 90
76 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser) 91 public override void CustomiseResponse(LoginResponse response, UserProfileData theUser)