| [ Index ] |
|
Code source de osCommerce 2.2ms2-060817 |
1 <?php 2 /* 3 $Id: password_forgotten.php,v 1.50 2003/06/05 23:28:24 hpdl Exp $ 4 5 osCommerce, Open Source E-Commerce Solutions 6 http://www.oscommerce.com 7 8 Copyright (c) 2003 osCommerce 9 10 Released under the GNU General Public License 11 */ 12 13 require ('includes/application_top.php'); 14 15 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PASSWORD_FORGOTTEN); 16 17 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) { 18 $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']); 19 20 $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) . "'"); 21 if (tep_db_num_rows($check_customer_query)) { 22 $check_customer = tep_db_fetch_array($check_customer_query); 23 24 $new_password = tep_create_random_value(ENTRY_PASSWORD_MIN_LENGTH); 25 $crypted_password = tep_encrypt_password($new_password); 26 27 tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . tep_db_input($crypted_password) . "' where customers_id = '" . (int)$check_customer['customers_id'] . "'"); 28 29 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); 30 31 $messageStack->add_session('login', SUCCESS_PASSWORD_SENT, 'success'); 32 33 tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); 34 } else { 35 $messageStack->add('password_forgotten', TEXT_NO_EMAIL_ADDRESS_FOUND); 36 } 37 } 38 39 $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_LOGIN, '', 'SSL')); 40 $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL')); 41 ?> 42 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> 43 <html <?php echo HTML_PARAMS; ?>> 44 <head> 45 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 46 <title><?php echo TITLE; ?></title> 47 <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> 48 <link rel="stylesheet" type="text/css" href="stylesheet.css"> 49 </head> 50 <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> 51 <!-- header //--> 52 <?php require(DIR_WS_INCLUDES . 'header.php'); ?> 53 <!-- header_eof //--> 54 55 <!-- body //--> 56 <table border="0" width="100%" cellspacing="3" cellpadding="3"> 57 <tr> 58 <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> 59 <!-- left_navigation //--> 60 <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> 61 <!-- left_navigation_eof //--> 62 </table></td> 63 <!-- body_text //--> 64 <td width="100%" valign="top"><?php echo tep_draw_form('password_forgotten', tep_href_link(FILENAME_PASSWORD_FORGOTTEN, 'action=process', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> 65 <tr> 66 <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> 67 <tr> 68 <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> 69 <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_password_forgotten.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> 70 </tr> 71 </table></td> 72 </tr> 73 <tr> 74 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 75 </tr> 76 <?php 77 if ($messageStack->size('password_forgotten') > 0) { 78 ?> 79 <tr> 80 <td><?php echo $messageStack->output('password_forgotten'); ?></td> 81 </tr> 82 <tr> 83 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 84 </tr> 85 <?php 86 } 87 ?> 88 <tr> 89 <td><table border="0" width="100%" height="100%" cellspacing="1" cellpadding="2" class="infoBox"> 90 <tr class="infoBoxContents"> 91 <td><table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2"> 92 <tr> 93 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 94 </tr> 95 <tr> 96 <td class="main" colspan="2"><?php echo TEXT_MAIN; ?></td> 97 </tr> 98 <tr> 99 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 100 </tr> 101 <tr> 102 <td class="main"><?php echo '<b>' . ENTRY_EMAIL_ADDRESS . '</b> ' . tep_draw_input_field('email_address'); ?></td> 103 </tr> 104 <tr> 105 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 106 </tr> 107 </table></td> 108 </tr> 109 </table></td> 110 </tr> 111 <tr> 112 <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 113 </tr> 114 <tr> 115 <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> 116 <tr class="infoBoxContents"> 117 <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> 118 <tr> 119 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 120 <td><?php echo '<a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td> 121 <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> 122 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> 123 </tr> 124 </table></td> 125 </tr> 126 </table></td> 127 </tr> 128 </table></form></td> 129 <!-- body_text_eof //--> 130 <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> 131 <!-- right_navigation //--> 132 <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> 133 <!-- right_navigation_eof //--> 134 </table></td> 135 </tr> 136 </table> 137 <!-- body_eof //--> 138 139 <!-- footer //--> 140 <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> 141 <!-- footer_eof //--> 142 <br> 143 </body> 144 </html> 145 <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Mon Nov 26 19:48:25 2007 | par Balluche grâce à PHPXref 0.7 |
|