[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 password_forgotten.php

Zen Cart 源代码 password_forgotten.php




下载文件

文件名: password_forgotten.php
文件类型: PHP文件
文件大小: 4.1 KiB
MD5: ccc9f6cb04ed42100b3e3f6dcc77390e

password_forgotten.php - 关闭高亮
  1. <?php
  2. //
  3. // +----------------------------------------------------------------------+
  4. // |zen-cart Open Source E-commerce                                       |
  5. // +----------------------------------------------------------------------+
  6. // | Copyright (c) 2003 The zen-cart developers                           |
  7. // |                                                                      |
  8. // | http://www.zen-cart.com/index.php                                    |
  9. // |                                                                      |
  10. // | Portions Copyright (c) 2003 osCommerce                               |
  11. // +----------------------------------------------------------------------+
  12. // | This source file is subject to version 2.0 of the GPL license,       |
  13. // | that is bundled with this package in the file LICENSE, and is        |
  14. // | available through the world-wide-web at the following url:           |
  15. // | http://www.zen-cart.com/license/2_0.txt.                             |
  16. // | If you did not receive a copy of the zen-cart license and are unable |
  17. // | to obtain it through the world-wide-web, please send a note to       |
  18. // | license@zen-cart.com so we can mail you a copy immediately.          |
  19. // +----------------------------------------------------------------------+
  20. //$Id: password_forgotten.php 17904 2010-10-09 21:24:41Z wilt $
  21. //
  22.  
  23.   require('includes/application_top.php');
  24.  
  25.   // demo active test
  26.   if (zen_admin_demo()) {
  27.     $_GET['action']= '';
  28.     $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
  29.     zen_redirect(zen_href_link(FILENAME_DEFAULT));
  30.   }
  31.  
  32.   if (isset($_POST['login'])) {
  33.     zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
  34.   }
  35.  
  36. $error_check = false;
  37.  
  38. if (isset($_POST['submit'])) {
  39.  
  40.   if ( !$_POST['admin_email'] ) {
  41.     $error_check = true;
  42.     $email_message = ERROR_WRONG_EMAIL_NULL;
  43.   }
  44.  
  45.   $admin_email = zen_db_prepare_input($_POST['admin_email']);
  46.  
  47.   $sql = "select admin_id, admin_name, admin_email, admin_pass from " . TABLE_ADMIN . " where admin_email = '" . zen_db_input($admin_email) . "'";
  48.  
  49.   $result = $db->Execute($sql);
  50.  
  51.   if (!($admin_email == $result->fields['admin_email'])) {
  52.     $error_check = true;
  53.     $email_message = ERROR_WRONG_EMAIL;
  54.   }
  55.  
  56.   if ($error_check == false) {
  57.  
  58.     $new_password = zen_create_random_value(ENTRY_PASSWORD_MIN_LENGTH);
  59.     $admin_pass = zen_encrypt_password($new_password);
  60.     $sql = "update " . TABLE_ADMIN . " set admin_pass = '" . zen_db_input($admin_pass) . "' where admin_email = '" . $result->fields['admin_email'] . "'";
  61.  
  62.     $db->Execute($sql);
  63.  
  64.     $html_msg['EMAIL_CUSTOMERS_NAME'] = $result->fields['admin_name'];
  65.     $html_msg['EMAIL_MESSAGE_HTML'] = sprintf(TEXT_EMAIL_MESSAGE, $new_password);
  66.     zen_mail($result->fields['admin_name'], $result->fields['admin_email'], TEXT_EMAIL_SUBJECT, sprintf(TEXT_EMAIL_MESSAGE, $new_password), STORE_NAME, EMAIL_FROM, $html_msg, 'password_forgotten_admin');
  67.     $email_message = SUCCESS_PASSWORD_SENT;
  68.  
  69.   }
  70. }
  71.  
  72. ?>
  73. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  74. <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
  75. <head>
  76. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  77. <title><?php echo TITLE; ?></title>
  78. <link href="includes/stylesheet.css" rel="stylesheet" type="text/css" />
  79. </head>
  80. <body id="login">
  81. <form name="login" action="<?php echo zen_href_link(FILENAME_PASSWORD_FORGOTTEN, 'action=update', 'SSL'); ?>" method = "post">
  82. <?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
  83. <fieldset>
  84. <legend><?php echo HEADING_TITLE; ?></legend>
  85. <label for="admin_email"><?php echo TEXT_ADMIN_EMAIL; ?><input type="text" id="admin_email" name="admin_email" value="<?php echo zen_output_string($admin_email); ?>" /></label>
  86. <?php echo $email_message; ?>
  87.  
  88. <input type="submit" name="submit" class="button" value="resend" />
  89. <input type="submit" name="login" class="button" value="login" />
  90.  
  91. </fieldset>
  92. </form>
  93. </body>
  94. </html>
  95. <?php require('includes/application_bottom.php'); ?>
  96.  


cron