Вход Регистрация
Файл: Скрипт/pages/_authorization.php
Строк: 128
<div class="content">
<div class="content-panel">

<div class="content-left">

<h3>Вход в личный кабинет</h3>
<div class="space2"></div>
<?PHP

$_OPTIMIZATION
["title"] = "Вход/Восстановление";
$_OPTIMIZATION["description"] = "Вход/Восстановление";
$_OPTIMIZATION["keywords"] = "Вход/Восстановление";

if(isset(
$_SESSION["user_id"])){ Header("Location: /my-farm"); return; }

?>
<?PHP

    
if(isset($_POST["log_email"])){
    
    
$lmail $_POST["log_email"];
    
        if(
$lmail !== false){
        
            
$db->Query("SELECT id, user, pass, referer_id, banned FROM db_users_a WHERE user = '$lmail'");
            if(
$db->NumRows() == 1){
            
            
$log_data $db->FetchArray();
            
                if(
strtolower($log_data["pass"]) == strtolower($_POST["pass"])){
                
                    if(
$log_data["banned"] == 0){
                        
                        
# Считаем рефералов
                        
$db->Query("SELECT COUNT(*) FROM db_users_a WHERE referer_id = '".$log_data["id"]."'");
                        
$refs $db->FetchRow();
                        
                        
$db->Query("UPDATE db_users_a SET referals = '$refs', date_login = '".time()."', ip = INET_ATON('".$func->UserIP."') WHERE id = '".$log_data["id"]."'");
                        
                        
$_SESSION["user_id"] = $log_data["id"];
                        
$_SESSION["user"] = $log_data["user"];
                        
$_SESSION["referer_id"] = $log_data["referer_id"];
                        
Header("Location: /my-farm");
                        
                    }else 
                        {
?>
                <div id="parent_popup">
                  <div id="popup">
                <div style="width:260px; float:left; padding:21px 0px 0px 120px">
                <h4>Ошибка</h4>
                Ваш аккаунт заблокирован, обратитесь в поддержку за выяснениями обстоятельств. 
                </div>

                <a class="close" title="Закрыть" onclick="document.getElementById('parent_popup').style.display='none';">X</a>
                  </div>
                </div>
                <script type="text/javascript">
                    var delay_popup = 100;
                    setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);
                </script>

<?

                        
}
                }else 
                    {
?>
                <div id="parent_popup">
                  <div id="popup">
                <div style="width:260px; float:left; padding:21px 0px 0px 120px">
                <h4>Ошибка</h4>
                Логин или пароль указаны неверно. 
                </div>

                <a class="close" title="Закрыть" onclick="document.getElementById('parent_popup').style.display='none';">X</a>
                  </div>
                </div>
                <script type="text/javascript">
                    var delay_popup = 100;
                    setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);
                </script>

<?

                
}
            }else
                {


?>
                <div id="parent_popup">
                  <div id="popup">
                <div style="width:260px; float:left; padding:21px 0px 0px 120px">
                <h4>Ошибка</h4>
                Указаный логин не зарегистрирован в игре. 
                </div>
                <a class="close" title="Закрыть" onclick="document.getElementById('parent_popup').style.display='none';">X</a>
                  </div>
                </div>
                <script type="text/javascript">
                    var delay_popup = 100;
                    setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);
                </script>

<?

                
}
        }else {
                    
?>
                <div id="parent_popup">
                  <div id="popup">
                <div style="width:260px; float:left; padding:21px 0px 0px 120px">
                <h4>Ошибка</h4>
                Вы ввели неправильный логин. 
                </div>

                <a class="close" title="Закрыть" onclick="document.getElementById('parent_popup').style.display='none';">X</a>
                  </div>
                </div>
                <script type="text/javascript">
                    var delay_popup = 100;
                    setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);
                </script>

<?
            
}
    
    }

?>


<form action="" method="post">
<input name="log_email" placeholder="Логин" type="text" maxlength="35" class="box">
<input name="pass" placeholder="Пароль" type="password" maxlength="35" class="box">
<input type="submit" value="ВОЙТИ" class="button"></form>
</div>

<div class="content-right">

<h3>Восстановление пароля</h3>

<?PHP

    
if(isset($_POST["email"])){
        
        
$email $func->IsMail($_POST["email"]);
        
$time time();
        
$tdel $time 60*15;
        
            if(
$email !== false){
                
                
$db->Query("DELETE FROM db_recovery WHERE date_del < '$time'");
                
$db->Query("SELECT COUNT(*) FROM db_recovery WHERE ip = INET_ATON('".$func->UserIP."') OR email = '$email'");
                if(
$db->FetchRow() == 0){
                
                    
$db->Query("SELECT id, user, email, pass FROM db_users_a WHERE email = '$email'");
                    if(
$db->NumRows() == 1){
                    
$db_q $db->FetchArray();
                    
                    
# Вносим запись в БД
                    
$db->Query("INSERT INTO db_recovery (email, ip, date_add, date_del) VALUES ('$email',INET_ATON('".$func->UserIP."'),'$time','$tdel')");
                    
                    
# Отправляем пароль
                    
$sender = new isender;
                    
$sender -> RecoveryPassword($db_q["email"], $db_q["pass"], $db_q["email"]);
                    
                    echo 
"<div class='success'>Ваш пароль отправлен на Почту указанную при регистрации.</div>";
                    
?>
</div>
</div>
<div class="clr"></div>
<?PHP include("inc/_intro.php"); ?>                    
                    <?PHP
                    
return; 
                    
                    }else                            {
?>
                <div id="parent_popup">
                  <div id="popup">
                <div style="width:260px; float:left; padding:21px 0px 0px 120px">
                <h4>Ошибка</h4>
                Данная почта не зарегистрирована в игре. 
                </div>

                <a class="close" title="Закрыть" onclick="document.getElementById('parent_popup').style.display='none';">X</a>
                  </div>
                </div>
                <script type="text/javascript">
                    var delay_popup = 100;
                    setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);
                </script>

<?

                        
}
                }else                            {
?>
                <div id="parent_popup">
                  <div id="popup">
                <div style="width:260px; float:left; padding:21px 0px 0px 120px">
                <h4>Ошибка</h4>
                Мы уже отправили пароль вам на почту. 
                </div>

                <a class="close" title="Закрыть" onclick="document.getElementById('parent_popup').style.display='none';">X</a>
                  </div>
                </div>
                <script type="text/javascript">
                    var delay_popup = 100;
                    setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);
                </script>

<?

                        
}
            }else{
                    
?>
                <div id="parent_popup">
                  <div id="popup">
                <div style="width:260px; float:left; padding:21px 0px 0px 120px">
                <h4>Ошибка</h4>
                Данная почта имеет неверный формат. 
                </div>

                <a class="close" title="Закрыть" onclick="document.getElementById('parent_popup').style.display='none';">X</a>
                  </div>
                </div>
                <script type="text/javascript">
                    var delay_popup = 100;
                    setTimeout("document.getElementById('parent_popup').style.display='block'", delay_popup);
                </script>

<?
            
}
    
    }

?>

<div style="font-size:14px; width:370px; padding:0px 0px 25px 0px;">Для восстановления пароля введите вашу почту указанную при регистрации, на нее будет выслан пароль от вашего аккаунта.</div>
<form action="" method="post">
<input name="email" class="box" type="text" placeholder="Ваша почта" maxlength="50" value="<?=(isset($_POST["email"])) ? $_POST["email"] : false?>"/>
<input type="submit" value="ОТПРАВИТЬ" class="button"></form>
</div>
</div>
</div>

<div class="clr"></div>
<?PHP include("inc/_intro.php"); ?>
Онлайн: 1
Реклама