login-validator: Refactor, search csv in /data dir
This commit is contained in:
parent
679668e2c2
commit
50ad1f0712
4 changed files with 16 additions and 12 deletions
|
|
@ -52,7 +52,7 @@ func main() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
|
||||
var lc loginChecker
|
||||
lc := &loginChecker{}
|
||||
|
||||
if auth != nil && *auth == "ldap" {
|
||||
log.Printf("Auth method: LDAP(%s@%s:%d?%s)", *ldapbindusername, *ldapAddr, *ldapPort, *ldapbase)
|
||||
|
|
@ -87,6 +87,7 @@ func main() {
|
|||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Printf("%d students loaded", len(lc.students))
|
||||
|
||||
// Prepare graceful shutdown
|
||||
interrupt := make(chan os.Signal, 1)
|
||||
|
|
@ -100,7 +101,7 @@ func main() {
|
|||
|
||||
log.Println("Registering handlers...")
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/login", &lc)
|
||||
mux.Handle("/login", lc)
|
||||
mux.HandleFunc("/logout", logout)
|
||||
mux.HandleFunc("/passwd", passwd)
|
||||
http.HandleFunc("/", mux.ServeHTTP)
|
||||
|
|
|
|||
Reference in a new issue