015
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import
|
||||
mike,
|
||||
nimja/parser,
|
||||
segfaults
|
||||
segfaults,
|
||||
../lib/mics,
|
||||
../database/[faculty],
|
||||
../models/models
|
||||
|
||||
proc faculty*(ctx: Context): string =
|
||||
compileTemplateFile(getScriptDir() / "view" / "faculty_admin.html")
|
||||
@@ -16,8 +19,21 @@ proc postFacultySignUp*(ctx: Context)=
|
||||
var
|
||||
form = ctx.urlForm
|
||||
|
||||
username = form["username"]
|
||||
email = form["email"]
|
||||
firstname = form["firstname"]
|
||||
lastname = form["lastname"]
|
||||
password = form["password"]
|
||||
|
||||
ctx &= initCookie("username", username)
|
||||
db = newDatabase()
|
||||
faculty: Faculty
|
||||
|
||||
faculty.firstName = firstname
|
||||
faculty.lastName = lastName
|
||||
faculty.email = email
|
||||
faculty.password = password
|
||||
faculty.accessLevel = 1
|
||||
|
||||
db.createPost(faculty)
|
||||
|
||||
ctx &= initCookie("email", email)
|
||||
ctx &= initCookie("password", password)
|
||||
|
Reference in New Issue
Block a user