aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go23
1 files changed, 11 insertions, 12 deletions
diff --git a/main.go b/main.go
index 9763f53..6553bef 100644
--- a/main.go
+++ b/main.go
@@ -119,13 +119,13 @@ func main() {
}
switch os.Args[1] {
- case "cli":
- cliMain(os.Args[2:])
- case "server":
- server(os.Args[2:])
- default:
- log.Println("Usage: guichet [server|cli] --help")
- os.Exit(1)
+ case "cli":
+ cliMain(os.Args[2:])
+ case "server":
+ server(os.Args[2:])
+ default:
+ log.Println("Usage: guichet [server|cli] --help")
+ os.Exit(1)
}
}
@@ -192,10 +192,9 @@ func logRequest(handler http.Handler) http.Handler {
// Page handlers ----
-
// --- Home Controller
type HomePageData struct {
- User *LoggedUser
+ User *LoggedUser
BaseDN string
}
@@ -208,7 +207,7 @@ func handleHome(w http.ResponseWriter, r *http.Request) {
}
data := &HomePageData{
- User: user,
+ User: user,
BaseDN: config.BaseDN,
}
@@ -235,7 +234,7 @@ func handleLogout(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/login", http.StatusFound)
}
-// --- Login Controller ---
+// --- Login Controller ---
type LoginFormData struct {
Username string
WrongUser bool
@@ -254,7 +253,7 @@ func handleLogin(w http.ResponseWriter, r *http.Request) {
username := strings.Join(r.Form["username"], "")
password := strings.Join(r.Form["password"], "")
- loginInfo := LoginInfo { username, password }
+ loginInfo := LoginInfo{username, password}
l, err := NewLdapCon()
if err != nil {