<?php

ob_start();
session_start();
require_once 'functions/load_config.php';
require_once 'functions/quick_con.php';
$config = load_config('settings/config.dat');
if ($_POST['submit'] == 'Reset Password') {
    print "<table width=100% height=100%><tr><td align=center valign=center>";
    $user = ereg_replace("[^A-Za-z0-9]", "", $_POST['username']);
    $email = ereg_replace("[^A-Za-z0-9@.]", "", $_POST['email']);
    $sql = my_quick_con($config) or die("mysql problem");
    $ret = mysql_query("SELECT * FROM  {$config['users_table']} WHERE username='******' AND email='{$email}';", $sql);
    if (mysql_num_rows($ret) > 0) {
        $new = "";
        $c_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        srand();
        for ($i = 0; $i < 8; $i++) {
            $n = rand() % 25;
            $new .= substr($c_list, $n, 1);
        }
        $new_hash = md5($new);
        $ret = mysql_query("UPDATE {$config['users_table']} SET password = '******' WHERE username='******';", $sql);
        $header = "From: no-reply@HvZSource.com \r\n";
        $body = "Your password has been reset.\n\n\n";
        $body .= "Your new password is: {$new}.\n\n";
        $body .= "You can change your password in your account page, once you login.\n\n";
        $body .= "--HvZSource";
        mail($email, "HvZSource: Password Reset", $body, $header);
        print "<body bgcolor='#000000'><font color='#ffffff'>Your password has been reset.<br>Check your email address for your new password.<br><a href='index.php'>Back to login</a></font></body>";
    } else {
Exemple #2
0
<?php

ob_start();
session_start();
require_once 'functions/load_config.php';
require_once 'functions/quick_con.php';
$config = load_config('settings/config.dat');
$table_u = $config['user_table'];
$table_v = $config['var_table'];
$table_t = $config['time_table'];
$sql = my_quick_con($config) or die("MySQL problem");
// Set default time zone
$ret = mysql_query("SELECT zone FROM {$table_t}");
while ($row = mysql_fetch_array($ret)) {
    date_default_timezone_set($row['zone']);
}
// update the starvation times and oz reveal (every 5 minutes, not on every page refresh)
$now = time();
$last_starvation_update = isset($_SESSION['last_starvation_update']) ? $_SESSION['last_starvation_update'] : $now;
if ($last_starvation_update >= $now + 900) {
    $ret = mysql_query("UPDATE {$table_u} SET state = -4 WHERE now() > feed + INTERVAL 2 day;");
    $ret = mysql_query("UPDATE {$table_u} SET starved = feed + INTERVAL 2 day WHERE state = -4;");
    $ret = mysql_query("UPDATE {$table_u} SET state = 0 WHERE state = -4;");
    $ret = mysql_query("SELECT value FROM {$table_v} WHERE keyword='oz-revealed';");
    $reveal_oz = mysql_fetch_assoc($ret);
    $reveal_oz = $reveal_oz['value'];
    $_SESSION['last_starvation_update'] = time();
    $_SESSION['oz_revealed'] = $reveal_oz;
} else {
    $reveal_oz = isset($_SESSION['oz_revealed']) ? $_SESSION['oz_revealed'] : 0;
}
Exemple #3
0
<?php

ob_start();
session_start();
require_once 'security.php';
require_once '../functions/load_config.php';
require_once '../functions/quick_con.php';
$box = 0;
$config = load_config('../settings/config.dat');
$sql = my_quick_con($config) or die("Database Problem");
$table_v = $config['var_table'];
$table_u = $config['user_table'];
$table_t = $config['time_table'];
// Set default time zone
$ret = mysql_query("SELECT zone FROM {$table_t}");
while ($row = mysql_fetch_array($ret)) {
    date_default_timezone_set($row['zone']);
}
?>

<html> 
<head> 
<link rel='stylesheet' type='text/css' href='style/main.css'>
</head>

<?php 
if ($_POST['submit'] == 'Advance') {
    $step = $_POST['step'];
    if ($step == 'oz-selected') {
        header("Location:oz_pick.php");
        $message = "The original zombie is being chosen!";