HTTP_HOST="$(HEADER Host)"
+[ "$HTTPS" ] && SCHEMA=https || SCHEMA=http
+
# == FILE FORMAT ==
# UID UNAME STATUS EMAIL PWSALT PWHASH EXPIRE DEVICES FUTUREUSE
# (pending|active|deleted)
REDIRECT "${_BASE}${PATH_INFO}#ERROR_EMAIL_EXISTS"
elif new_user "$uid" status=pending email="$email" expire="$((_DATE + 86400))"; then
debug "Sending Activation Link:" \
- "https://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")"
+ "${SCHEMA}://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")"
"$SENDMAIL" -t -f "$MAILFROM" <<-EOF
From: ${MAILFROM}
To: ${email}
You can activate your account using this link:
- https://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")
+ ${SCHEMA}://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")
This registration link will expire after 24 hours.
REDIRECT "${_BASE}${PATH_INFO}#ERROR_EMAIL_EXISTS"
elif new_user "$uid" status=pending email="$email" expire="$((_DATE + 86400))"; then
debug "Sending Invitation Link:" \
- "https://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")"
+ "${SCHEMA}://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")"
"$SENDMAIL" -t -f "$MAILFROM" <<-EOF
From: ${MAILFROM}
To: ${email}
You can create your account using this link:
- https://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")
+ ${SCHEMA}://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")
This registration link will expire after 24 hours.
new_user "$uid" status=pending email="$email" expire="$((_DATE + 86400))"
cat <<-EOF
[p An anonymous user account has been set up. Send the following link to the intended user, so they may claim their account. The link will remain valid for 24 hours.]
- [p . $(HTML "https://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")" |debug)]
+ [p . $(HTML "${SCHEMA}://${HTTP_HOST}${_BASE}${PATH_INFO}?user_confirm=${uid}+$(session_mac "$uid")" |debug)]
[p [a href="#" . Set up another account]]
EOF