2024-02-24 10:28:12 +01:00
|
|
|
package ui
|
|
|
|
|
2024-02-24 12:10:34 +01:00
|
|
|
func inputsEmpty(user, pass, pass2, first, last, role string) bool {
|
|
|
|
return len(user) == 0 ||
|
|
|
|
len(pass) == 0 ||
|
|
|
|
len(pass2) == 0 ||
|
|
|
|
len(first) == 0 ||
|
|
|
|
len(last) == 0 ||
|
|
|
|
len(role) == 0
|
|
|
|
}
|
|
|
|
|
2024-02-24 10:28:12 +01:00
|
|
|
func checkUserStrings(user, first, last string) (string, int, bool) {
|
|
|
|
userLen := 15
|
|
|
|
nameLen := 50
|
|
|
|
|
|
|
|
if len(user) > userLen {
|
|
|
|
return user, userLen, false
|
|
|
|
} else if len(first) > nameLen {
|
|
|
|
return first, nameLen, false
|
|
|
|
} else if len(last) > nameLen {
|
|
|
|
return last, nameLen, false
|
|
|
|
} else {
|
|
|
|
return "", 0, true
|
|
|
|
}
|
|
|
|
}
|