-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathconnect.php
More file actions
95 lines (77 loc) · 3.11 KB
/
Copy pathconnect.php
File metadata and controls
95 lines (77 loc) · 3.11 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
<?php
if (isset($_SESSION["key"])) {
header("location: tchat.php");
}
if (isset($_POST['thelogin']) && isset($_POST["thepwd"])) {
if (empty($_POST['thelogin']) && empty($_POST["thepwd"])) {
$erreur = "Veuillez remplir tous les champs !";
}
else if(empty($_POST['thelogin'])){
$erreur = "<p style='background-color:#2e9aaf'>Please insert a username !</p>";
}
else if(empty($_POST['thepwd'])){
$erreur = "<p style='background-color:#2e9aaf'>Please insert a password !</p>";
}
else {
$login = htmlspecialchars(strip_tags(trim($_POST['thelogin'])), ENT_QUOTES);
$pwd = strip_tags(trim($_POST['thepwd']));
$connect = connectUser($PDO, $login, $pwd);
if($connect == false){
$erreur = "User or password incorrect !";
}
else if($connect["thevalidate"] == 0){
$erreur = "<p style='background-color:#dda93fb3'>Please validate your account in your mailbox !</p>";
}
else {
$_SESSION = $connect;
$_SESSION['online']=[$_SESSION['idutil']];
$_SESSION["key"] = session_id();
header("location: tchat.php");
}
}
}
?>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<title>Tchat: Connect</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" media="screen" href="css/style.css">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon.ico">
</head>
<body>
<!-- particles.js container -->
<div id="particles-js"></div>
<!-- scripts -->
<script src="js/particles.min.js"></script>
<script src="js/app.min.js"></script>
<?php if (isset($erreur)) {?>
<div class="erreur"><?=$erreur;?></div>
<?php }?>
<form id="accueil-form" action="" method="post">
<h1>Login</h1>
<label for="login">Login :</label>
<input type="text" placeholder="your login" id="login" class="input-deco input-user" name="thelogin" value="<?=@$_POST["thelogin"];?>">
<label for="thepwd">Password :</label>
<input type="password" placeholder="your password" id="thepwd" class="input-deco input-pwd" name="thepwd" value="<?=@$_POST["thepwd"];?>">
<input id="button" type="submit" value="Sign up">
<div class="inscription">
<a href="?p=inscription">Registration</a>
</div>
<!-- Matomo -->
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//statistiques.cf2m.be/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
</body>
</html>