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");
2005-11-13 10:41:41 +01:00
header("location:popup_fin.php");
2005-09-12 21:51:19 +02:00
}
2005-09-13 22:45:04 +02:00
else {
2005-09-12 21:51:19 +02:00
// données à insé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ère le crédit restant de l'utilisateur
$credit = getcredit($_SESSION['login']);
$credit--;
// actualisation de la base de données
setcredit($_SESSION['login'], $credit);
}
update_statut($_SESSION['login'], "1");
$newt = time();
update_lastupdate($_SESSION['login'], $newt);
// crédit épuisé
if (getutype($_SESSION['login']) == "1" && $prepaid == 1 && $credit <= 0)
{
2005-11-13 10:41:41 +01:00
header("location: popup_fin.php");
2005-09-12 21:51:19 +02:00
}
// il reste du cré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ère minute de connexion...</font></b>
</td>
<?
}
elseif (getutype($_SESSION['login']) == "1" && $prepaid == 1 && $credit > 0)
{
?>
<td colspan="2" align="center">
<b>Vous êtes connecté et il vous reste <?=$credit?> minutes.</b>
</td>
<?
}
// mode non prépayé ou mode permanent
else
{
?>
<td colspan="2" align="center">
<b>Vous êtes connecté.</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éconnexion</font></td>
</tr>
</table>
</body>
</html>
<?
}
}
?>