prep for 2023. Fixed many bugs. Added pdf guide

This commit is contained in:
2023-03-29 22:47:51 +02:00
parent 7f97a60334
commit e6025e3be1
589 changed files with 172718 additions and 212 deletions

View File

@@ -1,10 +1,20 @@
<?php
// Load the auth module, this will redirect us to login if we aren't already logged in.
include '../../../inc/auth.php';
$Auth = new modAuth();
// Load the graph class so we can get user info
include '../../../inc/graph.php';
$Graph = new modGraph();
$uInfo = $Graph->getProfile();
session_start();
ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(E_ALL & ~E_NOTICE );
// Returns data to display list of entries to authenticated user
$uid = $_SESSION['uid'];
$uid = $uInfo->id;
// if(!$uid) {
// die("User not authenticated!");
// }
@@ -15,8 +25,9 @@
die("Unable to load configuration file!");
}
$aid = $_GET['aid'];
$isAdmin = $_SESSION['admin']==1;
$isAdmin = $uInfo->userPrincipalName==$cfg['admin'];
$mysqli = new mysqli($cfg['host'], $cfg['user'],$cfg['pass'], $cfg['name']);
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
@@ -38,6 +49,7 @@
$query = substr($query, 0, -5);
}
$query .= ' ORDER BY ID';
// file_put_contents('/tmp/zut',$query);
if ($result = $mysqli->query($query)) {
/* fetch associative array */
@@ -54,8 +66,8 @@
$one[$key] = $val;
}
$one['name'] = $row["name"];
if($one['demande_pour'] != $row["name"]) {
$one['name'] .= ' / ' . $one['demande_pour'];
if($one['name'] != $row["reqname"]) {
$one['name'] .= ' / ' . $row['reqname'];
}
$obj['data'][] = $one;
}