diff --git a/src/a3 b/src/a3 index 1e960f0..1d26e6b 100755 Binary files a/src/a3 and b/src/a3 differ diff --git a/src/a3a/admin/show.html b/src/a3a/admin/show.html index a2ce207..4f8fe22 100644 --- a/src/a3a/admin/show.html +++ b/src/a3a/admin/show.html @@ -14,23 +14,25 @@
- +
- +
+ {% if admin.accessLevel == 3 %}
- -
-
- - +
+ {% endif %} + + + + + + +
diff --git a/src/a3c/users.nim b/src/a3c/users.nim index f69c98b..5c1b28f 100644 --- a/src/a3c/users.nim +++ b/src/a3c/users.nim @@ -101,3 +101,5 @@ proc getUserByID*(db: DbConn, id: int): User= result.firstName = row[1] result.lastName = row[2] result.email = row[3] + result.password = row[4] + result.accessLevel = parseInt(row[7]) diff --git a/src/a3d/admin.nim b/src/a3d/admin.nim index 46c340d..ffdd0d9 100644 --- a/src/a3d/admin.nim +++ b/src/a3d/admin.nim @@ -2,7 +2,7 @@ import mike, nimja, ../a3pkg/mics, - ../a3c/[orders, products] + ../a3c/[orders, products, users] proc admin*(ctx: Context): string= var @@ -15,5 +15,10 @@ proc adminShow*(ctx: Context, id: int): string= var db = newDatabase() orders = db.getOrders(id) + user = db.getUserByID(id) + cookies = ctx.cookies + adminEmail = cookies.getOrDefault("email", "") + adminPassword = cookies.getOrDefault("password", "") + admin = db.getUser(adminEmail, adminPassword) compileTemplateFile(getScriptDir() / "a3a" / "admin" / "show.html")