aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2010-01-10 01:46:56 +0000
committerMelanie2010-01-10 01:46:56 +0000
commit7403f2fd366cc96cd65ba95d7fba68dce1846982 (patch)
treed96022c04cb73cd8da0a57fe6c96589ada2819a0 /OpenSim/Region
parentFinally the region service config stuff is in. (diff)
parent* Moved command reset password from OpenSim to UserAccountService. (diff)
downloadopensim-SC_OLD-7403f2fd366cc96cd65ba95d7fba68dce1846982.zip
opensim-SC_OLD-7403f2fd366cc96cd65ba95d7fba68dce1846982.tar.gz
opensim-SC_OLD-7403f2fd366cc96cd65ba95d7fba68dce1846982.tar.bz2
opensim-SC_OLD-7403f2fd366cc96cd65ba95d7fba68dce1846982.tar.xz
Merge branch 'presence-refactor' of melanie@opensimulator.org:/var/git/opensim into presence-refactor
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs121
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs5
2 files changed, 5 insertions, 121 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 82b2fd4..31cc610 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -347,16 +347,6 @@ namespace OpenSim
347 "kill uuid <UUID>", 347 "kill uuid <UUID>",
348 "Kill an object by UUID", KillUUID); 348 "Kill an object by UUID", KillUUID);
349 349
350 if (ConfigurationSettings.Standalone)
351 {
352 m_console.Commands.AddCommand("region", false, "create user",
353 "create user [<first> [<last> [<pass> [<x> <y> [<email>]]]]]",
354 "Create a new user", HandleCreateUser);
355
356 m_console.Commands.AddCommand("region", false, "reset user password",
357 "reset user password [<first> [<last> [<password>]]]",
358 "Reset a user password", HandleResetUserPassword);
359 }
360 350
361 m_console.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>", 351 m_console.Commands.AddCommand("hypergrid", false, "link-mapping", "link-mapping [<x> <y>] <cr>",
362 "Set local coordinate to map HG regions to", RunCommand); 352 "Set local coordinate to map HG regions to", RunCommand);
@@ -812,37 +802,6 @@ namespace OpenSim
812 m_console.ConsoleScene = m_sceneManager.CurrentScene; 802 m_console.ConsoleScene = m_sceneManager.CurrentScene;
813 } 803 }
814 804
815 /// <summary>
816 /// Execute switch for some of the create commands
817 /// </summary>
818 /// <param name="args"></param>
819 private void HandleCreateUser(string module, string[] cmd)
820 {
821 if (ConfigurationSettings.Standalone)
822 {
823 CreateUser(cmd);
824 }
825 else
826 {
827 m_log.Info("Create user is not available in grid mode, use the user server.");
828 }
829 }
830
831 /// <summary>
832 /// Execute switch for some of the reset commands
833 /// </summary>
834 /// <param name="args"></param>
835 protected void HandleResetUserPassword(string module, string[] cmd)
836 {
837 if (ConfigurationSettings.Standalone)
838 {
839 ResetUserPassword(cmd);
840 }
841 else
842 {
843 m_log.Info("Reset user password is not available in grid mode, use the user-server.");
844 }
845 }
846 805
847 /// <summary> 806 /// <summary>
848 /// Turn on some debugging values for OpenSim. 807 /// Turn on some debugging values for OpenSim.
@@ -1076,86 +1035,6 @@ namespace OpenSim
1076 } 1035 }
1077 1036
1078 /// <summary> 1037 /// <summary>
1079 /// Create a new user
1080 /// </summary>
1081 /// <param name="cmdparams">string array with parameters: firstname, lastname, password, locationX, locationY, email</param>
1082 protected void CreateUser(string[] cmdparams)
1083 {
1084 string firstName;
1085 string lastName;
1086 string password;
1087 string email;
1088 uint regX = 1000;
1089 uint regY = 1000;
1090
1091 IConfig standalone;
1092 if ((standalone = m_config.Source.Configs["StandAlone"]) != null)
1093 {
1094 regX = (uint)standalone.GetInt("default_location_x", (int)regX);
1095 regY = (uint)standalone.GetInt("default_location_y", (int)regY);
1096 }
1097
1098
1099 if (cmdparams.Length < 3)
1100 firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
1101 else firstName = cmdparams[2];
1102
1103 if (cmdparams.Length < 4)
1104 lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
1105 else lastName = cmdparams[3];
1106
1107 if (cmdparams.Length < 5)
1108 password = MainConsole.Instance.PasswdPrompt("Password");
1109 else password = cmdparams[4];
1110
1111 if (cmdparams.Length < 6)
1112 regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString()));
1113 else regX = Convert.ToUInt32(cmdparams[5]);
1114
1115 if (cmdparams.Length < 7)
1116 regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString()));
1117 else regY = Convert.ToUInt32(cmdparams[6]);
1118
1119 if (cmdparams.Length < 8)
1120 email = MainConsole.Instance.CmdPrompt("Email", "");
1121 else email = cmdparams[7];
1122
1123 if (null == m_commsManager.UserProfileCacheService.GetUserDetails(firstName, lastName))
1124 {
1125 m_commsManager.UserAdminService.AddUser(firstName, lastName, password, email, regX, regY);
1126 }
1127 else
1128 {
1129 m_log.ErrorFormat("[CONSOLE]: A user with the name {0} {1} already exists!", firstName, lastName);
1130 }
1131 }
1132
1133 /// <summary>
1134 /// Reset a user password.
1135 /// </summary>
1136 /// <param name="cmdparams"></param>
1137 private void ResetUserPassword(string[] cmdparams)
1138 {
1139 string firstName;
1140 string lastName;
1141 string newPassword;
1142
1143 if (cmdparams.Length < 4)
1144 firstName = MainConsole.Instance.CmdPrompt("First name");
1145 else firstName = cmdparams[3];
1146
1147 if (cmdparams.Length < 5)
1148 lastName = MainConsole.Instance.CmdPrompt("Last name");
1149 else lastName = cmdparams[4];
1150
1151 if (cmdparams.Length < 6)
1152 newPassword = MainConsole.Instance.PasswdPrompt("New password");
1153 else newPassword = cmdparams[5];
1154
1155 m_commsManager.UserAdminService.ResetUserPassword(firstName, lastName, newPassword);
1156 }
1157
1158 /// <summary>
1159 /// Use XML2 format to serialize data to a file 1038 /// Use XML2 format to serialize data to a file
1160 /// </summary> 1039 /// </summary>
1161 /// <param name="module"></param> 1040 /// <param name="module"></param>
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs
index 4c65722..acc362b 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs
@@ -153,6 +153,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication
153 return m_AuthenticationService.Release(principalID, token); 153 return m_AuthenticationService.Release(principalID, token);
154 } 154 }
155 155
156 public bool SetPassword(UUID principalID, string passwd)
157 {
158 return m_AuthenticationService.SetPassword(principalID, passwd);
159 }
160
156 #endregion 161 #endregion
157 162
158 } 163 }