From 50fb91374715cf3ecbe7b3d75dcf4a98b17faf58 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 22 May 2017 14:35:40 +0100 Subject: [PATCH] Failure message for short passwords --- src/freedombone-app-searx | 3 +-- src/freedombone-controlpanel | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/freedombone-app-searx b/src/freedombone-app-searx index afa4eaa3..e9753120 100755 --- a/src/freedombone-app-searx +++ b/src/freedombone-app-searx @@ -201,11 +201,10 @@ function change_password_searx { new_username="$1" new_user_password="$2" - ${PROJECT_NAME}-pass -u $new_username -a searx -p "$new_user_password" - if grep -q "$new_username:" /etc/nginx/.htpasswd; then sed -i "/$new_username:/d" /etc/nginx/.htpasswd echo "$new_user_password" | htpasswd -i -s -c /etc/nginx/.htpasswd $new_username + ${PROJECT_NAME}-pass -u $curr_username -a searx -p "$new_user_password" echo '0' fi echo '1' diff --git a/src/freedombone-controlpanel b/src/freedombone-controlpanel index a1c19a85..feb717c5 100755 --- a/src/freedombone-controlpanel +++ b/src/freedombone-controlpanel @@ -229,6 +229,9 @@ function view_or_change_passwords { change_password_${SELECTED_APP} ${SELECTED_USERNAME} "${CURR_PASSWORD}" dialog --title $"Change password" \ --msgbox $"The password was changed" 6 40 + else + dialog --title $"Change password" \ + --msgbox $"The password given must be at least 8 characters" 6 40 fi ;; esac