Fixed logo
This commit is contained in:
parent
66c1c2198b
commit
a77b72f22d
1 changed files with 46 additions and 48 deletions
94
main.go
94
main.go
|
|
@ -117,7 +117,7 @@ func pageIndex(w http.ResponseWriter, r *http.Request) {
|
|||
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
|
||||
</head>
|
||||
<body style="margin: 32px">
|
||||
<div style="margin-bottom: 32px"><img src="/images/logo.svg"></div>
|
||||
<div style="margin-bottom: 32px"><img src="https://u-lug.org/images/logo.svg"></div>
|
||||
<div>Skapar länk...</div>
|
||||
|
||||
<div id="link"></div>
|
||||
|
|
@ -164,59 +164,57 @@ func createInvite(w http.ResponseWriter, r *http.Request) {
|
|||
email := fmt.Sprintf("%08d@example.com", seq)
|
||||
expire := time.Now().Add(time.Hour * 24 * 7)
|
||||
|
||||
if false {
|
||||
// legacy_object
|
||||
key := fmt.Sprintf("invitation:uid:2:invited:%s", email)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_object(_key, "type", "expireAt") VALUES($1, 'string', null)`, key)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
// legacy_object
|
||||
key := fmt.Sprintf("invitation:uid:2:invited:%s", email)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_object(_key, "type", "expireAt") VALUES($1, 'string', null)`, key)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
key = fmt.Sprintf("invitation:invited:%s", email)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_object(_key, "type", "expireAt") VALUES($1, 'set', null)`, key)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
key = fmt.Sprintf("invitation:invited:%s", email)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_object(_key, "type", "expireAt") VALUES($1, 'set', null)`, key)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
key = fmt.Sprintf("invitation:token:%s", newUUID)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_object(_key, "type", "expireAt") VALUES($1, 'hash', $2)`, key, expire)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
key = fmt.Sprintf("invitation:token:%s", newUUID)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_object(_key, "type", "expireAt") VALUES($1, 'hash', $2)`, key, expire)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
// legacy_hash
|
||||
key = fmt.Sprintf("invitation:token:%s", newUUID)
|
||||
data := fmt.Sprintf(`{"email": "%s", "token": "%s", "inviter": 2, "groupsToJoin": "[]"}`, email, newUUID)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_hash(_key, "data", "type") VALUES($1, $2, 'hash')`, key, data)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
// legacy_hash
|
||||
key = fmt.Sprintf("invitation:token:%s", newUUID)
|
||||
data := fmt.Sprintf(`{"email": "%s", "token": "%s", "inviter": 2, "groupsToJoin": "[]"}`, email, newUUID)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_hash(_key, "data", "type") VALUES($1, $2, 'hash')`, key, data)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
// legacy_set
|
||||
key = "invitation:uid:2"
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_set(_key, "member", "type") VALUES($1, $2, 'set')`, key, email)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
// legacy_set
|
||||
key = "invitation:uid:2"
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_set(_key, "member", "type") VALUES($1, $2, 'set')`, key, email)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
key = fmt.Sprintf("invitation:invited:%s", email)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_set(_key, "member", "type") VALUES($1, $2, 'set')`, key, newUUID)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
key = fmt.Sprintf("invitation:invited:%s", email)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_set(_key, "member", "type") VALUES($1, $2, 'set')`, key, newUUID)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
key = fmt.Sprintf("invitation:uid:2:invited:%s", email)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_string(_key, "data", "type") VALUES($1, $2, 'string')`, key, newUUID)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
key = fmt.Sprintf("invitation:uid:2:invited:%s", email)
|
||||
_, err = db.Exec(` INSERT INTO public.legacy_string(_key, "data", "type") VALUES($1, $2, 'string')`, key, newUUID)
|
||||
if err != nil {
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
|
||||
j, _ := json.Marshal(struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue