diff options
author | randomhuman | 2010-09-05 21:44:46 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-09-10 23:19:18 +0100 |
commit | 30306a775af74e1fe080590998a71a4c7e64ad12 (patch) | |
tree | e1fc438132054d2b43cd6ff8ee133219bafad1dd /OpenSim/Framework/Console/ConsoleBase.cs | |
parent | Merge branch 'prebuild-update' (diff) | |
download | opensim-SC-30306a775af74e1fe080590998a71a4c7e64ad12.zip opensim-SC-30306a775af74e1fe080590998a71a4c7e64ad12.tar.gz opensim-SC-30306a775af74e1fe080590998a71a4c7e64ad12.tar.bz2 opensim-SC-30306a775af74e1fe080590998a71a4c7e64ad12.tar.xz |
Made it impossible to create a user with names containing spaces and prevented passwords from being echoed after enter is pressed.
Diffstat (limited to 'OpenSim/Framework/Console/ConsoleBase.cs')
-rwxr-xr-x | OpenSim/Framework/Console/ConsoleBase.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index aab920b..22ce880 100755 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs | |||
@@ -89,6 +89,57 @@ namespace OpenSim.Framework.Console | |||
89 | 89 | ||
90 | return ret; | 90 | return ret; |
91 | } | 91 | } |
92 | |||
93 | public string CmdPrompt(string p, List<char> excludedCharacters) | ||
94 | { | ||
95 | bool itisdone = false; | ||
96 | string ret = String.Empty; | ||
97 | while (!itisdone) | ||
98 | { | ||
99 | itisdone = true; | ||
100 | ret = CmdPrompt(p); | ||
101 | |||
102 | foreach (char c in excludedCharacters) | ||
103 | { | ||
104 | if (ret.Contains(c.ToString())) | ||
105 | { | ||
106 | System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); | ||
107 | itisdone = false; | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | |||
112 | return ret; | ||
113 | } | ||
114 | |||
115 | public string CmdPrompt(string p, string def, List<char> excludedCharacters) | ||
116 | { | ||
117 | bool itisdone = false; | ||
118 | string ret = String.Empty; | ||
119 | while (!itisdone) | ||
120 | { | ||
121 | itisdone = true; | ||
122 | ret = CmdPrompt(p, def); | ||
123 | |||
124 | if (ret == String.Empty) | ||
125 | { | ||
126 | ret = def; | ||
127 | } | ||
128 | else | ||
129 | { | ||
130 | foreach (char c in excludedCharacters) | ||
131 | { | ||
132 | if (ret.Contains(c.ToString())) | ||
133 | { | ||
134 | System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); | ||
135 | itisdone = false; | ||
136 | } | ||
137 | } | ||
138 | } | ||
139 | } | ||
140 | |||
141 | return ret; | ||
142 | } | ||
92 | 143 | ||
93 | // Displays a command prompt and returns a default value, user may only enter 1 of 2 options | 144 | // Displays a command prompt and returns a default value, user may only enter 1 of 2 options |
94 | public string CmdPrompt(string prompt, string defaultresponse, List<string> options) | 145 | public string CmdPrompt(string prompt, string defaultresponse, List<string> options) |