, , <1: Empty invite (no delete/link), 0: Actual invite>, , , [], , , ]
function parseInvite(invite, empty = false) {
@@ -671,7 +672,7 @@ document.getElementById('openDefaultsWizard').onclick = function() {
checked = '';
}
radio.innerHTML =
- ``;
+ ``;
radioList.appendChild(radio);
}
let button = document.getElementById('openDefaultsWizard');
@@ -718,7 +719,7 @@ function storeDefaults(users) {
let id = '';
for (let radio of radios) {
if (radio.checked) {
- id = radio.id.replace('select_', '');
+ id = radio.id.replace('default_', '');
break;
}
}
diff --git a/data/templates/admin.html b/data/templates/admin.html
index 30e183d..4ba954d 100644
--- a/data/templates/admin.html
+++ b/data/templates/admin.html
@@ -244,6 +244,32 @@
+
invites accounts
diff --git a/email.go b/email.go
index 9b13696..e26fb82 100644
--- a/email.go
+++ b/email.go
@@ -278,6 +278,32 @@ func (emailer *Emailer) constructReset(pwr Pwr, app *appContext) (*Email, error)
return email, nil
}
+func (emailer *Emailer) constructDeleted(reason string, app *appContext) (*Email, error) {
+ email := &Email{
+ subject: app.config.Section("deletion").Key("subject").MustString("Your account was deleted - Jellyfin"),
+ }
+ for _, key := range []string{"html", "text"} {
+ fpath := app.config.Section("deletion").Key("email_" + key).String()
+ tpl, err := template.ParseFiles(fpath)
+ if err != nil {
+ return nil, err
+ }
+ var tplData bytes.Buffer
+ err = tpl.Execute(&tplData, map[string]string{
+ "reason": reason,
+ })
+ if err != nil {
+ return nil, err
+ }
+ if key == "html" {
+ email.html = tplData.String()
+ } else {
+ email.text = tplData.String()
+ }
+ }
+ return email, nil
+}
+
// calls the send method in the underlying emailClient.
func (emailer *Emailer) send(address string, email *Email) error {
return emailer.sender.send(address, emailer.fromName, emailer.fromAddr, email)
diff --git a/jfapi.go b/jfapi.go
index 00d368b..236b113 100644
--- a/jfapi.go
+++ b/jfapi.go
@@ -215,6 +215,17 @@ func (jf *Jellyfin) _post(url string, data map[string]interface{}, response bool
return "", resp.StatusCode, nil
}
+func (jf *Jellyfin) deleteUser(id string) (int, error) {
+ url := fmt.Sprintf("%s/Users/%s", jf.server, id)
+ req, _ := http.NewRequest("DELETE", url, nil)
+ for name, value := range jf.header {
+ req.Header.Add(name, value)
+ }
+ resp, err := jf.httpClient.Do(req)
+ defer timeoutHandler("Jellyfin", jf.server, jf.noFail)
+ return resp.StatusCode, err
+}
+
func (jf *Jellyfin) getUsers(public bool) ([]map[string]interface{}, int, error) {
var result []map[string]interface{}
var data string
diff --git a/mail/deleted.mjml b/mail/deleted.mjml
new file mode 100644
index 0000000..78179e2
--- /dev/null
+++ b/mail/deleted.mjml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Jellyfin
+
+
+
+
+
+ Your account was deleted.
+ Reason: {{ .reason }}
+
+
+
+
+
+
+ {{ .message }}
+
+
+
+