forgejo/modules
Aravinth Manivannan 3cd48ef4d5
[GITEA] notifies admins on new user registration
Sends email with information on the new user (time of creation and time of last sign-in) and a link to manage the new user from the admin panel

closes: https://codeberg.org/forgejo/forgejo/issues/480

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1371
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
Co-committed-by: Aravinth Manivannan <realaravinth@batsense.net>
(cherry picked from commit c721aa828b)
(cherry picked from commit 6487efcb9d)

Conflicts:
	modules/notification/base/notifier.go
	modules/notification/base/null.go
	modules/notification/notification.go
	https://codeberg.org/forgejo/forgejo/pulls/1422
(cherry picked from commit 7ea66ee1c5)

Conflicts:
	services/notify/notifier.go
	services/notify/notify.go
	services/notify/null.go
	https://codeberg.org/forgejo/forgejo/pulls/1469
(cherry picked from commit 7d2d997011)
(cherry picked from commit 435a54f140)
(cherry picked from commit 8ec7b3e448)

[GITEA] notifies admins on new user registration (squash) performance bottleneck

Refs: https://codeberg.org/forgejo/forgejo/issues/1479
(cherry picked from commit 97ac9147ff)
(cherry picked from commit 19f295c16b)
(cherry picked from commit 3367dcb2cf)

[GITEA] notifies admins on new user registration (squash) cosmetic changes

Co-authored-by: delvh <dev.lh@web.de>
(cherry picked from commit 9f1670e040)
(cherry picked from commit de5bb2a224)
(cherry picked from commit 8f8e52f31a)
(cherry picked from commit e0d5130312)
(cherry picked from commit f1288d6d9b)
(cherry picked from commit 1db4736fd7)
(cherry picked from commit e8dcbb6cd6)
(cherry picked from commit 09625d6476)

[GITEA] notifies admins on new user registration (squash) ctx.Locale

(cherry picked from commit dab7212fad)
(cherry picked from commit 9b7bbae8c4)
(cherry picked from commit f750b71d3d)
(cherry picked from commit f79af36679)
(cherry picked from commit e76eee334e)

[GITEA] notifies admins on new user registration (squash) fix locale

(cherry picked from commit 54cd100d8d)
(cherry picked from commit 053dbd3d50)

[GITEA] notifies admins on new user registration (squash) fix URL

1. Use absolute URL in the admin panel link sent on new registrations
2. Include absolute URL of the newly signed-up user's profile.

New email looks like this:

<details><summary>Please click to expand</summary>

```
--153937b1864f158f4fd145c4b5d4a513568681dd489021dd466a8ad7b770
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

User Information: @realaravinth ( http://localhost:3000/realaravinth )
----------------------------------------------------------------------

* Created: 2023-12-13 19:36:50 +05:30

Please click here ( http://localhost:3000/admin/users/9 ) to manage the use=
r from the admin panel.
--153937b1864f158f4fd145c4b5d4a513568681dd489021dd466a8ad7b770
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
	<title>New user realaravinth just signed up</title>

	<style>
		blockquote { padding-left: 1em; margin: 1em 0; border-left: 1px solid gre=
y; color: #777}
		.footer { font-size:small; color:#666;}
	</style>

</head>

<body>
	<ul>
		<h3>User Information: <a href=3D"http://localhost:3000/realaravinth">@rea=
laravinth</a></h3>
		<li>Created: <relative-time format=3D"datetime" weekday=3D"" year=3D"nume=
ric" month=3D"short" day=3D"numeric" hour=3D"numeric" minute=3D"numeric" se=
cond=3D"numeric" datetime=3D"2023-12-13T19:36:50+05:30">2023-12-13 19:36:50=
 +05:30</relative-time></li>
	</ul>
	<p> Please <a href=3D"http://localhost:3000/admin/users/9" rel=3D"nofollow=
">click here</a> to manage the user from the admin panel. </p>
</body>
</html>

--153937b1864f158f4fd145c4b5d4a513568681dd489021dd466a8ad7b770--
```

</details>

fixes: https://codeberg.org/forgejo/forgejo/issues/1927
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/1940
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
Co-committed-by: Aravinth Manivannan <realaravinth@batsense.net>
(cherry picked from commit b8d764e36a)
(cherry picked from commit d48b84f623)

Conflicts:
	routers/web/auth/auth.go
	https://codeberg.org/forgejo/forgejo/pulls/2034
(cherry picked from commit 02d3c125cc)
(cherry picked from commit 367374ecc3)

Conflicts:
	models/user/user_test.go
	https://codeberg.org/forgejo/forgejo/pulls/2119
(cherry picked from commit 4124fa5aa4)
(cherry picked from commit 7f12610ff6)

[GITEA] notifies admins on new user registration (squash) DeleteByID

trivial conflict because of
   778ad795fd Refactor deletion (#28610)

(cherry picked from commit 05682614e5)
(cherry picked from commit 64bd374803)
(cherry picked from commit 63d086f666)
2024-01-22 18:13:40 +00:00
..
actions [CI] Search .forgejo/workflows first 2024-01-22 12:18:31 +00:00
activitypub
analyze
assetfs
auth [SECURITY] default to pbkdf2 with 320,000 iterations 2024-01-22 13:41:20 +00:00
avatar
base Refactor some legacy code and remove unused code (#28622) 2023-12-28 09:38:59 +00:00
cache
charset
container
context [SECURITY] Rework long-term authentication 2024-01-22 13:41:21 +00:00
contexttest
csv
emoji
eventsource
generate
git Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
gitgraph
graceful Suggest to use Type=simple for systemd service (#28717) 2024-01-07 15:18:04 +00:00
hcaptcha
highlight
hostmatcher
html
httpcache
httplib
indexer [GITEA] Vendor rupture dependency 2024-01-22 13:42:50 +00:00
issue/template
json
label
lfs Do not set Accept header twice (#28598) 2023-12-28 03:59:00 +00:00
log
markup Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
mcaptcha
metrics
migration
nosql
options
packages Fix some RPM registry flaws (#28782) 2024-01-19 11:37:10 +00:00
paginator
pprof
private [CLI] implement forgejo-cli 2024-01-22 12:18:30 +00:00
process
proxy
proxyprotocol
public Refactor CORS handler (#28587) 2023-12-25 20:13:18 +08:00
queue [CI] disable redis test, no redis server yet in CI 2024-01-22 12:18:31 +00:00
recaptcha
references Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
regexplru
repository Move more functions to db.Find (#28419) 2024-01-15 02:19:25 +00:00
secret
session
setting [GITEA] notifies admins on new user registration 2024-01-22 18:13:40 +00:00
sitemap
ssh
storage [CI] Forgejo Actions based CI for PR & branches 2024-01-22 12:18:31 +00:00
structs [FEAT] allow setting the update date on issues and comments 2024-01-22 13:41:21 +00:00
svg
sync
system
templates Add support for sha256 repositories (#23894) 2024-01-19 17:05:02 +01:00
test
testlogger
timeutil Make template DateTime show proper tooltip (#28677) 2024-01-02 20:09:18 +01:00
translation
turnstile
typesniffer
updatechecker
upload
uri
user
util [DEADCODE] Add deadcode linter 2024-01-22 13:41:21 +00:00
validation [GITEA] add option for banning dots in usernames 2024-01-22 14:35:03 +00:00
web [GITEA] add option for banning dots in usernames 2024-01-22 14:35:03 +00:00
webhook Fix schedule tasks bugs (#28691) 2024-01-12 21:50:38 +00:00