ADD informations concernant les jours pendant lesquels les participants sont présent...
[cl7.git] / connexion.php
1 <?php
2 /*
3 * Connexion à la base de donnée + résolutiondu participant.
4 * Produit une variable globale nommée '$le_participant'.
5 */
6
7 include_once("config.php");
8 include_once("class_participant.php");
9
10 $lien_mysql = mysql_connect($SQL_HOTE, $SQL_LOGIN, $SQL_PASS);
11 mysql_select_db($NOM_BASE);
12 mysql_set_charset("UTF8");
13 mysql_query('SET AUTOCOMMIT=0');
14
15 if (isset($_POST['effacer_cookie'])) # le membre se délogue
16 {
17 setcookie("COOKIE_INFO_PATICIPANT", "", time() - 100); #'efface' le cookie membre
18 unset($HTTP_COOKIE_VARS["COOKIE_INFO_PATICIPANT"]);
19 unset($log);
20 }
21
22 if (isset($_POST['log'])) # le membre se logue
23 {
24 $le_participant = new Participant($pseudo, $password);
25 if ($le_participant->valide)
26 {
27 setcookie ("COOKIE_INFO_PATICIPANT", $le_participant->info->id, time() + 31104000);
28 }
29 }
30 else if (isset($HTTP_COOKIE_VARS["COOKIE_INFO_PATICIPANT"])) # le cookie existe deja chez le participant
31 {
32 $le_participant = new Participant($HTTP_COOKIE_VARS["COOKIE_INFO_PATICIPANT"]);
33 }
34 else
35 {
36 $le_participant = new Participant();
37 }
38
39 ?>