Вход Регистрация
Файл: pass_restore.php
Строк: 56
<?php

include_once("settings.php");
include_once(
"game_info_text.php");
include_once(
"player.php");

//check login
session_start();

if(!isset(
$mode)) $mode="";

if(
$mode=="restore")
{
    
$info_msg="";
    
$player = new CPlayer($db);
    
    
$name=$_REQUEST["name"];
    
$email=$_REQUEST["email"];
    
    
$vnum_player=$player->checkPlayerEmail($name,$email);
    
    if(
$vnum_player==false){
        
//player don`t have in db
        
$info_msg="йНС Й Email ЙЗТПЛБ ОЕ УППФЧЕФУФЧХАФ ДТХЗ ДТХЗХ";
    }else{
        
$info_msg="оБ ЧБЫ Email ВЩМ ЧЩУМБО ОПЧЩК РБТПМШ";
        
        
//generate new 10 symbol password
        
$new_pass=generatePasswd(10);
        
$new_pass_md5=md5($new_pass);
        
        
$message="йЗТПЛ $namenчБЫ РБТПМШ ВЩМ ЙЪНЕОЕО ОБ $new_pass";
        
$subject="йЪНЕОЕОЙЕ РБТПМС ДМС ЙЗТПЛБ $name";
        
mail($email,$subject,$message);
        
        
//$info_msg.=" ".$new_pass;
        
        //set new password
        
$player->setVnum($vnum_player);
        
$player->setPassword($new_pass_md5);
    }
    
    
    
    
session_register("info_msg");
    
header("Location: pass_restore.php");
    exit();
}

if(isset(
$info_msg))
{
    
$smarty->assign('INFO_MSG',$info_msg);
    
session_unregister("info_msg");
}

$header=$smarty->fetch($templ_path.'/index_head.tpl');
$smarty->assign('HEADER',$header);

$text=$smarty->fetch($templ_path.'/pass_restore.tpl');

echo(
$text);

// Unset all of the session variables.
session_unset();
// Finally, destroy the session.
session_destroy();


?>
Онлайн: 0
Реклама