|
@@ -738,6 +738,11 @@ is_localpart_format_valid() {
|
|
|
|
|
|
|
|
# Username / ftp username format validator
|
|
# Username / ftp username format validator
|
|
|
is_user_format_valid() {
|
|
is_user_format_valid() {
|
|
|
|
|
+ # Reject purely numeric names like "123"
|
|
|
|
|
+ if [[ "$1" =~ ^[0-9]+$ ]]; then
|
|
|
|
|
+ check_result "$E_INVALID" "invalid $2 format :: $1"
|
|
|
|
|
+ fi
|
|
|
|
|
+
|
|
|
if [ ${#1} -eq 1 ]; then
|
|
if [ ${#1} -eq 1 ]; then
|
|
|
if ! [[ "$1" =~ ^^[[:alnum:]]$ ]]; then
|
|
if ! [[ "$1" =~ ^^[[:alnum:]]$ ]]; then
|
|
|
check_result "$E_INVALID" "invalid $2 format :: $1"
|
|
check_result "$E_INVALID" "invalid $2 format :: $1"
|