#17091: Fixed user with an empty username can be created by command line (causing YSOD in dashboard).

Work Item: 17091
This commit is contained in:
jasperd
2013-12-20 01:43:14 +01:00
committed by Sebastien Ros
parent 71c5cae927
commit a5210cad47

View File

@@ -30,6 +30,11 @@ namespace Orchard.Users.Commands {
[CommandHelp("user create /UserName:<username> /Password:<password> /Email:<email>\r\n\t" + "Creates a new User")]
[OrchardSwitches("UserName,Password,Email")]
public void Create() {
if (string.IsNullOrWhiteSpace(UserName)) {
Context.Output.WriteLine(T("Username cannot be empty."));
return;
}
if (!_userService.VerifyUserUnicity(UserName, Email)) {
Context.Output.WriteLine(T("User with that username and/or email already exists."));
return;