connect.php
1.81 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
<h2> Connexion </h2>
<form class="form-horizontal" role="form" id="connectForm">
<div class="form-group">
<label for="entrer_Identifiant_3" class="col-sm-2 control-label">Identifiant</label>
<div class="col-sm-10">
<input type="identifiant" class="form-control" id="Entrer_Identifiant_3" placeholder="Votre identifiant">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="entrer_mot_de_passe_3">Mot de passe</label>
<div class="col-sm-10">
<div class="input-group">
<input type="password" class="form-control" id="entrer_mot_de_passe_3" placeholder="Votre mot de passe">
<span class="input-group-btn">
<button id="afficherMotDePasse" type="button" class="btn btn-default"><span class="glyphicon glyphicon glyphicon-eye-open"></span> Afficher</button>
</span>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button id="validCreds" type="submit" class="btn btn-primary" onclick="return false;">Se connecter</button>
</div>
</div>
</form>
<script type="text/javascript">
// Affiche le mot de passe
$("#afficherMotDePasse")[0].addEventListener('mousedown', function()
{
$('#entrer_mot_de_passe_3')[0].type = 'text';
});
$('#afficherMotDePasse')[0].addEventListener('mouseup', function()
{
$('#entrer_mot_de_passe_3')[0].type = 'password';
});
$('#connectForm')[0].submit(function(event)
{
$("#validCreds")[0].disabled=true;
var checkPath = "checkCreds.php?user=";
checkPath += $("#Entrer_Identifiant_3")[0].value;
checkPath += "&pass=";
checkPath += Whirlpool($("#entrer_mot_de_passe_3")[0].value);
if(file(checkPath)=="Yep")
document.location.replace("");
else
alert("Mauvais identifiants");
$("#validCreds")[0].disabled=false;
event.preventDefault();
});
</script>