From 68d803229a5bfc3708992ea34da1dbab5bb3f84e Mon Sep 17 00:00:00 2001 From: Florian Hoss Date: Thu, 7 Apr 2022 16:24:56 +0200 Subject: [PATCH] add search bar for sql injection --- Lab01/app/database/database.go | 4 ++++ Lab01/app/templates/tasks.tmpl | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Lab01/app/database/database.go b/Lab01/app/database/database.go index d968401..a9b4cf7 100644 --- a/Lab01/app/database/database.go +++ b/Lab01/app/database/database.go @@ -97,3 +97,7 @@ func (db *Database) UserIsLoggedIn(username string) bool { } return false } + +func (db *Database) Search(term string) { + db.ORM.Exec("SELECT * FROM tasks") +} diff --git a/Lab01/app/templates/tasks.tmpl b/Lab01/app/templates/tasks.tmpl index 52e3d05..b384c6d 100644 --- a/Lab01/app/templates/tasks.tmpl +++ b/Lab01/app/templates/tasks.tmpl @@ -9,7 +9,12 @@ {{template "navbar" .}}
-
{{ .title }}
+
+
{{ .title }}
+
+ +
+