[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/ -> password_forgotten.php (source)

   1  <?php
   2  /*

   3  $Id: password_forgotten.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2006 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  
  13  // Most of this file is changed or moved to BTS - Basic Template System - format.

  14  // For adding in contribution or modification - parts of this file has been moved to: catalog\templates\fallback\contents\<filename>.tpl.php as a default (sub 'fallback' with your current template to see if there is a template specife change).

  15  //       catalog\templates\fallback\contents\<filename>.tpl.php as a default (sub 'fallback' with your current template to see if there is a template specife change).

  16  // (Sub 'fallback' with your current template to see if there is a template specific file.)

  17  
  18    require ('includes/application_top.php');
  19  
  20    require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PASSWORD_FORGOTTEN);
  21  
  22    if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
  23      $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
  24  
  25      $check_customer_query = tep_db_query("select customers_firstname, customers_lastname, customers_password, customers_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
  26      if (tep_db_num_rows($check_customer_query)) {
  27        $check_customer = tep_db_fetch_array($check_customer_query);
  28  
  29        $new_password = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
  30        $crypted_password = tep_encrypt_password($new_password);
  31  
  32        tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_db_input($crypted_password) . "' where customers_id = '" . (int)$check_customer['customers_id'] . "'");
  33  
  34        tep_mail($check_customer['customers_firstname'] . ' ' . $check_customer['customers_lastname'], $email_address, EMAIL_PASSWORD_REMINDER_SUBJECT, sprintf(EMAIL_PASSWORD_REMINDER_BODY, $new_password), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
  35  
  36        $messageStack->add_session('login', SUCCESS_PASSWORD_SENT, 'success');
  37  
  38        tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  39      } else {
  40        $messageStack->add('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND);
  41      }
  42    }
  43  
  44    $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  45    $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL'));
  46  
  47    $content = CONTENT_PASSWORD_FORGOTTEN;
  48  
  49    include (bts_select('main', $content_template)); // BTSv1.5

  50  
  51    require (DIR_WS_INCLUDES . 'application_bottom.php');
  52  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7