aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Console
diff options
context:
space:
mode:
authorrandomhuman2010-09-05 21:44:46 +0100
committerJustin Clark-Casey (justincc)2010-09-10 23:19:18 +0100
commit30306a775af74e1fe080590998a71a4c7e64ad12 (patch)
treee1fc438132054d2b43cd6ff8ee133219bafad1dd /OpenSim/Framework/Console
parentMerge branch 'prebuild-update' (diff)
downloadopensim-SC_OLD-30306a775af74e1fe080590998a71a4c7e64ad12.zip
opensim-SC_OLD-30306a775af74e1fe080590998a71a4c7e64ad12.tar.gz
opensim-SC_OLD-30306a775af74e1fe080590998a71a4c7e64ad12.tar.bz2
opensim-SC_OLD-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')
-rwxr-xr-xOpenSim/Framework/Console/ConsoleBase.cs51
-rw-r--r--OpenSim/Framework/Console/LocalConsole.cs5
2 files changed, 54 insertions, 2 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)
diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs
index a3036d0..c968031 100644
--- a/OpenSim/Framework/Console/LocalConsole.cs
+++ b/OpenSim/Framework/Console/LocalConsole.cs
@@ -461,7 +461,8 @@ namespace OpenSim.Framework.Console
461 SetCursorLeft(0); 461 SetCursorLeft(0);
462 y = SetCursorTop(y); 462 y = SetCursorTop(y);
463 463
464 System.Console.WriteLine("{0}{1}", prompt, cmdline); 464 System.Console.WriteLine();
465 //Show();
465 466
466 lock (cmdline) 467 lock (cmdline)
467 { 468 {
@@ -486,7 +487,7 @@ namespace OpenSim.Framework.Console
486 } 487 }
487 } 488 }
488 489
489 AddToHistory(cmdline.ToString()); 490 //AddToHistory(cmdline.ToString());
490 return cmdline.ToString(); 491 return cmdline.ToString();
491 default: 492 default:
492 break; 493 break;