1
0
mirror of https://gitlab.com/JKANetwork/CheckServer.git synced 2026-02-27 23:43:46 +01:00

Change connect to load and fix code

This commit is contained in:
2018-01-09 23:27:59 +01:00
parent 42583d198e
commit 5e33adbbaf
10 changed files with 105 additions and 115 deletions

View File

@@ -1,10 +1,8 @@
<?php
require "functions.php";
require "load.php";
if (isset($_GET['do'])){
if ($_GET['do'] == 'logout'){
require_once "connect.php";
//dbw_query($db_conn, "UPDATE USERS SET SessionID = NULL WHERE SessionID='$_COOKIE[SessionID]'");
session_destroy();
header('Location: index.php');
}
@@ -15,7 +13,7 @@ if (isset($_SESSION['UserID'])){ //Ya está logueado
}
if (!isset($_POST['nick'])){
echo $twig->render('login.twig');
renderPage('login.twig');
}
if (isset($_POST['nick'])){
$nick=$_POST['nick'];
@@ -27,7 +25,7 @@ if (isset($_POST['nick'])){
$_SESSION['UserID'] = $resql['ID_U'];
header('Location: panel.php');
}else{
echo $twig->render('login.twig', array('status' => 'error'));
renderPage('login.twig', array('status' => 'error'));
}
}