X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=users.sh;h=be68a8acbe04ca0864917f92b0aef9541536429a;hb=0591b0842c75fd078d19e488f5e4a8d047052551;hp=d738ee94ec70a9ac6a55a5cc2321b0628063be4a;hpb=3055b170b4be8a5a0939a0394ef470b90208e7ff;p=cgilite diff --git a/users.sh b/users.sh index d738ee9..be68a8a 100755 --- a/users.sh +++ b/users.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2021 - 2023 Paul Hänsch +# Copyright 2021 - 2024 Paul Hänsch # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -17,8 +17,8 @@ [ -n "$include_users" ] && return 0 include_users="$0" -. "${_EXEC}/cgilite/session.sh" -. "${_EXEC}/cgilite/storage.sh" +. "${_EXEC:-.}/cgilite/session.sh" +. "${_EXEC:-.}/cgilite/storage.sh" SENDMAIL=${SENDMAIL-sendmail} @@ -274,7 +274,7 @@ user_register(){ fi if [ "$USER_REQUIREEMAIL" = true ]; then - if [ ! "email" ]; then + if [ ! "$email" ]; then REDIRECT "${_BASE}${PATH_INFO}#ERROR_EMAIL_INVALID" elif user_emailexist "$email"; then REDIRECT "${_BASE}${PATH_INFO}#ERROR_EMAIL_EXISTS" @@ -342,7 +342,7 @@ user_invite(){ local email="$(POST email |user_checkemail)" local message="$(POST message)" - if [ ! "email" ]; then + if [ ! "$email" ]; then REDIRECT "${_BASE}${PATH_INFO}#ERROR_EMAIL_INVALID" elif user_emailexist "$email"; then REDIRECT "${_BASE}${PATH_INFO}#ERROR_EMAIL_EXISTS" @@ -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" @@ -638,7 +638,7 @@ w_user_invite(){ w_user_login_logon(){ # TRANSLATION cat <<-EOF [form #user_login .login method=POST - [input name=uname placeholder="Username or Email" autocomplete=off] + [input name=uname placeholder="Username or Email"] [input type=password name=pw placeholder="Passphrase"] [submit "action" "user_login" Login] ]