fixes in mailcode.shs
parent
7df39b75aa
commit
35660d4705
|
@ -4,15 +4,16 @@ if ! session_verify "${cookies[sh_session]}"; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
source "${cfg[namespace]}/code/common.sh"
|
||||||
|
|
||||||
if [[ "${post_data[code]}" != '' && "${post_data[phone]}" != '' ]]; then
|
if [[ "${post_data[code]}" != '' && "${post_data[phone]}" != '' ]]; then
|
||||||
username="$(session_get_username ${cookies[sh_session]})"
|
username="$(session_get_username "${cookies[sh_session]}")"
|
||||||
mail="$(get_account_mail $username)"
|
mail="$(get_account_mail $username)"
|
||||||
if [[ "$(cat secret/mail.dat | grep "$username:" | grep ":${post_data[code]}:")" != '' ]]; then
|
if [[ "$(cat secret/mail.dat | grep "$username:" | grep ":${post_data[code]}:")" != '' ]]; then
|
||||||
sed -i "s/$username:$mail:${post_data[code]}:no/$username:$mail:${post_data[code]}:yes/" secret/mail.dat
|
sed -i "s/$username:$mail:${post_data[code]}:no/$username:$mail:${post_data[code]}:yes/" secret/mail.dat
|
||||||
curl -s "https://api-inmobile-pl.easypack24.net/v1/sendSMSCode/${post_data[phone]}" > /dev/null
|
curl -s "https://api-inmobile-pl.easypack24.net/v1/sendSMSCode/${post_data[phone]}" > /dev/null
|
||||||
jq -n '{status: $ARGS.positional[0], msg: $ARGS.positional[1]}' --args 200 "success"
|
jq -n '{status: $ARGS.positional[0], msg: $ARGS.positional[1]}' --args 200 "success"
|
||||||
elif [[ $status == 1 && $reason != '' ]]; then
|
elif [[ $status == 1 ]]; then
|
||||||
jq -n '{status: $ARGS.positional[0], msg: $ARGS.positional[1]}' --args -1 "$reason"
|
jq -n '{status: $ARGS.positional[0], msg: $ARGS.positional[1]}' --args -1 "$reason"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue