diff --git a/src/freedombone-adduser b/src/freedombone-adduser index 9530ff20f0b09c54e8ff60a1eb4e3fdb36ce9467..c50d8a5de74554d95249bed9db178fe8bd22fc3b 100755 --- a/src/freedombone-adduser +++ b/src/freedombone-adduser @@ -31,8 +31,6 @@ PROJECT_NAME='freedombone' export TEXTDOMAIN=${PROJECT_NAME}-adduser export TEXTDOMAINDIR="/usr/share/locale" -MAXIMUM_USERS=10 - CONFIGURATION_FILE="$HOME/${PROJECT_NAME}.cfg" UTILS_FILES="/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*" @@ -76,7 +74,7 @@ if [ ! -f "$COMPLETION_FILE" ]; then fi # shellcheck disable=SC2126 -no_of_users=$(find /home/ -maxdepth 1 -type d | grep -Fxv "/home/go" | grep -Fxv "/home/gogs" | grep -Fxv "/home/pihole" | grep -Fxv "/home/" | wc -l) +no_of_users=$(find /home/ -maxdepth 1 -type d | grep -Fxv "/home/znc" | grep -Fxv "/home/turtl" | grep -Fxv "/home/go" | grep -Fxv "/home/gogs" | grep -Fxv "/home/git" | grep -Fxv "/home/pihole" | grep -Fxv "/home/" | grep -Fxv "/home/tahoelafs" | grep -Fxv "/home/sync" | wc -l) # shellcheck disable=SC2086 if [ $no_of_users -ge $MAXIMUM_USERS ]; then diff --git a/src/freedombone-installer b/src/freedombone-installer index 99c3bbf1844db4a7b60cb07814205bf29cb3c625..5bbbcfcb689ea4535f4d6fe054c9a2ba43ae4ef6 100755 --- a/src/freedombone-installer +++ b/src/freedombone-installer @@ -797,8 +797,8 @@ function web_admin_create_users { { echo ' <div class="chip">'; echo " <a href=\"new_user.html\" title=\"${translated_add_user}\">"; - echo ' <img src="images/user_admin.png" alt="Person" width="96" height="96">'; - echo ' +'; + echo ' <img src="images/user.png" alt="Person" width="96" height="96">'; + echo ' <div class="adduser">+</div>'; echo ' </a>'; echo ' </div>'; echo ' </div>'; diff --git a/src/freedombone-utils-webadmin b/src/freedombone-utils-webadmin index a33cc2ff761737e80fd9c980f2a68ebbe1c2ba84..c5bc7c8e03b650559e3ee204509e6941dfcd41f0 100755 --- a/src/freedombone-utils-webadmin +++ b/src/freedombone-utils-webadmin @@ -33,6 +33,8 @@ WEBADMIN_LOGIN_TEXT=$"Welcome to ${PROJECT_NAME}" +MAXIMUM_USERS=10 + WEBADMIN_ONION_PORT=5783 function web_admin_background_color { @@ -361,13 +363,20 @@ function web_admin_create_users { translated_add_user=$(web_admin_translate_text "Add a new member") - { echo ' <div class="chip">'; - echo " <a href=\"new_user.html\" title=\"${translated_add_user}\">"; - echo ' <img src="images/user.png" alt="Person" width="96" height="96">'; - echo ' <div class="adduser">+</div>'; - echo ' </a>'; - echo ' </div>'; - echo ' </div>'; + # shellcheck disable=SC2126 + no_of_users=$(find /home/ -maxdepth 1 -type d | grep -Fxv "/home/znc" | grep -Fxv "/home/turtl" | grep -Fxv "/home/go" | grep -Fxv "/home/gogs" | grep -Fxv "/home/git" | grep -Fxv "/home/pihole" | grep -Fxv "/home/" | grep -Fxv "/home/tahoelafs" | grep -Fxv "/home/sync" | wc -l) + + # shellcheck disable=SC2086 + if [ $no_of_users -lt $MAXIMUM_USERS ]; then + { echo ' <div class="chip">'; + echo " <a href=\"new_user.html\" title=\"${translated_add_user}\">"; + echo ' <img src="images/user.png" alt="Person" width="96" height="96">'; + echo ' <div class="adduser">+</div>'; + echo ' </a>'; + echo ' </div>'; } >> "$users_file" + fi + + { echo ' </div>'; echo ' </div>'; echo ' </body>'; echo '</html>'; } >> "$users_file"