Connection et déconnection implémentée
This commit is contained in:
parent
2dfa43173f
commit
0d60eed0c8
|
@ -1,11 +1,11 @@
|
|||
#CONTAINER section{
|
||||
/* position */
|
||||
display: block;
|
||||
position: absolute;
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
/*min-height: calc( 100vh - 5em );*/
|
||||
padding: 2em;
|
||||
|
||||
/* background */
|
||||
|
|
23
index.php
23
index.php
|
@ -83,6 +83,7 @@ $notifNotifNum = 5;
|
|||
<!-- HEADER DE LA PAGE -->
|
||||
<div id='HEADER'>
|
||||
<div class='notifbar'>
|
||||
|
||||
<?php
|
||||
/* membres */
|
||||
if( $memberNotifNum > 0 ) echo "<div class='member' data-num='".$memberNotifNum."'></div>";
|
||||
|
@ -126,13 +127,21 @@ $notifNotifNum = 5;
|
|||
|
||||
|
||||
<div id='AUTH_FILTER'></div>
|
||||
<form id='AUTH' action='' method='POST'>
|
||||
<label>Connection</label>
|
||||
<input type='text' name='username' placeholder='Username'>
|
||||
<input type='password' name='password' placeholder='Password'>
|
||||
<span class='errorbox'> </span>
|
||||
<input type='button' value='Connection'>
|
||||
</form>
|
||||
<?php if( $_SESSION['username'] == null ){ // si on est pas connecté ?>
|
||||
<form id='AUTH' action='' method='POST'>
|
||||
<label>Connection</label>
|
||||
<input type='text' name='username' placeholder='Username'>
|
||||
<input type='password' name='password' placeholder='Password'>
|
||||
<span class='errorbox'> </span>
|
||||
<input type='button' value='Connection'>
|
||||
</form>
|
||||
<?php }else{ // si on est connecté ?>
|
||||
<form id='AUTH' action='' method='POST'>
|
||||
<label>Déconnection</label>
|
||||
<input type='button' value='Déconnection'>
|
||||
</form>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -271,17 +271,23 @@ function initForm(pForm, pHandler){
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/* SI ON EST PAS DEJA CONNECTE */
|
||||
var connected = !( DOM.AUTH.children[0].innerHTML == 'Connection' );
|
||||
|
||||
|
||||
initForm( // initialisation du formulaire de connection
|
||||
DOM.AUTH, // formulaire (élément DOM)
|
||||
function(request){ // handler
|
||||
// ajout d'informations à la requête
|
||||
request.level_0 = 'user';
|
||||
request.level_1 = 'authentification';
|
||||
|
||||
request.level_1 = (connected) ? 'exit' : 'authentification';
|
||||
|
||||
API.send(request, function(response){
|
||||
if( response.request == 'success' ){// si connection ok
|
||||
document.location = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
);
|
||||
|
|
|
@ -46,12 +46,15 @@
|
|||
*
|
||||
*/
|
||||
function session_init(){
|
||||
/*
|
||||
session_id( // on définit le session id
|
||||
sha1( // qui est un Hash MD5
|
||||
$_SERVER['HTTP_USER_AGENT']. // qui correspond aux infos système disponibles de l'utilisateur
|
||||
$_SERVER['REMOTE_ADDR'] // et de son ip publique
|
||||
)
|
||||
);
|
||||
*/
|
||||
|
||||
session_start(); // on démarre la session
|
||||
|
||||
$PERMISSIONS = getPermissions();
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
* [1] ROUTAGE de niveau 1 *
|
||||
* [2] Authentification *
|
||||
* [a] userlist *
|
||||
* [b] connection *
|
||||
* [b] Connection *
|
||||
* [c] Déconnection *
|
||||
* *
|
||||
* *
|
||||
* *
|
||||
|
@ -54,6 +55,18 @@
|
|||
break;
|
||||
|
||||
|
||||
/*****************/
|
||||
/* déconnection */
|
||||
/*****************/
|
||||
case 'exit':
|
||||
$_SESSION['username'] = null; // on supprime l'identifiant
|
||||
if( $_SESSION['username'] == null )
|
||||
$answer->request = 'success'; // succès
|
||||
else
|
||||
$answer->request = 'error';
|
||||
break;
|
||||
|
||||
|
||||
|
||||
/***********/
|
||||
/* DEFAULT */
|
||||
|
|
|
@ -16,7 +16,41 @@
|
|||
?>
|
||||
|
||||
<section name='home' title='Accueil'>
|
||||
Accueil
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
Accueilqsd<br><br>sd
|
||||
</section>
|
||||
|
||||
<section name='groups' title='Groupes'>
|
||||
|
|
Loading…
Reference in New Issue