Example #1
0
<?php

/**
 * lostpassword.php
 *
 * @version 1.0
 * @copyright 2008 by Tom1991 for XNova
 */
define('INSIDE', true);
define('INSTALL', false);
$ugamela_root_path = './';
include $ugamela_root_path . 'extension.inc';
include $ugamela_root_path . 'common.' . $phpEx;
includeLang('lostpassword');
$servername = $game_config['game_name'];
if ($action != 1) {
    $parse = $lang;
    $parse['servername'] = $servername;
    $page .= parsetemplate(gettemplate('lostpassword'), $parse);
    display($page, $lang['system'], false);
}
if ($action == 1) {
    $email = $_POST['email'];
    sendnewpassword($email);
    message($lang['NewPassSendSuccess'], 'OK');
}
// History version
// 1.0 Création (Tom)
Example #2
0
                 $CaracterBoucle = rand(0, $Count - 1);
                 $NewPass = $NewPass . substr($Caracters, $CaracterBoucle, 1);
             }
             $Title = $lang['mail_title'];
             $Body = $lang['mail_text'];
             $Body .= $NewPass;
             mail($mail, $Title, $Body);
             $NewPassSql = md5($NewPass);
             $QryPassChange = "UPDATE {{table}} SET ";
             $QryPassChange .= "`password` ='" . $NewPassSql . "' ";
             $QryPassChange .= "WHERE `email`='" . $mail . "' LIMIT 1;";
             doquery($QryPassChange, 'users');
         }
     }
     if ($_POST) {
         sendnewpassword($_POST['email']);
         message($lang['mail_sended'], "./", 2, false, false);
     } else {
         $parse['version'] = VERSION;
         $parse['forum_url'] = $game_config['forum_url'];
         display(parsetemplate(gettemplate('public/lostpassword'), $parse), false, '', false, false);
     }
     break;
 default:
     if ($_POST) {
         $login = doquery("SELECT `id`,`username`,`password`,`banaday` FROM {{table}} WHERE `username` = '" . mysql_escape_string($_POST['username']) . "' AND `password` = '" . md5($_POST['password']) . "' LIMIT 1", "users", true);
         if ($login['banaday'] <= time() && $login['banaday'] != '0') {
             doquery("UPDATE {{table}} SET `banaday` = '0', `bana` = '0' WHERE `username` = '" . $login['username'] . "' LIMIT 1;", 'users');
             doquery("DELETE FROM {{table}} WHERE `who` = '" . $login['username'] . "'", 'banned');
         }
         if ($login) {