mirror of
https://github.com/pivpn/pivpn.git
synced 2024-12-20 20:00:16 +00:00
Disallow integers as client names to avoid ambiguity when removing a client by index.
This commit is contained in:
parent
0200ce545c
commit
85478aaea0
2 changed files with 10 additions and 0 deletions
|
@ -248,6 +248,11 @@ if [[ "${NAME}" =~ [^a-zA-Z0-9.@_-] ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${NAME}" =~ ^[0-9]+$ ]]; then
|
||||||
|
echo "Names cannot be integers."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z "${NAME}" ]]; then
|
if [[ -z "${NAME}" ]]; then
|
||||||
echo "You cannot leave the name blank."
|
echo "You cannot leave the name blank."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -64,6 +64,11 @@ if [[ "${CLIENT_NAME}" =~ [^a-zA-Z0-9.@_-] ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${CLIENT_NAME}" =~ ^[0-9]+$ ]]; then
|
||||||
|
echo "Names cannot be integers."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "${CLIENT_NAME}" ]; then
|
if [ -z "${CLIENT_NAME}" ]; then
|
||||||
echo "::: You cannot leave the name blank."
|
echo "::: You cannot leave the name blank."
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue