Location: PHPKode > projects > SOS Webpages > admin/admin_password_reset4.php
<?php
// +----------------------------------------------------------------------+
// SOS Webpages is an easy-to-manage website management system
// Copyright (C) 2007 - 2010 HandsomeWeb
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
// Contact the author of this software at http://www.handsomeweb.com.
// +----------------------------------------------------------------------+
/*	admin_password_reset4.php is part of the password recover process. */
Require "admin_queries.php";
$key=$_GET["key"];
$dbh=mysql_connect($dbhhost,$dbhuser,$dbhpassword) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db($dbhdatabasename);
$query = "SELECT admin_key, admin_newpassword, admin_time FROM " . $dbprefix . "hw_admin WHERE admin_id=1";
$result=mysql_query($query);
$num=mysql_num_rows($result);
$admin_time = mysql_result($result,0,"admin_time");
$admin_newpassword=mysql_result($result,0,"admin_newpassword");
$admin_key=mysql_result($result,0,"admin_key");
$admin_password=MD5($admin_newpassword);
$year = substr($admin_time,0,4);
$mon  = substr($admin_time,5,2);
$day  = substr($admin_time,8,2);
$hour = substr($admin_time,11,2);
$min  = substr($admin_time,14,2);
$sec  = substr($admin_time,17,2);
$Presettime=mktime($hour,$min,$sec,$mon,$day,$year);
if (((time()-$Presettime)<86400) and $admin_key == $key) {
  $query = "UPDATE " . $dbprefix . "hw_admin SET admin_password='$admin_password' WHERE admin_id=1";
  mysql_query($query);
  header("Location: index.php");
  exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title><?=PASSWORD_RESET?></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW" />
<meta http-equiv="refresh" content="30; url=login.php" />
<link rel="stylesheet" href="admin_style.css" type="text/css" />
</head>

<body>
<div id="loginwrapper">
<div id="loginwrapper2">
<h1><?=FAILURE?></h1>
<p><?=INVALID_LINK?></p>
<p style='text-align:center;margin-top:15px'><a href='http://www.soswebpages.com'><img style='border:0' src='images/sosline.png' alt='Powered by SOS Webpages' /></a></p>

</div>
</div>
</body>
</html>
Return current item: SOS Webpages