mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
1 letter username. fixes #96
This commit is contained in:
parent
11a27358d2
commit
d4b5bddeef
1 changed files with 11 additions and 4 deletions
15
func/main.sh
15
func/main.sh
|
@ -616,10 +616,17 @@ validate_format_name_s() {
|
||||||
|
|
||||||
# Username
|
# Username
|
||||||
validate_format_username() {
|
validate_format_username() {
|
||||||
if ! [[ "$1" =~ ^[a-zA-Z0-9][-|\.|_|a-zA-Z0-9]{0,28}[a-zA-Z0-9]$ ]]; then
|
if [ "${#1}" -eq 1 ]; then
|
||||||
echo "Error: $2 $1 is not valid"
|
if ! [[ "$1" =~ [a-z] ]]; then
|
||||||
log_event "$E_INVALID" "$EVENT"
|
echo "Error: $2 $1 is not valid"
|
||||||
exit $E_INVALID
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if ! [[ "$1" =~ ^[a-zA-Z0-9][-|\.|_|a-zA-Z0-9]{0,28}[a-zA-Z0-9]$ ]]
|
||||||
|
then
|
||||||
|
echo "Error: $2 $1 is not valid"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue