#!/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
[ -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}
USER_ACCOUNTEXPIRE="${USER_ACCOUNTEXPIRE:-$((86400 * 730))}"
USER_CONFIRMEXPIRE="${USER_CONFIRMEXPIRE:-86400}"
-MAILFROM="${MAILDOMAIN-noreply@${HTTP_HOST%:*}}"
-
HTTP_HOST="$(HEADER Host)"
+MAILFROM="noreply@${HTTP_HOST%:*}"
[ "$HTTPS" ] && SCHEMA=https || SCHEMA=http
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"
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"