mirror of
https://gitlab.com/JKANetwork/CheckServer.git
synced 2026-03-04 01:29:52 +01:00
First commit. Check if all is uploaded well.
This commit is contained in:
33
connect.php
Executable file
33
connect.php
Executable file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
require_once "lib/dbwrapper.php";
|
||||
|
||||
$db_file = __DIR__."/sqlite.db3";
|
||||
if (!is_file($db_file)){ //Go to install if not.
|
||||
header("Location: install.php");
|
||||
die();
|
||||
}
|
||||
|
||||
$db_conn = dbw_connect("sqlite",$db_file); //Database
|
||||
|
||||
/** In connect.php check if user SessionID exists, if not, delete Cookie */
|
||||
if (isset($_COOKIE['SessionID'])){
|
||||
$data = dbw_query_fetch_array($db_conn, "SELECT * FROM USERS WHERE SessionID='$_COOKIE[SessionID]'");
|
||||
if (!isset($data['SessionID'])){
|
||||
setcookie("SessionID", "", time()-3600,"/");
|
||||
header("Location: index.php");
|
||||
}
|
||||
|
||||
$you['ID_U'] = $data['ID_U'];
|
||||
$you['nick'] = $data['nick'];
|
||||
$you['fullRights'] = $data['fullRights'];
|
||||
$you['SessionID'] = $data['SessionID'];
|
||||
$you['webRoot'] = webRoot();
|
||||
|
||||
}
|
||||
|
||||
$lang=getSystemOpt('lang');
|
||||
//Translations
|
||||
require_once __DIR__."/assets/translations/en.php"; //Ever first English, and then your lang (Database)
|
||||
require_once __DIR__."/assets/translations/$lang.php";
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user