|
|
@@ -104,6 +104,21 @@ func CreateUser(ctx *context.Context, form api.CreateUserOption) { |
|
|
} |
|
|
} |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
err := models.AddEmailAddress(&models.EmailAddress{ |
|
|
|
|
|
UID: u.ID, |
|
|
|
|
|
Email: form.Email, |
|
|
|
|
|
IsActivated: !setting.Service.RegisterEmailConfirm, |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
log.Error("AddEmailAddress failed:%v", err.Error(), ctx.Data["MsgID"]) |
|
|
|
|
|
ctx.JSON(http.StatusInternalServerError, map[string]string{ |
|
|
|
|
|
"error_msg": err.Error(), |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
log.Trace("Account created (%s): %s", ctx.User.Name, u.Name, ctx.Data["MsgID"]) |
|
|
log.Trace("Account created (%s): %s", ctx.User.Name, u.Name, ctx.Data["MsgID"]) |
|
|
|
|
|
|
|
|
// Send email notification. |
|
|
// Send email notification. |
|
|
|