2020-11-14 13:03:06 +00:00
|
|
|
// Code generated by qtc from "auth.qtpl". DO NOT EDIT.
|
|
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:1
|
|
|
|
package auth
|
2020-11-14 13:03:06 +00:00
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:1
|
2021-04-12 17:40:43 +00:00
|
|
|
import "net/http"
|
2020-11-14 13:03:06 +00:00
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:2
|
2022-04-02 08:00:10 +00:00
|
|
|
import "sort"
|
2021-02-23 14:36:12 +00:00
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:3
|
2022-04-02 08:00:10 +00:00
|
|
|
import "github.com/bouncepaw/mycorrhiza/cfg"
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:4
|
2021-09-06 17:46:34 +00:00
|
|
|
import "github.com/bouncepaw/mycorrhiza/l18n"
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:5
|
2022-04-02 08:00:10 +00:00
|
|
|
import "github.com/bouncepaw/mycorrhiza/user"
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:7
|
2020-11-14 13:03:06 +00:00
|
|
|
import (
|
|
|
|
qtio422016 "io"
|
|
|
|
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
|
|
)
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:7
|
2020-11-14 13:03:06 +00:00
|
|
|
var (
|
|
|
|
_ = qtio422016.Copy
|
|
|
|
_ = qt422016.AcquireByteBuffer
|
|
|
|
)
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:7
|
2022-03-20 21:24:40 +00:00
|
|
|
func StreamRegister(qw422016 *qt422016.Writer, rq *http.Request) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:7
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:9
|
2021-09-06 17:46:34 +00:00
|
|
|
lc := l18n.FromRequest(rq)
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:10
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<main class="main-width">
|
|
|
|
<section>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:13
|
2021-07-02 08:20:03 +00:00
|
|
|
if cfg.AllowRegistration {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:13
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<form class="modal" method="post" action="/register?`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:14
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.E().S(rq.URL.RawQuery)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:14
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.N().S(`" id="register-form" enctype="multipart/form-data" autocomplete="off">
|
|
|
|
<fieldset class="modal__fieldset">
|
2021-09-06 17:46:34 +00:00
|
|
|
<legend class="modal__title">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:16
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.register_header", &l18n.Replacements{"name": cfg.WikiName}))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:16
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.N().S(`</legend>
|
|
|
|
|
2021-09-06 17:46:34 +00:00
|
|
|
<label for="register-form__username">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:18
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.username"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:18
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</label>
|
2021-04-12 17:40:43 +00:00
|
|
|
<br>
|
|
|
|
<input type="text" required autofocus id="login-form__username" name="username">
|
|
|
|
<br>
|
2021-09-06 17:46:34 +00:00
|
|
|
<label for="login-form__password">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:22
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.password"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:22
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</label>
|
2021-04-12 17:40:43 +00:00
|
|
|
<br>
|
|
|
|
<input type="password" required name="password">
|
2021-09-06 17:46:34 +00:00
|
|
|
<p>`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:25
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.password_tip"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:25
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
<p>`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:26
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.cookie_tip"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:26
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
<button class="btn" type="submit" value="Register">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:27
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.register_button"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:27
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</button>
|
2021-05-16 08:37:35 +00:00
|
|
|
<a class="btn btn_weak" href="/`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:28
|
2021-05-16 08:37:35 +00:00
|
|
|
qw422016.E().S(rq.URL.RawQuery)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:28
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:28
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("ui.cancel"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:28
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</a>
|
2021-04-12 17:40:43 +00:00
|
|
|
</fieldset>
|
|
|
|
</form>
|
2021-07-14 19:51:55 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:31
|
2022-03-20 21:24:40 +00:00
|
|
|
streamtelegramWidget(qw422016, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:31
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.N().S(`
|
2021-07-14 19:51:55 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:32
|
2021-07-14 19:51:55 +00:00
|
|
|
} else if cfg.UseAuth {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:32
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-06 17:46:34 +00:00
|
|
|
<p>`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:33
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.noregister"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:33
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
2021-05-16 08:37:35 +00:00
|
|
|
<p><a href="/`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:34
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.E().S(rq.URL.RawQuery)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:34
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`">← `)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:34
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.go_back"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:34
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</a></p>
|
2021-04-12 17:40:43 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:35
|
2021-04-12 17:40:43 +00:00
|
|
|
} else {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:35
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-06 17:46:34 +00:00
|
|
|
<p>`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:36
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.noauth"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:36
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
2021-05-16 08:37:35 +00:00
|
|
|
<p><a href="/`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:37
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.E().S(rq.URL.RawQuery)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:37
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`">← `)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:37
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.go_back"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:37
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</a></p>
|
2021-04-12 17:40:43 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:38
|
2021-04-12 17:40:43 +00:00
|
|
|
}
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:38
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</section>
|
|
|
|
</main>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2021-04-12 17:40:43 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2022-03-20 21:24:40 +00:00
|
|
|
func WriteRegister(qq422016 qtio422016.Writer, rq *http.Request) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2021-04-12 17:40:43 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2022-03-20 21:24:40 +00:00
|
|
|
StreamRegister(qw422016, rq)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2021-04-12 17:40:43 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2021-04-12 17:40:43 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2022-03-20 21:24:40 +00:00
|
|
|
func Register(rq *http.Request) string {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2021-04-12 17:40:43 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2022-03-20 21:24:40 +00:00
|
|
|
WriteRegister(qb422016, rq)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2021-04-12 17:40:43 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2021-04-12 17:40:43 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2021-04-12 17:40:43 +00:00
|
|
|
return qs422016
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:41
|
2021-04-12 17:40:43 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:43
|
2022-03-20 21:24:40 +00:00
|
|
|
func StreamLogin(qw422016 *qt422016.Writer, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:43
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-01-26 05:41:57 +00:00
|
|
|
<main class="main-width">
|
2020-11-14 13:03:06 +00:00
|
|
|
<section>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:46
|
2021-07-02 08:20:03 +00:00
|
|
|
if cfg.UseAuth {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:46
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-12-30 21:07:39 +00:00
|
|
|
<form class="modal" method="post" action="/login" id="login-form" enctype="multipart/form-data" autocomplete="on">
|
2021-02-23 14:36:12 +00:00
|
|
|
<fieldset class="modal__fieldset">
|
2021-09-06 17:46:34 +00:00
|
|
|
<legend class="modal__title">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:49
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.login_header", &l18n.Replacements{"name": cfg.WikiName}))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:49
|
2021-02-23 14:36:12 +00:00
|
|
|
qw422016.N().S(`</legend>
|
2021-09-06 17:46:34 +00:00
|
|
|
<label for="login-form__username">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:50
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.username"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:50
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</label>
|
2021-02-23 14:36:12 +00:00
|
|
|
<br>
|
|
|
|
<input type="text" required autofocus id="login-form__username" name="username" autocomplete="username">
|
|
|
|
<br>
|
2021-09-06 17:46:34 +00:00
|
|
|
<label for="login-form__password">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:54
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.password"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:54
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</label>
|
2021-02-23 14:36:12 +00:00
|
|
|
<br>
|
|
|
|
<input type="password" required name="password" autocomplete="current-password">
|
2021-09-06 17:46:34 +00:00
|
|
|
<p>`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:57
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.cookie_tip"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:57
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
<button class="btn" type="submit" value="Log in">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:58
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.login_button"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:58
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</button>
|
|
|
|
<a class="btn btn_weak" href="/">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:59
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("ui.cancel"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:59
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</a>
|
2020-11-14 13:03:06 +00:00
|
|
|
</fieldset>
|
|
|
|
</form>
|
2021-07-14 19:51:55 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:62
|
2022-03-20 21:24:40 +00:00
|
|
|
streamtelegramWidget(qw422016, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:62
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016.N().S(`
|
2020-11-14 13:03:06 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:63
|
2020-11-14 13:03:06 +00:00
|
|
|
} else {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:63
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-06 17:46:34 +00:00
|
|
|
<p>`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:64
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.noauth"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:64
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
<p><a class="btn btn_weak" href="/">← `)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:65
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.go_home"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:65
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</a></p>
|
2020-11-14 13:03:06 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:66
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:66
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</section>
|
|
|
|
</main>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2022-03-20 21:24:40 +00:00
|
|
|
func WriteLogin(qq422016 qtio422016.Writer, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2022-03-20 21:24:40 +00:00
|
|
|
StreamLogin(qw422016, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2020-11-14 13:03:06 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2022-03-20 21:24:40 +00:00
|
|
|
func Login(lc *l18n.Localizer) string {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2020-11-14 13:03:06 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2022-03-20 21:24:40 +00:00
|
|
|
WriteLogin(qb422016, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2020-11-14 13:03:06 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2020-11-14 13:03:06 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2020-11-14 13:03:06 +00:00
|
|
|
return qs422016
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:69
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
|
|
|
|
2021-07-14 19:51:55 +00:00
|
|
|
// Telegram auth widget was requested by Yogurt. As you can see, we don't offer user administrators control over it. Of course we don't.
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:72
|
2022-03-20 21:24:40 +00:00
|
|
|
func streamtelegramWidget(qw422016 *qt422016.Writer, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:72
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:73
|
2021-07-14 19:51:55 +00:00
|
|
|
if cfg.TelegramEnabled {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:73
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-06 17:46:34 +00:00
|
|
|
<p class="telegram-notice">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:74
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.telegram_tip"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:74
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
2021-07-14 19:51:55 +00:00
|
|
|
<script async src="https://telegram.org/js/telegram-widget.js?15" data-telegram-login="`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:75
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016.E().S(cfg.TelegramBotName)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:75
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016.N().S(`" data-size="medium" data-userpic="false" data-auth-url="`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:75
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016.E().S(cfg.URL)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:75
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016.N().S(`/telegram-login"></script>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:76
|
2021-07-14 19:51:55 +00:00
|
|
|
}
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:76
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2021-07-14 19:51:55 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2022-03-20 21:24:40 +00:00
|
|
|
func writetelegramWidget(qq422016 qtio422016.Writer, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2021-07-14 19:51:55 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2022-03-20 21:24:40 +00:00
|
|
|
streamtelegramWidget(qw422016, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2021-07-14 19:51:55 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2021-07-14 19:51:55 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2022-03-20 21:24:40 +00:00
|
|
|
func telegramWidget(lc *l18n.Localizer) string {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2021-07-14 19:51:55 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2022-03-20 21:24:40 +00:00
|
|
|
writetelegramWidget(qb422016, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2021-07-14 19:51:55 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2021-07-14 19:51:55 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2021-07-14 19:51:55 +00:00
|
|
|
return qs422016
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:77
|
2021-07-14 19:51:55 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:79
|
2022-03-20 21:24:40 +00:00
|
|
|
func StreamLoginError(qw422016 *qt422016.Writer, err string, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:79
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-01-26 05:41:57 +00:00
|
|
|
<main class="main-width">
|
2020-11-14 13:03:06 +00:00
|
|
|
<section>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:82
|
2021-07-14 20:04:52 +00:00
|
|
|
switch err {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:83
|
2020-11-14 13:03:06 +00:00
|
|
|
case "unknown username":
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:83
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-06 17:46:34 +00:00
|
|
|
<p class="error">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:84
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.error_username"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:84
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
2020-11-14 13:03:06 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:85
|
2020-11-14 13:03:06 +00:00
|
|
|
case "wrong password":
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:85
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-06 17:46:34 +00:00
|
|
|
<p class="error">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:86
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.error_password"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:86
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
2020-11-14 13:03:06 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:87
|
2020-11-14 13:03:06 +00:00
|
|
|
default:
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:87
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<p class="error">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:88
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.E().S(err)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:88
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:89
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:89
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-06 17:46:34 +00:00
|
|
|
<p><a href="/login">← `)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:90
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.try_again"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:90
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</a></p>
|
2020-11-14 13:03:06 +00:00
|
|
|
</section>
|
|
|
|
</main>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2022-03-20 21:24:40 +00:00
|
|
|
func WriteLoginError(qq422016 qtio422016.Writer, err string, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2022-03-20 21:24:40 +00:00
|
|
|
StreamLoginError(qw422016, err, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2020-11-14 13:03:06 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2022-03-20 21:24:40 +00:00
|
|
|
func LoginError(err string, lc *l18n.Localizer) string {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2020-11-14 13:03:06 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2022-03-20 21:24:40 +00:00
|
|
|
WriteLoginError(qb422016, err, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2020-11-14 13:03:06 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2020-11-14 13:03:06 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2020-11-14 13:03:06 +00:00
|
|
|
return qs422016
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:93
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:95
|
2022-03-20 21:24:40 +00:00
|
|
|
func StreamLogout(qw422016 *qt422016.Writer, can bool, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:95
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-01-26 05:41:57 +00:00
|
|
|
<main class="main-width">
|
2020-11-14 13:03:06 +00:00
|
|
|
<section>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:98
|
2020-11-14 13:03:06 +00:00
|
|
|
if can {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:98
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-06 17:46:34 +00:00
|
|
|
<h1>`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:99
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.logout_header"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:99
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</h1>
|
2021-12-30 21:07:39 +00:00
|
|
|
<form method="POST" action="/logout">
|
|
|
|
<input class="btn btn_accent" type="submit" value="`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:101
|
2021-12-30 21:07:39 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.logout_button"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:101
|
2021-12-30 21:07:39 +00:00
|
|
|
qw422016.N().S(`"/>
|
|
|
|
<a class="btn btn_weak" href="/">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:102
|
2021-12-30 21:07:39 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.go_home"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:102
|
2021-12-30 21:07:39 +00:00
|
|
|
qw422016.N().S(`</a>
|
|
|
|
</form>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:104
|
2021-12-30 21:07:39 +00:00
|
|
|
} else {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:104
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
2021-09-06 17:46:34 +00:00
|
|
|
<p>`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:105
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.logout_anon"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:105
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</p>
|
|
|
|
<p><a href="/login">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:106
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.login_title"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:106
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</a></p>
|
|
|
|
<p><a href="/">← `)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:107
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.go_home"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:107
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</a></p>
|
2020-11-14 13:03:06 +00:00
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:108
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:108
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
</section>
|
|
|
|
</main>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2022-03-20 21:24:40 +00:00
|
|
|
func WriteLogout(qq422016 qtio422016.Writer, can bool, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2020-11-14 13:03:06 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2022-03-20 21:24:40 +00:00
|
|
|
StreamLogout(qw422016, can, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2020-11-14 13:03:06 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2022-03-20 21:24:40 +00:00
|
|
|
func Logout(can bool, lc *l18n.Localizer) string {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2020-11-14 13:03:06 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2022-03-20 21:24:40 +00:00
|
|
|
WriteLogout(qb422016, can, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2020-11-14 13:03:06 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2020-11-14 13:03:06 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2020-11-14 13:03:06 +00:00
|
|
|
return qs422016
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:111
|
2020-11-14 13:03:06 +00:00
|
|
|
}
|
2021-07-09 11:47:50 +00:00
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:113
|
2022-03-20 21:24:40 +00:00
|
|
|
func StreamLock(qw422016 *qt422016.Writer, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:113
|
2021-07-09 11:47:50 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<!doctype html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
2021-09-06 17:46:34 +00:00
|
|
|
<title>🔒 `)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:119
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.lock_title"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:119
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</title>
|
2021-07-09 11:47:50 +00:00
|
|
|
<link rel="shortcut icon" href="/static/favicon.ico">
|
|
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
|
|
</head>
|
|
|
|
<body>
|
2022-08-21 10:31:18 +00:00
|
|
|
<main class="locked-notice main-width">
|
2021-07-09 11:47:50 +00:00
|
|
|
<section class="locked-notice__message">
|
|
|
|
<p class="locked-notice__lock">🔒</p>
|
2021-09-06 17:46:34 +00:00
|
|
|
<h1 class="locked-notice__title">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:127
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.lock_title"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:127
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</h1>
|
2021-12-30 21:07:39 +00:00
|
|
|
<form class="locked-notice__login-form" method="post" action="/login" id="login-form" enctype="multipart/form-data" autocomplete="on">
|
2021-09-06 17:46:34 +00:00
|
|
|
<label for="login-form__username">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:129
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.username"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:129
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</label>
|
2021-07-24 11:30:28 +00:00
|
|
|
<br>
|
|
|
|
<input type="text" required autofocus id="login-form__username" name="username" autocomplete="username">
|
|
|
|
<br>
|
2021-09-06 17:46:34 +00:00
|
|
|
<label for="login-form__password">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:133
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.password"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:133
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</label>
|
2021-07-24 11:30:28 +00:00
|
|
|
<br>
|
|
|
|
<input type="password" required name="password" autocomplete="current-password">
|
|
|
|
<br>
|
2021-09-06 17:46:34 +00:00
|
|
|
<button class="btn" type="submit" value="Log in">`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:137
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.E().S(lc.Get("auth.login_button"))
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:137
|
2021-09-06 17:46:34 +00:00
|
|
|
qw422016.N().S(`</button>
|
2021-07-24 11:30:28 +00:00
|
|
|
</form>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:139
|
2022-03-20 21:24:40 +00:00
|
|
|
streamtelegramWidget(qw422016, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:139
|
2021-07-24 11:09:39 +00:00
|
|
|
qw422016.N().S(`
|
2021-07-24 11:30:28 +00:00
|
|
|
</section>
|
2021-07-09 11:47:50 +00:00
|
|
|
</main>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
`)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2021-07-09 11:47:50 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2022-03-20 21:24:40 +00:00
|
|
|
func WriteLock(qq422016 qtio422016.Writer, lc *l18n.Localizer) {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2021-07-09 11:47:50 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2022-03-20 21:24:40 +00:00
|
|
|
StreamLock(qw422016, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2021-07-09 11:47:50 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2021-07-09 11:47:50 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2022-03-20 21:24:40 +00:00
|
|
|
func Lock(lc *l18n.Localizer) string {
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2021-07-09 11:47:50 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2022-03-20 21:24:40 +00:00
|
|
|
WriteLock(qb422016, lc)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2022-04-02 08:00:10 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2022-04-02 08:00:10 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2022-04-02 08:00:10 +00:00
|
|
|
return qs422016
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:144
|
2022-04-02 08:00:10 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 11:35:17 +00:00
|
|
|
//line auth/auth.qtpl:147
|
|
|
|
var userListL10n = map[string]L10nEntry{
|
|
|
|
"heading": En("List of users").Ru("Список пользователей"),
|
|
|
|
"administrators": En("Administrators").Ru("Администраторы"),
|
|
|
|
"moderators": En("Moderators").Ru("Модераторы"),
|
|
|
|
"editors": En("Editors").Ru("Редакторы"),
|
2022-09-14 21:07:16 +00:00
|
|
|
"readers": En("Readers").Ru("Читатели"),
|
2022-04-02 08:00:10 +00:00
|
|
|
}
|
|
|
|
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:156
|
2022-04-02 08:00:10 +00:00
|
|
|
func StreamUserList(qw422016 *qt422016.Writer, lc *l18n.Localizer) {
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:156
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<main class="main-width user-list">
|
|
|
|
`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:159
|
2022-04-02 08:00:10 +00:00
|
|
|
var get = func(key string) string {
|
2022-08-06 11:35:17 +00:00
|
|
|
return userListL10n[key].Get(lc.Locale)
|
2022-04-02 08:00:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
admins = make([]string, 0)
|
|
|
|
moderators = make([]string, 0)
|
|
|
|
editors = make([]string, 0)
|
2022-09-14 21:07:16 +00:00
|
|
|
readers = make([]string, 0)
|
2022-04-02 08:00:10 +00:00
|
|
|
)
|
|
|
|
for u := range user.YieldUsers() {
|
|
|
|
switch u.Group {
|
|
|
|
// What if we place the users into sorted slices?
|
|
|
|
case "admin":
|
|
|
|
admins = append(admins, u.Name)
|
|
|
|
case "moderator":
|
|
|
|
moderators = append(moderators, u.Name)
|
|
|
|
case "editor", "trusted":
|
|
|
|
editors = append(editors, u.Name)
|
2022-09-14 21:07:16 +00:00
|
|
|
case "reader":
|
|
|
|
readers = append(readers, u.Name)
|
2022-04-02 08:00:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
sort.Strings(admins)
|
|
|
|
sort.Strings(moderators)
|
|
|
|
sort.Strings(editors)
|
2022-09-14 21:07:16 +00:00
|
|
|
sort.Strings(readers)
|
2022-04-02 08:00:10 +00:00
|
|
|
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:186
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<h1>`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:187
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(get("heading"))
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:187
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</h1>
|
|
|
|
<section>
|
|
|
|
<h2>`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:189
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(get("administrators"))
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:189
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</h2>
|
|
|
|
<ol>`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:190
|
2022-04-02 08:00:10 +00:00
|
|
|
for _, name := range admins {
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:190
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<li><a href="/hypha/`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:191
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(cfg.UserHypha)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:191
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`/`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:191
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(name)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:191
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:191
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(name)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:191
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</a></li>
|
|
|
|
`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:192
|
2022-04-02 08:00:10 +00:00
|
|
|
}
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:192
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</ol>
|
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<h2>`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:195
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(get("moderators"))
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:195
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</h2>
|
|
|
|
<ol>`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:196
|
2022-04-02 08:00:10 +00:00
|
|
|
for _, name := range moderators {
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:196
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<li><a href="/hypha/`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:197
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(cfg.UserHypha)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:197
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`/`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:197
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(name)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:197
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:197
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(name)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:197
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</a></li>
|
|
|
|
`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:198
|
2022-04-02 08:00:10 +00:00
|
|
|
}
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:198
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</ol>
|
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<h2>`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:201
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(get("editors"))
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:201
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</h2>
|
|
|
|
<ol>`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:202
|
2022-04-02 08:00:10 +00:00
|
|
|
for _, name := range editors {
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:202
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`
|
|
|
|
<li><a href="/hypha/`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:203
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(cfg.UserHypha)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:203
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`/`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:203
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(name)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:203
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`">`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:203
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.E().S(name)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:203
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</a></li>
|
|
|
|
`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:204
|
2022-04-02 08:00:10 +00:00
|
|
|
}
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:204
|
|
|
|
qw422016.N().S(`</ol>
|
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<h2>`)
|
|
|
|
//line auth/auth.qtpl:207
|
|
|
|
qw422016.E().S(get("readers"))
|
|
|
|
//line auth/auth.qtpl:207
|
|
|
|
qw422016.N().S(`</h2>
|
|
|
|
<ol>`)
|
|
|
|
//line auth/auth.qtpl:208
|
|
|
|
for _, name := range readers {
|
|
|
|
//line auth/auth.qtpl:208
|
|
|
|
qw422016.N().S(`
|
|
|
|
<li><a href="/hypha/`)
|
|
|
|
//line auth/auth.qtpl:209
|
|
|
|
qw422016.E().S(cfg.UserHypha)
|
|
|
|
//line auth/auth.qtpl:209
|
|
|
|
qw422016.N().S(`/`)
|
|
|
|
//line auth/auth.qtpl:209
|
|
|
|
qw422016.E().S(name)
|
|
|
|
//line auth/auth.qtpl:209
|
|
|
|
qw422016.N().S(`">`)
|
|
|
|
//line auth/auth.qtpl:209
|
|
|
|
qw422016.E().S(name)
|
|
|
|
//line auth/auth.qtpl:209
|
|
|
|
qw422016.N().S(`</a></li>
|
|
|
|
`)
|
|
|
|
//line auth/auth.qtpl:210
|
|
|
|
}
|
|
|
|
//line auth/auth.qtpl:210
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016.N().S(`</ol>
|
|
|
|
</section>
|
|
|
|
</main>
|
|
|
|
`)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2022-04-02 08:00:10 +00:00
|
|
|
}
|
|
|
|
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2022-04-02 08:00:10 +00:00
|
|
|
func WriteUserList(qq422016 qtio422016.Writer, lc *l18n.Localizer) {
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2022-04-02 08:00:10 +00:00
|
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2022-04-02 08:00:10 +00:00
|
|
|
StreamUserList(qw422016, lc)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2022-04-02 08:00:10 +00:00
|
|
|
qt422016.ReleaseWriter(qw422016)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2022-04-02 08:00:10 +00:00
|
|
|
}
|
|
|
|
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2022-04-02 08:00:10 +00:00
|
|
|
func UserList(lc *l18n.Localizer) string {
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2022-04-02 08:00:10 +00:00
|
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2022-04-02 08:00:10 +00:00
|
|
|
WriteUserList(qb422016, lc)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2021-07-09 11:47:50 +00:00
|
|
|
qs422016 := string(qb422016.B)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2021-07-09 11:47:50 +00:00
|
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2021-07-09 11:47:50 +00:00
|
|
|
return qs422016
|
2022-09-14 21:07:16 +00:00
|
|
|
//line auth/auth.qtpl:213
|
2021-07-09 11:47:50 +00:00
|
|
|
}
|