* ---------------------- */ $obj = new AjaxRequest(); include '../../application/functions.php'; include '../../application/DataConfig.php'; $_POST['idhash'] = trim($_POST['idhash']); if (mb_strlen($_POST['pass_1'], 'utf8') < 5 || mb_strlen($_POST['pass_1'], 'utf8') > 20) { echo json_encode(array('response' => $_SESSION['LANG']['pass_length'], 'focus' => 'pass_1')); } else { if (mb_strlen($_POST['pass_2'], 'utf8') < 5 || mb_strlen($_POST['pass_2'], 'utf8') > 20) { echo json_encode(array('response' => $_SESSION['LANG']['pass_confirm_length'], 'focus' => 'pass_2')); } else { if ($_POST['pass_2'] !== $_POST['pass_1']) { echo json_encode(array('response' => $_SESSION['LANG']['pass_match'], 'focus' => 'pass_2')); } else { $res = $obj->updatePasswordRecover(); if ($res == 1) { echo json_encode(array('response' => 'true', 'success' => $_SESSION['LANG']['success_pass_update'])); } else { echo json_encode(array('response' => $_SESSION['LANG']['error'])); } // ELSE } } } // ELSE } else { echo json_encode(array('reload' => 1)); } } else { echo json_encode(array('response' => 'All fields required.'));