]> git.plutz.net Git - cgilite/commitdiff
bugfix: faulty validation in user_update made pw change impossible
authorPaul Hänsch <paul@plutz.net>
Fri, 16 Feb 2024 17:39:18 +0000 (18:39 +0100)
committerPaul Hänsch <paul@plutz.net>
Fri, 16 Feb 2024 17:39:18 +0000 (18:39 +0100)
users.sh

index f616ca02baca5d07c7199640ab436e064f4d405a..4d7965a57b260f5dc1a50ad4bc3f0411b0c07c0e 100755 (executable)
--- a/users.sh
+++ b/users.sh
@@ -429,7 +429,7 @@ user_update(){
 
         uid="$(POST uid)"
       oldpw="$(POST oldpw)"
-         pw="$(POST pw |grep -xE '.{6}')"
+         pw="$(POST pw |grep -m1 -xE '.{6,}')"
   pwconfirm="$(POST pwconfirm)"
 
 
@@ -442,7 +442,7 @@ user_update(){
       update_user "${uid}" password="$pw"
       REDIRECT "${_BASE}${PATH_INFO}#UPDATE_SUCCESS"
     else
-      REDIRECT "${_BASE}${PATH_INFO}#ERROR_PWMISMATCH"
+      REDIRECT "${_BASE}${PATH_INFO}#ERROR_PW_MISMATCH"
     fi
   elif [ "$UID_" = "$USER_ID" ]; then
     REDIRECT "${_BASE}${PATH_INFO}#ERROR_INVALID_AUTH_PASSWORD"