This repository has been archived on 2020-01-20. You can view files and clone it, but cannot push or open issues or pull requests.
evoauth/htdocs/popup_debut.php

120 lines
2.6 KiB
PHP
Raw Normal View History

2005-09-12 21:51:19 +02:00
<?
require_once "includes/config.php";
require "includes/database.php";
require "includes/fonctions.php";
2005-09-13 22:45:04 +02:00
session_name("EVOAUTH_PHPSESSION");
2005-09-12 21:51:19 +02:00
session_start();
// on v<>rifie que la session est active et que l'ip est correcte
$isip = getenv("REMOTE_ADDR");
$kick = getkick($_SESSION['login']);
2005-09-13 22:45:04 +02:00
if ($_SESSION['ip'] != $isip) {
2005-09-12 21:51:19 +02:00
exit;
}
2005-09-13 22:45:04 +02:00
elseif ($kick == "1") {
2005-09-12 21:51:19 +02:00
setkick($_SESSION['login'], "0");
echo '<meta http-equiv="Refresh" content="0;popup_fin.php">';
}
2005-09-13 22:45:04 +02:00
else {
2005-09-12 21:51:19 +02:00
// donn<6E>es <20> ins<6E>rer
$temps = time();
2005-09-13 22:45:04 +02:00
$ligne = $temps." ".$_SESSION['ip'];
2005-09-12 21:51:19 +02:00
if ($prepaid == 1 && getutype($_SESSION['login']) == "1")
{
// on r<>cup<75>re le cr<63>dit restant de l'utilisateur
$credit = getcredit($_SESSION['login']);
$credit--;
// actualisation de la base de donn<6E>es
setcredit($_SESSION['login'], $credit);
}
update_statut($_SESSION['login'], "1");
$newt = time();
update_lastupdate($_SESSION['login'], $newt);
// cr<63>dit <20>puis<69>
if (getutype($_SESSION['login']) == "1" && $prepaid == 1 && $credit <= 0)
{
echo '<meta http-equiv="Refresh" content="0;popup_fin.php">';
}
// il reste du cr<63>dit
else
{
?>
<html>
<head>
<meta http-equiv="Refresh" content="60;popup_debut.php">
<script language = "JavaScript">
2005-09-13 22:45:04 +02:00
function fin() {
window.open('popup_debut.php', 'connexion', 'height=<?=$height?>, width=<?=$width?>, toolbar=no, menubar=no, scrollbars=no, resizable=no, status=no')
}
2005-09-12 21:51:19 +02:00
function sortie() {
if(confirm('Etes vous sur de vouloir quitter ?'))
document.location.href='popup_fin.php'
}
</script>
</head>
2005-09-13 22:45:04 +02:00
<body text="black" alink="black" vlink="black" onUnload="fin()">
2005-09-12 21:51:19 +02:00
<table align="center">
<tr>
<?
if (getutype($_SESSION['login']) == "1" && $prepaid == 1 && $credit == 1)
{
?>
<td colspan="2" align="center">
<b><font color="red">Attention, derni<EFBFBD>re minute de connexion...</font></b>
</td>
<?
}
elseif (getutype($_SESSION['login']) == "1" && $prepaid == 1 && $credit > 0)
{
?>
<td colspan="2" align="center">
<b>Vous <EFBFBD>tes connect<EFBFBD> et il vous reste <?=$credit?> minutes.</b>
</td>
<?
}
// mode non pr<70>pay<61> ou mode permanent
else
{
?>
<td colspan="2" align="center">
<b>Vous <EFBFBD>tes connect<EFBFBD>.</b>
</td>
<?
}
?>
</tr><tr>
<td></td>
</tr><tr>
<td align="center" width="50%">
<a href="membre.php" target="blank"><img src="images/accueil.png"></a>
</td>
<td align="center" width="50%">
<a href="#" onClick="sortie()"><img src="images/fin.png"></a>
</td>
</tr>
</tr><tr>
<td align="center"><font size="1" color="black">Accueil</font></td>
<td align="center"><font size="1" color="black">D<EFBFBD>connexion</font></td>
</tr>
</table>
</body>
</html>
<?
}
}
?>