]> git.plutz.net Git - cgilite/blobdiff - users.sh
Bugfix: faulty email address check
[cgilite] / users.sh
index 4d7965a57b260f5dc1a50ad4bc3f0411b0c07c0e..be68a8acbe04ca0864917f92b0aef9541536429a 100755 (executable)
--- 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"