login-validator: New parameter -just-login
This commit is contained in:
parent
a2a056f3ff
commit
d5a67e2bbb
2 changed files with 12 additions and 1 deletions
|
|
@ -15,7 +15,10 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
var loginSalt string
|
||||
var (
|
||||
loginSalt string
|
||||
justLogin bool
|
||||
)
|
||||
|
||||
type loginChecker struct {
|
||||
students []Student
|
||||
|
|
@ -81,6 +84,12 @@ func (l loginChecker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
if justLogin {
|
||||
log.Println("Successful login of", lu.Username, "at", r.RemoteAddr)
|
||||
http.Error(w, "You're now successfully logged.", http.StatusOK)
|
||||
return
|
||||
}
|
||||
|
||||
// Find corresponding MAC
|
||||
var ip net.IP
|
||||
spl := strings.SplitN(r.RemoteAddr, ":", 2)
|
||||
|
|
|
|||
Reference in a new issue