include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php'; } else { $step = 2; $error = $lang_module['answer_failed']; } } } else { $step = 1; $nv_Request->unset_request('lostpass_seccode', 'session'); $error = $lang_module['lostpass_no_info2']; } } else { $step = 1; $nv_Request->unset_request('lostpass_seccode', 'session'); $error = $lang_module['lostpass_no_info1']; } } else { $step = 1; $nv_Request->unset_request('lostpass_seccode', 'session'); $error = $lang_global['securitycodeincorrect']; } } $data['step'] = $step; $data['info'] = empty($error) ? $lang_module['step' . $data['step']] : '<span style="color:#fb490b;">' . $error . '</span>'; $contents = user_lostpass($data, $question); } include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php';
if ($data['step'] == 'step3') { die(json_encode(array('status' => 'error', 'input' => 'new_password', 'step' => 'step4', 'info' => $lang_module['lostpass_newpass_mess'], 'mess' => $lang_module['lostpass_newpass_mess']))); } $new_password = $nv_Request->get_title('new_password', 'post', ''); $re_password = $nv_Request->get_title('re_password', 'post', ''); if (($check_new_password = nv_check_valid_pass($new_password, NV_UPASSMAX, NV_UPASSMIN)) != '') { die(json_encode(array('status' => 'error', 'input' => 'new_password', 'step' => 'step4', 'info' => $lang_module['lostpass_newpass_mess'], 'mess' => $check_new_password))); } if ($new_password != $re_password) { die(json_encode(array('status' => 'error', 'input' => 're_password', 'step' => 'step4', 'info' => $lang_module['lostpass_newpass_mess'], 'mess' => $lang_global['passwordsincorrect']))); } $re_password = $crypt->hash_password($new_password, $global_config['hashprefix']); $stmt = $db->prepare("UPDATE " . NV_MOD_TABLE . " SET password= :password, passlostkey='' WHERE userid=" . $row['userid']); $stmt->bindParam(':password', $re_password, PDO::PARAM_STR); $stmt->execute(); $name = $global_config['name_show'] ? array($row['first_name'], $row['last_name']) : array($row['last_name'], $row['first_name']); $name = array_filter($name); $name = implode(' ', $name); $sitename = '<a href="' . NV_MY_DOMAIN . NV_BASE_SITEURL . '">' . $global_config['site_name'] . '</a>'; $message = sprintf($lang_module['edit_mail_content'], $name, $sitename, $lang_global['password'], $new_password); @nv_sendmail($global_config['site_email'], $row['email'], $lang_module['edit_mail_subject'], $message); $redirect = nv_redirect_decrypt($nv_redirect, true); $url = !empty($redirect) ? $redirect : nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name, true); die(json_encode(array('status' => 'ok', 'input' => $url, 'step' => '', 'mess' => $lang_module['editinfo_ok']))); } $page_title = $mod_title = $lang_module['lostpass_page_title']; $key_words = $module_info['keywords']; $contents = user_lostpass($data); include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php';