summaryrefslogtreecommitdiff
path: root/system/admin/handlers.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-12-18 12:13:08 -0800
committerSteve Manuel <nilslice@gmail.com>2016-12-18 12:13:08 -0800
commit7d87d40f8d0550331d1b19dea2c374ecfbc77d48 (patch)
treeb0b0e2b346119ec525530f83b4995fe966f2b1dd /system/admin/handlers.go
parent5b9f00b427f74d447a3a685a8b7779c86b5a1b9d (diff)
adding beginning of addon api (cooresponding to previous commit w/ reference addon)
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r--system/admin/handlers.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index fed77f7..55a5f30 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -71,6 +71,7 @@ func initHandler(res http.ResponseWriter, req *http.Request) {
etag := db.NewEtag()
req.Form.Set("etag", etag)
+ // create and save admin user
email := strings.ToLower(req.FormValue("email"))
password := req.FormValue("password")
usr := user.NewUser(email, password)
@@ -82,6 +83,10 @@ func initHandler(res http.ResponseWriter, req *http.Request) {
return
}
+ // set HTTP port which should be previously added to config cache
+ port := db.ConfigCache("http_port")
+ req.Form.Set("http_port", port)
+
// set initial user email as admin_email and make config
req.Form.Set("admin_email", email)
err = db.SetConfig(req.Form)