Variabili dentro il file compose e alcuni fix

This commit is contained in:
2025-12-02 10:50:35 +01:00
parent 738811c0f3
commit 65d8c208bf
6 changed files with 124 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
<?php
session_start();
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
else if (!defined(API_URL) || API_URL == "") { header("Location: index.php"); exit; }
include("../lib/db.php");
$message = "";
$messageType = "";

View File

@@ -30,7 +30,11 @@ if (!isset($_SESSION['admin'])) {
<a href="classes.php">Gestisci Classi</a>
<a href="subjects.php">Gestisci Materie</a>
<a href="timetable.php">Gestisci Orario</a>
<a href="importer.php" style="background: #28a745;">🔄 Importa Orario</a>
<?php
if (defined(API_URL) || API_URL != "") {
echo '<a href="importer.php" style="background: #28a745;">🔄 Importa Orario</a>';
}
?>
<?php
if ($_SESSION['auth_type'] === 'local') {
echo '<a href="password.php">Cambia Password</a>';

View File

@@ -20,7 +20,7 @@ if (!defined('YEAR')) {
define('YEAR', '2025/26'); // Anno Scolastico Corrente
}
if (!defined('API_URL')) {
define('API_URL', 'http://localhost:3006/classe');
define('API_URL', ''); // URL API di importazione, lascia vuoto per disabilitare. Esempio: http://localhost:3006/classe
}
if (!defined('DEV_MODE')) {
define('DEV_MODE', false); // Modalita' di sviluppo: abilita messaggi di debug aggiuntivi. Imposta su false se sei in produzione