function generate_cart_id($length = 5) { return vam_create_random_value($length, 'digits'); }
vam_php_mail(EMAIL_SUPPORT_ADDRESS, EMAIL_SUPPORT_NAME, $check_customer['customers_email_address'], '', '', EMAIL_SUPPORT_REPLY_ADDRESS, EMAIL_SUPPORT_REPLY_ADDRESS_NAME, '', '', TEXT_EMAIL_PASSWORD_FORGOTTEN, $html_mail, $txt_mail); } } else { $case = code_error; $info_message = TEXT_CODE_ERROR; } } // Verification if (isset($_GET['action']) && $_GET['action'] == 'verified') { $check_customer_query = vam_db_query("select customers_id, customers_email_address, password_request_key from " . TABLE_CUSTOMERS . " where customers_id = '" . (int) $_GET['customers_id'] . "' and password_request_key = '" . vam_db_input($_GET['key']) . "'"); $check_customer = vam_db_fetch_array($check_customer_query); if (!vam_db_num_rows($check_customer_query) || $_GET['key'] == "") { $case = no_account; $info_message = TEXT_NO_ACCOUNT; } else { $newpass = vam_create_random_value(ENTRY_PASSWORD_MIN_LENGTH); $crypted_password = vam_encrypt_password($newpass); vam_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '******' where customers_email_address = '" . $check_customer['customers_email_address'] . "'"); vam_db_query("update " . TABLE_CUSTOMERS . " set password_request_key = '' where customers_id = '" . $check_customer['customers_id'] . "'"); // assign language to template for caching $vamTemplate->assign('language', $_SESSION['language']); $vamTemplate->assign('tpl_path', 'templates/' . CURRENT_TEMPLATE . '/'); $vamTemplate->assign('logo_path', HTTP_SERVER . DIR_WS_CATALOG . 'templates/' . CURRENT_TEMPLATE . '/img/'); // assign vars $vamTemplate->assign('EMAIL', $check_customer['customers_email_address']); $vamTemplate->assign('NEW_PASSWORD', $newpass); // dont allow cache $vamTemplate->caching = false; // create mails $html_mail = $vamTemplate->fetch(CURRENT_TEMPLATE . '/mail/' . $_SESSION['language'] . '/new_password_mail.html'); $txt_mail = $vamTemplate->fetch(CURRENT_TEMPLATE . '/mail/' . $_SESSION['language'] . '/new_password_mail.txt');