This repository was archived by the owner on Sep 1, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect.php
More file actions
executable file
·119 lines (112 loc) · 5.92 KB
/
connect.php
File metadata and controls
executable file
·119 lines (112 loc) · 5.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright (C) 2004 PAROIS Pascal *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Page de connection *
* *
* dernière mise à jour : 11/07/2004 *
* En cas de problème : http://www.parois.net *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
$g4p_chemin='';
// en module npds, ce fichier est inutile
require_once($g4p_chemin.'p_conf/g4p_config.php');
require_once($g4p_chemin.'p_conf/script_start.php');
if(!isset($_POST['g4p_email']))
{
require_once($g4p_chemin.'entete.php');
echo '<h2>',$g4p_langue['connect_titre'],'</h2><div class="cadre">';
if(!empty($_SESSION['message']))
{
echo '<div class="error">'.$_SESSION['message'].'</div>';
}
echo '<form class="formulaire" method="post" action="',g4p_make_url('','connect.php','',0),'">';
echo '<label for="g4p_email">',$g4p_langue['connect_mail'],'</label><input type="text" id="g4p_email" name="g4p_email" /><br />';
echo '<label
for="g4p_password">',$g4p_langue['connect_pass'],'</label><input
type="password" id="g4p_password" name="g4p_password"/><br />';
echo '<label
for="g4p_cookie">',$g4p_langue['connect_cookie'],'</label><input
type="checkbox" id="g4p_cookie" name="g4p_cookie" /><br />';
echo '<input type="submit" value="',$g4p_langue['submit_connection'],'" /></form></div>';
require_once($g4p_chemin.'pied_de_page.php');
}
else
{
$sql="SELECT email,saltpass,id,langue,theme,place FROM genea_membres WHERE email='".$g4p_mysqli->escape_string($_POST['g4p_email'])."'";
if($g4p_result=$g4p_mysqli->g4p_query($sql))
{
if($g4p_result=$g4p_mysqli->g4p_result($g4p_result))
{
$g4p_result=$g4p_result[0];
// check password
if(password_verify($_POST['g4p_password'], $g4p_result['saltpass']))
{
$_SESSION['g4p_id_membre']=$g4p_result['id'];
$_SESSION['langue']=$g4p_result['langue'];
$_SESSION['g4p_email_membre']=$g4p_result['email'];
$_SESSION['theme']=$g4p_result['theme'];
/*
$place=explode(',',$g4p_result['place']);
for($i=0;$i<count($g4p_config['subdivision'])&&$place[$i]!=-1;$i++)
{
$_SESSION['place'][$i]=$place[$i];
}
*/
if(isset($_POST['g4p_cookie']))
{
setcookie('genea4p[g4p_id_membre]',$g4p_result['id'],time()+$g4p_config['cookie_time_limit'],'/');
setcookie('genea4p[g4p_membre]',md5($g4p_result['email']),time()+$g4p_config['cookie_time_limit'],'/');
setcookie('genea4p[langue]',$g4p_result['langue'],time()+$g4p_config['cookie_time_limit'],'/');
setcookie('genea4p[theme]',$g4p_result['theme'],time()+$g4p_config['cookie_time_limit'],'/');
/*
for($i=0;$i<count($g4p_config['subdivision'])&&isset($_SESSION['place_'.$i]);$i++)
{
setcookie('genea4p[place]['.$i.']',$place[$i],time()+$g4p_config['cookie_time_limit'],'/');
}
*/
}
else
{
setcookie('genea4p[langue]','',0,'/','',0);
setcookie('genea4p[g4p_membre]','',0,'/','',0);
setcookie('genea4p[g4p_id_membre]','',0,'/','',0);
setcookie('genea4p[theme]','',0,'/','',0);
//setcookie('genea4p[place]','',0,'/','',0);
setcookie('genea4p');
unset($_COOKIE['genea4p']);
}
unset($_SESSION['permission']);
$_SESSION['message']=$g4p_langue['connect_bienvenue']." : ".$_POST['g4p_email']."/".$_SESSION['langue'];
header('location:'.g4p_make_url('','index.php',SID,0));
}
else
{
$_SESSION['message']=$g4p_langue['acces_login_pass_incorrect']." : ".$_POST['g4p_email'];
header('location:'.g4p_make_url('','connect.php',SID,0));
}
}
else
{
$_SESSION['message']=$g4p_langue['acces_login_pass_incorrect']." : ".$_POST['g4p_email'];
header('location:'.g4p_make_url('','connect.php',SID,0));
}
}
}
?>