<?php

$text = $languageForm['forgottenPassword'];

$error['forgottenPassword']['form'] = [];

do {
    if (isset($_POST) && isset($_POST['emailAddress'])) {
        if (empty($_POST['emailAddress'])) {
            $error['forgottenPassword']['form']['emailAddress'][] = $languageValidation['emailAddress']['name'] . $languageStd['empty'];
        }

        if (!filter_var($_POST['emailAddress'], FILTER_VALIDATE_EMAIL)) {
            $error['forgottenPassword']['form']['emailAddress'][] = $languageValidation['emailAddress']['validation'];
        }

        if (count($error['forgottenPassword']['form'])) {
            break;
        }

        $data = [
            'emailAddress' => $_POST['emailAddress']
        ];

        $json = "";
		
		break;

        if (api(API_REQ_RESET_PASSWORD, $data, $json)) {
            $success['forgottenPassword'][] = $languageSuccess['forgottenPassword']['sent'];

            break;
        }

        $error['forgottenPassword']['form']['wrongMail'][] = $languageError['forgottenPassword']['wrongMail'];
    }
} while (0);
