From ce3f3f1417889a0a47f106175c67af94dddd3ccc Mon Sep 17 00:00:00 2001 From: "J. David Lee" Date: Tue, 11 Jun 2019 08:38:30 +0200 Subject: [PATCH] Removed ability to edit API keys. --- db.go | 11 +++-------- templates/sources.html | 4 ---- tmpl_gen.go | 4 ---- user-handlers.go | 1 - 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/db.go b/db.go index 838ad9d..2188a5d 100644 --- a/db.go +++ b/db.go @@ -234,17 +234,12 @@ func (db *dbal) SourceList() (l []Source, err error) { return l, nil } -// Updates APIKey, Description, LogAction, AlertAction. +// Updates Description, AlertTimeout, LogAction, AlertAction. func (db *dbal) SourceUpdate(s Source) error { - if err := validateAPIKey(s.APIKey); err != nil { - return err - } - _, err := db.Exec(`UPDATE sources `+ - `SET APIKey=?,Description=?,AlertTimeout=?,LogAction=?,AlertAction=? `+ + `SET Description=?,AlertTimeout=?,LogAction=?,AlertAction=? `+ `WHERE SourceID=?`, - s.APIKey, s.Description, s.AlertTimeout, - s.LogAction, s.AlertAction, s.SourceID) + s.Description, s.AlertTimeout, s.LogAction, s.AlertAction, s.SourceID) if err != nil { db.logf("Failed to update source %s: %v", s.Name, err) } diff --git a/templates/sources.html b/templates/sources.html index 01193c1..bb51650 100644 --- a/templates/sources.html +++ b/templates/sources.html @@ -135,10 +135,6 @@