master
Dominika Liberda 2020-10-29 23:28:09 +01:00
parent 35660d4705
commit c8ac4fdd90
1 changed files with 5 additions and 3 deletions

View File

@ -2,18 +2,20 @@
source "${cfg[namespace]}/code/common.sh"
if [[ "${post_data[login]}" != '' && "${post_data[password]}" != '' && "${post_data[mail]}" != '' ]]; then
if ! check_mail "${post_data[mail]}"; then
mail="$(echo "${post_data[mail]}" | sed -s 's/%40/@/')"
if ! check_mail "$mail"; then
status=1
reason="This mail address is already in use!"
else
register "${post_data[login]}" "${post_data[password]}"
status=$?
verification="$RANDOM"
echo "${post_data[login]}:${post_data[mail]}:$verification:no" >> secret/mail.dat
echo "${post_data[login]}:$mail:$verification:no" >> secret/mail.dat
fi
if [[ $status == 0 ]]; then
sender_name="${cfg[who]}" mailsend "${post_data[mail]}" "OCW mail verification" "Hi ${post_data[login]},
sender_name="${cfg[who]}" mailsend "$mail" "OCW mail verification" "Hi ${post_data[login]},
Your code: $verification