mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user