[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
<?php
/**
* @package admin
* @copyright Copyright 2003-2012 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version GIT: $Id: Author: Ian Wilson Sun Jul 22 20:55:36 2012 +0100 Modified in v1.5.1 $
*/
// reset-token is good for only 24 hours:
define('ADMIN_PWD_TOKEN_DURATION', (24 * 60 * 60) );
/////////
require ('includes/application_top.php');
// demo active test
if (zen_admin_demo())
{
$_GET['action'] = '';
$messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
zen_redirect(zen_href_link(FILENAME_DEFAULT));
}
if (isset($_POST['login']))
{
zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
}
// Slam prevention:
if ($_SESSION['login_attempt'] > 9) {
header('HTTP/1.1 406 Not Acceptable');
exit(0);
}
$error = false;
$reset_token = '';
if (isset($_POST['submit']))
{
if (! $_POST['admin_email'])
{
$error = true;
$email_message = ERROR_WRONG_EMAIL_NULL;
}
$admin_email = zen_db_prepare_input($_POST['admin_email']);
$sql = "select admin_id, admin_name, admin_email, admin_pass from " . TABLE_ADMIN . " where admin_email = :admEmail: LIMIT 1";
$sql = $db->bindVars($sql, ':admEmail:', $admin_email, 'string');
$result = $db->Execute($sql);
if (! ($admin_email == $result->fields['admin_email']))
{
$error = true;
$email_message = MESSAGE_PASSWORD_SENT;
}
// BEGIN SLAM PREVENTION
if ($_POST['admin_email'] != '')
{
if (! isset($_SESSION['login_attempt'])) $_SESSION['login_attempt'] = 0;
$_SESSION['login_attempt'] ++;
} // END SLAM PREVENTION