2018-05-17 09:35:00 +05:30
|
|
|
// Copyright 2014 The Gogs Authors. All rights reserved.
|
|
|
|
// Copyright 2018 The Gitea Authors. All rights reserved.
|
2022-11-27 23:50:29 +05:30
|
|
|
// SPDX-License-Identifier: MIT
|
2018-05-17 09:35:00 +05:30
|
|
|
|
|
|
|
package setting
|
|
|
|
|
|
|
|
import (
|
2019-08-29 19:35:42 +05:30
|
|
|
"errors"
|
2021-04-05 21:00:52 +05:30
|
|
|
"net/http"
|
2021-01-18 02:18:38 +05:30
|
|
|
"time"
|
2019-08-29 19:35:42 +05:30
|
|
|
|
2018-05-17 09:35:00 +05:30
|
|
|
"code.gitea.io/gitea/models"
|
2021-11-11 12:33:30 +05:30
|
|
|
user_model "code.gitea.io/gitea/models/user"
|
2023-02-19 13:05:20 +05:30
|
|
|
"code.gitea.io/gitea/modules/auth/password"
|
2018-05-17 09:35:00 +05:30
|
|
|
"code.gitea.io/gitea/modules/base"
|
|
|
|
"code.gitea.io/gitea/modules/context"
|
|
|
|
"code.gitea.io/gitea/modules/log"
|
2024-02-04 18:59:09 +05:30
|
|
|
"code.gitea.io/gitea/modules/optional"
|
2018-05-17 09:35:00 +05:30
|
|
|
"code.gitea.io/gitea/modules/setting"
|
2019-08-15 20:16:21 +05:30
|
|
|
"code.gitea.io/gitea/modules/timeutil"
|
2021-01-26 21:06:53 +05:30
|
|
|
"code.gitea.io/gitea/modules/web"
|
2021-07-24 15:46:34 +05:30
|
|
|
"code.gitea.io/gitea/services/auth"
|
2021-04-07 01:14:05 +05:30
|
|
|
"code.gitea.io/gitea/services/forms"
|
2019-09-24 10:32:49 +05:30
|
|
|
"code.gitea.io/gitea/services/mailer"
|
2021-11-18 23:12:27 +05:30
|
|
|
"code.gitea.io/gitea/services/user"
|
2018-05-17 09:35:00 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
tplSettingsAccount base.TplName = "user/settings/account"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Account renders change user's password, user's email and user suicide page
|
|
|
|
func Account(ctx *context.Context) {
|
2023-02-02 04:26:10 +05:30
|
|
|
ctx.Data["Title"] = ctx.Tr("settings.account")
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.Data["PageIsSettingsAccount"] = true
|
2022-03-22 12:33:22 +05:30
|
|
|
ctx.Data["Email"] = ctx.Doer.Email
|
2022-06-27 22:29:47 +05:30
|
|
|
ctx.Data["EnableNotifyMail"] = setting.Service.EnableNotifyMail
|
2018-05-17 09:35:00 +05:30
|
|
|
|
2018-06-18 23:54:45 +05:30
|
|
|
loadAccountData(ctx)
|
2018-05-17 09:35:00 +05:30
|
|
|
|
2021-04-05 21:00:52 +05:30
|
|
|
ctx.HTML(http.StatusOK, tplSettingsAccount)
|
2018-05-17 09:35:00 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// AccountPost response for change user's password
|
2021-01-26 21:06:53 +05:30
|
|
|
func AccountPost(ctx *context.Context) {
|
2021-04-07 01:14:05 +05:30
|
|
|
form := web.GetForm(ctx).(*forms.ChangePasswordForm)
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.Data["Title"] = ctx.Tr("settings")
|
|
|
|
ctx.Data["PageIsSettingsAccount"] = true
|
|
|
|
|
|
|
|
if ctx.HasError() {
|
2018-06-18 23:54:45 +05:30
|
|
|
loadAccountData(ctx)
|
|
|
|
|
2021-04-05 21:00:52 +05:30
|
|
|
ctx.HTML(http.StatusOK, tplSettingsAccount)
|
2018-05-17 09:35:00 +05:30
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-02-04 18:59:09 +05:30
|
|
|
if ctx.Doer.IsPasswordSet() && !ctx.Doer.ValidatePassword(form.OldPassword) {
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.Flash.Error(ctx.Tr("settings.password_incorrect"))
|
|
|
|
} else if form.Password != form.Retype {
|
|
|
|
ctx.Flash.Error(ctx.Tr("form.password_not_match"))
|
|
|
|
} else {
|
2024-02-04 18:59:09 +05:30
|
|
|
opts := &user.UpdateAuthOptions{
|
|
|
|
Password: optional.Some(form.Password),
|
|
|
|
MustChangePassword: optional.Some(false),
|
2018-05-17 09:35:00 +05:30
|
|
|
}
|
2024-02-04 18:59:09 +05:30
|
|
|
if err := user.UpdateAuth(ctx, ctx.Doer, opts); err != nil {
|
|
|
|
switch {
|
|
|
|
case errors.Is(err, password.ErrMinLength):
|
|
|
|
ctx.Flash.Error(ctx.Tr("auth.password_too_short", setting.MinPasswordLength))
|
|
|
|
case errors.Is(err, password.ErrComplexity):
|
|
|
|
ctx.Flash.Error(password.BuildComplexityError(ctx.Locale))
|
|
|
|
case errors.Is(err, password.ErrIsPwned):
|
|
|
|
ctx.Flash.Error(ctx.Tr("auth.password_pwned"))
|
|
|
|
case password.IsErrIsPwnedRequest(err):
|
|
|
|
log.Error("%s", err.Error())
|
|
|
|
ctx.Flash.Error(ctx.Tr("auth.password_pwned_err"))
|
|
|
|
default:
|
|
|
|
ctx.ServerError("UpdateAuth", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
} else {
|
2023-11-22 21:56:21 +05:30
|
|
|
// Re-generate LTA cookie.
|
|
|
|
if len(ctx.GetSiteCookie(setting.CookieRememberName)) != 0 {
|
|
|
|
if err := ctx.SetLTACookie(ctx.Doer); err != nil {
|
|
|
|
ctx.ServerError("SetLTACookie", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Trace("User password updated: %s", ctx.Doer.Name)
|
2024-02-04 18:59:09 +05:30
|
|
|
ctx.Flash.Success(ctx.Tr("settings.change_password_success"))
|
2018-05-17 09:35:00 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
}
|
|
|
|
|
|
|
|
// EmailPost response for change user's email
|
2021-01-26 21:06:53 +05:30
|
|
|
func EmailPost(ctx *context.Context) {
|
2021-04-07 01:14:05 +05:30
|
|
|
form := web.GetForm(ctx).(*forms.AddEmailForm)
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.Data["Title"] = ctx.Tr("settings")
|
|
|
|
ctx.Data["PageIsSettingsAccount"] = true
|
|
|
|
|
|
|
|
// Make emailaddress primary.
|
2021-08-11 06:01:13 +05:30
|
|
|
if ctx.FormString("_method") == "PRIMARY" {
|
2023-09-14 22:39:32 +05:30
|
|
|
if err := user_model.MakeEmailPrimary(ctx, &user_model.EmailAddress{ID: ctx.FormInt64("id")}); err != nil {
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.ServerError("MakeEmailPrimary", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-03-22 12:33:22 +05:30
|
|
|
log.Trace("Email made primary: %s", ctx.Doer.Name)
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
return
|
|
|
|
}
|
2020-03-02 23:55:36 +05:30
|
|
|
// Send activation Email
|
2021-08-11 06:01:13 +05:30
|
|
|
if ctx.FormString("_method") == "SENDACTIVATION" {
|
2020-03-02 23:55:36 +05:30
|
|
|
var address string
|
2023-12-19 14:59:05 +05:30
|
|
|
if ctx.Cache.IsExist("MailResendLimit_" + ctx.Doer.LowerName) {
|
2020-03-02 23:55:36 +05:30
|
|
|
log.Error("Send activation: activation still pending")
|
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
return
|
|
|
|
}
|
2021-07-14 02:29:27 +05:30
|
|
|
|
2021-07-29 07:12:15 +05:30
|
|
|
id := ctx.FormInt64("id")
|
2023-09-14 22:39:32 +05:30
|
|
|
email, err := user_model.GetEmailAddressByID(ctx, ctx.Doer.ID, id)
|
2021-07-14 02:29:27 +05:30
|
|
|
if err != nil {
|
2022-03-22 12:33:22 +05:30
|
|
|
log.Error("GetEmailAddressByID(%d,%d) error: %v", ctx.Doer.ID, id, err)
|
2021-07-14 02:29:27 +05:30
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if email == nil {
|
2022-03-22 12:33:22 +05:30
|
|
|
log.Warn("Send activation failed: EmailAddress[%d] not found for user: %-v", id, ctx.Doer)
|
2021-07-14 02:29:27 +05:30
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if email.IsActivated {
|
2022-03-22 12:33:22 +05:30
|
|
|
log.Debug("Send activation failed: email %s is already activated for user: %-v", email.Email, ctx.Doer)
|
2021-07-14 02:29:27 +05:30
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
if email.IsPrimary {
|
2022-03-22 12:33:22 +05:30
|
|
|
if ctx.Doer.IsActive && !setting.Service.RegisterEmailConfirm {
|
|
|
|
log.Debug("Send activation failed: email %s is already activated for user: %-v", email.Email, ctx.Doer)
|
2020-03-02 23:55:36 +05:30
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
return
|
|
|
|
}
|
2021-07-14 02:29:27 +05:30
|
|
|
// Only fired when the primary email is inactive (Wrong state)
|
2022-03-22 12:33:22 +05:30
|
|
|
mailer.SendActivateAccountMail(ctx.Locale, ctx.Doer)
|
2020-03-02 23:55:36 +05:30
|
|
|
} else {
|
2024-02-04 18:59:09 +05:30
|
|
|
mailer.SendActivateEmailMail(ctx.Doer, email.Email)
|
2020-03-02 23:55:36 +05:30
|
|
|
}
|
2021-07-14 02:29:27 +05:30
|
|
|
address = email.Email
|
2020-03-02 23:55:36 +05:30
|
|
|
|
2023-12-19 14:59:05 +05:30
|
|
|
if err := ctx.Cache.Put("MailResendLimit_"+ctx.Doer.LowerName, ctx.Doer.LowerName, 180); err != nil {
|
|
|
|
log.Error("Set cache(MailResendLimit) fail: %v", err)
|
2020-03-02 23:55:36 +05:30
|
|
|
}
|
2023-12-19 14:59:05 +05:30
|
|
|
|
2022-06-26 19:49:22 +05:30
|
|
|
ctx.Flash.Info(ctx.Tr("settings.add_email_confirmation_sent", address, timeutil.MinutesToFriendly(setting.Service.ActiveCodeLives, ctx.Locale)))
|
2020-03-02 23:55:36 +05:30
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
return
|
|
|
|
}
|
2019-08-29 19:35:42 +05:30
|
|
|
// Set Email Notification Preference
|
2021-08-11 06:01:13 +05:30
|
|
|
if ctx.FormString("_method") == "NOTIFICATION" {
|
|
|
|
preference := ctx.FormString("preference")
|
2021-11-24 15:19:20 +05:30
|
|
|
if !(preference == user_model.EmailNotificationsEnabled ||
|
|
|
|
preference == user_model.EmailNotificationsOnMention ||
|
2022-07-28 14:00:12 +05:30
|
|
|
preference == user_model.EmailNotificationsDisabled ||
|
|
|
|
preference == user_model.EmailNotificationsAndYourOwn) {
|
2022-03-22 12:33:22 +05:30
|
|
|
log.Error("Email notifications preference change returned unrecognized option %s: %s", preference, ctx.Doer.Name)
|
2019-08-29 19:35:42 +05:30
|
|
|
ctx.ServerError("SetEmailPreference", errors.New("option unrecognized"))
|
|
|
|
return
|
|
|
|
}
|
2024-02-04 18:59:09 +05:30
|
|
|
opts := &user.UpdateOptions{
|
|
|
|
EmailNotificationsPreference: optional.Some(preference),
|
|
|
|
}
|
|
|
|
if err := user.UpdateUser(ctx, ctx.Doer, opts); err != nil {
|
2019-08-29 19:35:42 +05:30
|
|
|
log.Error("Set Email Notifications failed: %v", err)
|
2024-02-04 18:59:09 +05:30
|
|
|
ctx.ServerError("UpdateUser", err)
|
2019-08-29 19:35:42 +05:30
|
|
|
return
|
|
|
|
}
|
2022-03-22 12:33:22 +05:30
|
|
|
log.Trace("Email notifications preference made %s: %s", preference, ctx.Doer.Name)
|
2020-04-09 22:52:17 +05:30
|
|
|
ctx.Flash.Success(ctx.Tr("settings.email_preference_set_success"))
|
2019-08-29 19:35:42 +05:30
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
return
|
|
|
|
}
|
2018-05-17 09:35:00 +05:30
|
|
|
|
|
|
|
if ctx.HasError() {
|
2018-06-18 23:54:45 +05:30
|
|
|
loadAccountData(ctx)
|
|
|
|
|
2021-04-05 21:00:52 +05:30
|
|
|
ctx.HTML(http.StatusOK, tplSettingsAccount)
|
2018-05-17 09:35:00 +05:30
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-02-04 18:59:09 +05:30
|
|
|
if err := user.AddEmailAddresses(ctx, ctx.Doer, []string{form.Email}); err != nil {
|
2021-11-11 12:33:30 +05:30
|
|
|
if user_model.IsErrEmailAlreadyUsed(err) {
|
2018-06-18 23:54:45 +05:30
|
|
|
loadAccountData(ctx)
|
|
|
|
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.RenderWithErr(ctx.Tr("form.email_been_used"), tplSettingsAccount, &form)
|
2024-02-04 18:59:09 +05:30
|
|
|
} else if user_model.IsErrEmailCharIsNotSupported(err) || user_model.IsErrEmailInvalid(err) {
|
2020-11-14 22:23:43 +05:30
|
|
|
loadAccountData(ctx)
|
|
|
|
|
|
|
|
ctx.RenderWithErr(ctx.Tr("form.email_invalid"), tplSettingsAccount, &form)
|
2024-02-04 18:59:09 +05:30
|
|
|
} else {
|
|
|
|
ctx.ServerError("AddEmailAddresses", err)
|
2018-05-17 09:35:00 +05:30
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// Send confirmation email
|
|
|
|
if setting.Service.RegisterEmailConfirm {
|
2024-02-04 18:59:09 +05:30
|
|
|
mailer.SendActivateEmailMail(ctx.Doer, form.Email)
|
2023-12-19 14:59:05 +05:30
|
|
|
if err := ctx.Cache.Put("MailResendLimit_"+ctx.Doer.LowerName, ctx.Doer.LowerName, 180); err != nil {
|
|
|
|
log.Error("Set cache(MailResendLimit) fail: %v", err)
|
2018-05-17 09:35:00 +05:30
|
|
|
}
|
2023-12-19 14:59:05 +05:30
|
|
|
|
2024-02-04 18:59:09 +05:30
|
|
|
ctx.Flash.Info(ctx.Tr("settings.add_email_confirmation_sent", form.Email, timeutil.MinutesToFriendly(setting.Service.ActiveCodeLives, ctx.Locale)))
|
2018-05-17 09:35:00 +05:30
|
|
|
} else {
|
|
|
|
ctx.Flash.Success(ctx.Tr("settings.add_email_success"))
|
|
|
|
}
|
|
|
|
|
2024-02-04 18:59:09 +05:30
|
|
|
log.Trace("Email address added: %s", form.Email)
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteEmail response for delete user's email
|
|
|
|
func DeleteEmail(ctx *context.Context) {
|
2024-02-04 18:59:09 +05:30
|
|
|
email, err := user_model.GetEmailAddressByID(ctx, ctx.Doer.ID, ctx.FormInt64("id"))
|
|
|
|
if err != nil || email == nil {
|
|
|
|
ctx.ServerError("GetEmailAddressByID", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := user.DeleteEmailAddresses(ctx, ctx.Doer, []string{email.Email}); err != nil {
|
|
|
|
ctx.ServerError("DeleteEmailAddresses", err)
|
2018-05-17 09:35:00 +05:30
|
|
|
return
|
|
|
|
}
|
2022-03-22 12:33:22 +05:30
|
|
|
log.Trace("Email address deleted: %s", ctx.Doer.Name)
|
2018-05-17 09:35:00 +05:30
|
|
|
|
|
|
|
ctx.Flash.Success(ctx.Tr("settings.email_deletion_success"))
|
2023-07-26 11:34:01 +05:30
|
|
|
ctx.JSONRedirect(setting.AppSubURL + "/user/settings/account")
|
2018-05-17 09:35:00 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteAccount render user suicide page and response for delete user himself
|
|
|
|
func DeleteAccount(ctx *context.Context) {
|
|
|
|
ctx.Data["Title"] = ctx.Tr("settings")
|
|
|
|
ctx.Data["PageIsSettingsAccount"] = true
|
|
|
|
|
2023-09-14 22:39:32 +05:30
|
|
|
if _, _, err := auth.UserSignIn(ctx, ctx.Doer.Name, ctx.FormString("password")); err != nil {
|
2021-11-24 15:19:20 +05:30
|
|
|
if user_model.IsErrUserNotExist(err) {
|
2018-06-18 23:54:45 +05:30
|
|
|
loadAccountData(ctx)
|
|
|
|
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.RenderWithErr(ctx.Tr("form.enterred_invalid_password"), tplSettingsAccount, nil)
|
|
|
|
} else {
|
|
|
|
ctx.ServerError("UserSignIn", err)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2024-01-15 12:21:43 +05:30
|
|
|
// admin should not delete themself
|
|
|
|
if ctx.Doer.IsAdmin {
|
|
|
|
ctx.Flash.Error(ctx.Tr("form.admin_cannot_delete_self"))
|
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-07-14 12:52:09 +05:30
|
|
|
if err := user.DeleteUser(ctx, ctx.Doer, false); err != nil {
|
2018-05-17 09:35:00 +05:30
|
|
|
switch {
|
|
|
|
case models.IsErrUserOwnRepos(err):
|
|
|
|
ctx.Flash.Error(ctx.Tr("form.still_own_repo"))
|
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
|
|
|
case models.IsErrUserHasOrgs(err):
|
|
|
|
ctx.Flash.Error(ctx.Tr("form.still_has_org"))
|
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
2022-03-30 14:12:47 +05:30
|
|
|
case models.IsErrUserOwnPackages(err):
|
|
|
|
ctx.Flash.Error(ctx.Tr("form.still_own_packages"))
|
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
2024-01-15 12:21:43 +05:30
|
|
|
case models.IsErrDeleteLastAdminUser(err):
|
|
|
|
ctx.Flash.Error(ctx.Tr("auth.last_admin"))
|
|
|
|
ctx.Redirect(setting.AppSubURL + "/user/settings/account")
|
2018-05-17 09:35:00 +05:30
|
|
|
default:
|
|
|
|
ctx.ServerError("DeleteUser", err)
|
|
|
|
}
|
|
|
|
} else {
|
2022-03-22 12:33:22 +05:30
|
|
|
log.Trace("Account deleted: %s", ctx.Doer.Name)
|
2018-05-17 09:35:00 +05:30
|
|
|
ctx.Redirect(setting.AppSubURL + "/")
|
|
|
|
}
|
|
|
|
}
|
2018-06-18 23:54:45 +05:30
|
|
|
|
|
|
|
func loadAccountData(ctx *context.Context) {
|
2023-09-14 22:39:32 +05:30
|
|
|
emlist, err := user_model.GetEmailAddresses(ctx, ctx.Doer.ID)
|
2018-06-18 23:54:45 +05:30
|
|
|
if err != nil {
|
|
|
|
ctx.ServerError("GetEmailAddresses", err)
|
|
|
|
return
|
|
|
|
}
|
2020-03-02 23:55:36 +05:30
|
|
|
type UserEmail struct {
|
2021-11-11 12:33:30 +05:30
|
|
|
user_model.EmailAddress
|
2020-03-02 23:55:36 +05:30
|
|
|
CanBePrimary bool
|
|
|
|
}
|
2023-12-19 14:59:05 +05:30
|
|
|
pendingActivation := ctx.Cache.IsExist("MailResendLimit_" + ctx.Doer.LowerName)
|
2020-03-02 23:55:36 +05:30
|
|
|
emails := make([]*UserEmail, len(emlist))
|
|
|
|
for i, em := range emlist {
|
|
|
|
var email UserEmail
|
|
|
|
email.EmailAddress = *em
|
|
|
|
email.CanBePrimary = em.IsActivated
|
|
|
|
emails[i] = &email
|
|
|
|
}
|
2018-06-18 23:54:45 +05:30
|
|
|
ctx.Data["Emails"] = emails
|
2024-02-04 18:59:09 +05:30
|
|
|
ctx.Data["EmailNotificationsPreference"] = ctx.Doer.EmailNotificationsPreference
|
2020-03-02 23:55:36 +05:30
|
|
|
ctx.Data["ActivationsPending"] = pendingActivation
|
|
|
|
ctx.Data["CanAddEmails"] = !pendingActivation || !setting.Service.RegisterEmailConfirm
|
2021-01-18 02:18:38 +05:30
|
|
|
|
2021-01-22 08:26:19 +05:30
|
|
|
if setting.Service.UserDeleteWithCommentsMaxTime != 0 {
|
|
|
|
ctx.Data["UserDeleteWithCommentsMaxTime"] = setting.Service.UserDeleteWithCommentsMaxTime.String()
|
2022-03-22 12:33:22 +05:30
|
|
|
ctx.Data["UserDeleteWithComments"] = ctx.Doer.CreatedUnix.AsTime().Add(setting.Service.UserDeleteWithCommentsMaxTime).After(time.Now())
|
2021-01-18 02:18:38 +05:30
|
|
|
}
|
2018-06-18 23:54:45 +05:30
|
|
|
}
|