token-validator: better calculate IP contained
This commit is contained in:
parent
6fcdc44952
commit
d28b14fa50
3 changed files with 11 additions and 2 deletions
|
|
@ -246,7 +246,7 @@ func AddAssociatedDomains(student adlin.Student, aaaa net.IP) (err error) {
|
|||
|
||||
if aaaa == nil {
|
||||
aaaa = net.ParseIP(adlin.StudentIP(student.Id).String() + "1")
|
||||
} else if !strings.HasPrefix(aaaa.String(), adlin.StudentIP(student.Id).String()) {
|
||||
} else if !adlin.StudentNet(student.Id).Contains(aaaa) {
|
||||
return errors.New("The associated IP has to be in your IP range.")
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue