Compare commits
59 Commits
e370435801
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7a77ebe85 | ||
| 65d8c208bf | |||
|
738811c0f3
|
|||
|
94955a0a42
|
|||
|
|
3595e0049e | ||
|
|
9c2ea5b8ff | ||
| cf4cb2679b | |||
| 4881b824eb | |||
| 5053db033f | |||
|
59359d33d3
|
|||
|
54e3818ce6
|
|||
| 56503f618d | |||
| f4122ca342 | |||
| bd3d23a8f8 | |||
| 04497f56d1 | |||
| d998c39778 | |||
| 081348ef8d | |||
| dc159ea173 | |||
| 1adb7b3a26 | |||
| 79b4ec78f3 | |||
| 4f0caf1f52 | |||
| e1be9c2b4e | |||
| 48092b7f75 | |||
| 721cfc386d | |||
|
70c7c0d6b9
|
|||
| f561aa8de5 | |||
| f800f0ab7f | |||
|
9c9c26a470
|
|||
| 40da7d0d58 | |||
| 0561902092 | |||
| 8c8d32e0c8 | |||
| 35ff83d1d0 | |||
| f91019b884 | |||
| 6b5b05199c | |||
| dc1d07c015 | |||
| d405a0e21c | |||
| f68162b80b | |||
| f98f5a3c07 | |||
| 7249325faf | |||
| b599691c2e | |||
| 8a37f24b40 | |||
| 725518ca8a | |||
| cbf6ef27a2 | |||
| 9c936ed3be | |||
| c3f8b52990 | |||
| 4de8528da2 | |||
| 0265af9dd2 | |||
| e8079c2ce7 | |||
| fb72f23544 | |||
| ddfa3d6dd8 | |||
| c619b748fa | |||
| 906beaaa4b | |||
| 86826c86bb | |||
|
79a4823726
|
|||
| 459663e069 | |||
| ccbb9806f5 | |||
| 07b197c89a | |||
| fff1e6cddf | |||
| 9c044b051c |
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
FROM php:8.2-apache
|
||||||
|
RUN docker-php-ext-install mysqli pdo pdo_mysql
|
||||||
|
COPY htdocs/ /var/www/html/
|
||||||
|
COPY docker/php/config.php /var/www/html/config/config.php
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
unzip \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
RUN composer --version
|
||||||
|
WORKDIR /var/www/html/admin
|
||||||
|
RUN composer install --no-interaction
|
||||||
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
|
RUN a2enmod rewrite
|
||||||
|
EXPOSE 80
|
||||||
39
README.md
39
README.md
@@ -1,3 +1,6 @@
|
|||||||
|
## AVVISO IMPORTANTE
|
||||||
|
Questo è il ramo di SVILUPPO. È inteso per testare le ultime funzionalità e aiutarmi nello sviluppo. La stabilità e il funzionamento del codice non sono garantiti. Usare a proprio rischio e pericolo.
|
||||||
|
|
||||||
# Orario Scuola
|
# Orario Scuola
|
||||||
Una piattaforma web per visualizzare gli orari scolastici delle classi, degli insegnanti e dei vari laboratori (se presenti)
|
Una piattaforma web per visualizzare gli orari scolastici delle classi, degli insegnanti e dei vari laboratori (se presenti)
|
||||||
|
|
||||||
@@ -79,6 +82,9 @@ if (!defined('APP_NAME')) {
|
|||||||
if (!defined('YEAR')) {
|
if (!defined('YEAR')) {
|
||||||
define('YEAR', '2025/26'); // Anno Scolastico Corrente
|
define('YEAR', '2025/26'); // Anno Scolastico Corrente
|
||||||
}
|
}
|
||||||
|
if (!defined('API_URL')) {
|
||||||
|
define('API_URL', ''); // URL API di importazione, lascia vuoto per disabilitare. Esempio: http://localhost:3006/classe
|
||||||
|
}
|
||||||
if (!defined('DEV_MODE')) {
|
if (!defined('DEV_MODE')) {
|
||||||
define('DEV_MODE', false); // Modalita' di sviluppo: abilita messaggi di debug aggiuntivi. Imposta su false se sei in produzione
|
define('DEV_MODE', false); // Modalita' di sviluppo: abilita messaggi di debug aggiuntivi. Imposta su false se sei in produzione
|
||||||
}
|
}
|
||||||
@@ -103,6 +109,9 @@ if (AUTH_TYPE === 'keycloak') {
|
|||||||
if (!defined('KEYCLOAK_CLIENT_SECRET')) {
|
if (!defined('KEYCLOAK_CLIENT_SECRET')) {
|
||||||
define('KEYCLOAK_CLIENT_SECRET',''); // Client Secret per Keycloak (ad esempio abcdefghijklm)
|
define('KEYCLOAK_CLIENT_SECRET',''); // Client Secret per Keycloak (ad esempio abcdefghijklm)
|
||||||
}
|
}
|
||||||
|
if (!defined('KEYCLOAK_ALLOWED_USERS')) {
|
||||||
|
define('KEYCLOAK_ALLOWED_USERS',[]); // Contiene i nomi utente degli utenti autorizzati ad accedere all'amministrazione
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
```
|
```
|
||||||
@@ -123,9 +132,33 @@ docker compose up -d --build
|
|||||||
```
|
```
|
||||||
3. Il container dovrebbe diventare disponibile su ``http://localhost:8080``
|
3. Il container dovrebbe diventare disponibile su ``http://localhost:8080``
|
||||||
|
|
||||||
### Per utenti Docker avanzati
|
### Personalizzare l'istanza
|
||||||
Se sei un utente Docker avanzato e vuoi personalizzare puoi modificare la configurazione di docker nei file ``docker/php/config.php``, ``docker-compose.yml`` e ``Dockerfile`` per adattare tutto al tuo ambiente.
|
Per cambiare le impostazioni dell'istanza basta aprire ``docker-compose.yml`` con un editor di testo e modificare le variabili d'ambiente:
|
||||||
Per la maggior parte degli utenti consigliamo di usare la configurazione per Docker predefinita.
|
```yaml
|
||||||
|
environment:
|
||||||
|
# --- Configuratione Database ---
|
||||||
|
DB_HOST: db # Host database
|
||||||
|
DB_USER: orario # Utente database
|
||||||
|
DB_PASS: orario # Password dell'utente del database
|
||||||
|
DB_NAME: school_timetable # Nome del database
|
||||||
|
|
||||||
|
# --- Impostazioni sito ---
|
||||||
|
APP_NAME: "Orario Scuola" # Nome del sito
|
||||||
|
YEAR: "2025/26" # Anno scolastico corrente
|
||||||
|
API_URL: "" # URL della API per l'importazione, lascia vuoto per disabilitare
|
||||||
|
DEV_MODE: "false" # Abilita modalita' di sviluppo per output dettagliato.
|
||||||
|
|
||||||
|
# --- Impostazioni Autenticazione ---
|
||||||
|
AUTH_TYPE: "local" # Tipo di autenticazione: può essere local o keycloak
|
||||||
|
APP_DOMAIN: "" # Dominio dell'app, ad esempio orario.tuosito.com
|
||||||
|
|
||||||
|
# --- Impostazioni di Keycloak (solo se il tipo di autenticazione è Keycloak) ---
|
||||||
|
KEYCLOAK_DOMAIN: "" # Dominio di Keycloak, ad esempio sso.tuosito.com
|
||||||
|
KEYCLOAK_REALM: "" # Realm di Keycloak, ad esempio master
|
||||||
|
KEYCLOAK_CLIENT_ID: "" # Client ID per Keycloak, ad esempio orario
|
||||||
|
KEYCLOAK_CLIENT_SECRET: "" # Client Secret per Keycloak, ad esempio abcde12345
|
||||||
|
KEYCLOAK_ALLOWED_USERS: '[]' # Nomi utente che possono accedere al pannello di controllo, lascia vuoto per consentire tutti gli utenti. Esempio: '["admin","prof","segreteria"]'
|
||||||
|
```
|
||||||
|
|
||||||
## Segnalare un problema
|
## Segnalare un problema
|
||||||
Per segnalare un problema puoi usare [Bugzilla](https://bugs.vichingo455.freeddns.org/describecomponents.cgi?product=Orario%20Scuola). Clicca [qui](https://bugs.vichingo455.freeddns.org/describecomponents.cgi?product=Orario%20Scuola) per andare a Bugzilla.
|
Per segnalare un problema puoi usare [Bugzilla](https://bugs.vichingo455.freeddns.org/describecomponents.cgi?product=Orario%20Scuola). Clicca [qui](https://bugs.vichingo455.freeddns.org/describecomponents.cgi?product=Orario%20Scuola) per andare a Bugzilla.
|
||||||
|
|||||||
@@ -7,15 +7,38 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
# --- Configuratione Database ---
|
||||||
|
DB_HOST: db # Host database
|
||||||
|
DB_USER: orario # Utente database
|
||||||
|
DB_PASS: orario # Password dell'utente del database
|
||||||
|
DB_NAME: school_timetable # Nome del database
|
||||||
|
|
||||||
|
# --- Impostazioni sito ---
|
||||||
|
APP_NAME: "Orario Scuola" # Nome del sito
|
||||||
|
YEAR: "2025/26" # Anno scolastico corrente
|
||||||
|
API_URL: "" # URL della API per l'importazione, lascia vuoto per disabilitare
|
||||||
|
DEV_MODE: "false" # Abilita modalita' di sviluppo per output dettagliato.
|
||||||
|
|
||||||
|
# --- Impostazioni Autenticazione ---
|
||||||
|
AUTH_TYPE: "local" # Tipo di autenticazione: può essere local o keycloak
|
||||||
|
APP_DOMAIN: "" # Dominio dell'app, ad esempio orario.tuosito.com
|
||||||
|
|
||||||
|
# --- Impostazioni di Keycloak (solo se il tipo di autenticazione è Keycloak) ---
|
||||||
|
KEYCLOAK_DOMAIN: "" # Dominio di Keycloak, ad esempio sso.tuosito.com
|
||||||
|
KEYCLOAK_REALM: "" # Realm di Keycloak, ad esempio master
|
||||||
|
KEYCLOAK_CLIENT_ID: "" # Client ID per Keycloak, ad esempio orario
|
||||||
|
KEYCLOAK_CLIENT_SECRET: "" # Client Secret per Keycloak, ad esempio abcde12345
|
||||||
|
KEYCLOAK_ALLOWED_USERS: '[]' # Nomi utente che possono accedere al pannello di controllo, lascia vuoto per consentire tutti gli utenti. Esempio: '["admin","prof","segreteria"]'
|
||||||
db:
|
db:
|
||||||
image: mariadb:11
|
image: mariadb:11
|
||||||
container_name: orario-db
|
container_name: orario-db
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: P@ssw0rd
|
MYSQL_ROOT_PASSWORD: P@ssw0rd # Password dell'utente root del database
|
||||||
MYSQL_DATABASE: school_timetable
|
MYSQL_DATABASE: school_timetable # Nome del database, da impostare in DB_NAME
|
||||||
MYSQL_USER: orario
|
MYSQL_USER: orario # Utente del database, da impostare in DB_USER
|
||||||
MYSQL_PASSWORD: orario
|
MYSQL_PASSWORD: orario # Password del database, da impostare in DB_PASS
|
||||||
volumes:
|
volumes:
|
||||||
- db_data:/var/lib/mysql
|
- db_data:/var/lib/mysql
|
||||||
- ./schema.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
- ./schema.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||||
|
|||||||
@@ -1,47 +1,147 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
// Impostazioni Database
|
// Impostazioni Database
|
||||||
if (!defined('DB_HOST')) {
|
if (!defined('DB_HOST')) {
|
||||||
define('DB_HOST', 'db');
|
$val = getenv('DB_HOST');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('DB_HOST', $val);
|
||||||
|
} else {
|
||||||
|
define('DB_HOST', 'db');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!defined('DB_USER')) {
|
if (!defined('DB_USER')) {
|
||||||
define('DB_USER', 'orario');
|
$val = getenv('DB_USER');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('DB_USER', $val);
|
||||||
|
} else {
|
||||||
|
define('DB_USER', 'orario');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!defined('DB_PASS')) {
|
if (!defined('DB_PASS')) {
|
||||||
define('DB_PASS', 'orario');
|
$val = getenv('DB_PASS');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('DB_PASS', $val);
|
||||||
|
} else {
|
||||||
|
define('DB_PASS', 'orario');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!defined('DB_NAME')) {
|
if (!defined('DB_NAME')) {
|
||||||
define('DB_NAME', 'school_timetable');
|
$val = getenv('DB_NAME');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('DB_NAME', $val);
|
||||||
|
} else {
|
||||||
|
define('DB_NAME', 'school_timetable');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Impostazioni sito generali
|
// Impostazioni sito generali
|
||||||
if (!defined('APP_NAME')) {
|
if (!defined('APP_NAME')) {
|
||||||
define('APP_NAME', 'Orario Scuola');
|
$val = getenv('APP_NAME');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('APP_NAME', $val);
|
||||||
|
} else {
|
||||||
|
define('APP_NAME', 'Orario Scuola');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!defined('YEAR')) {
|
if (!defined('YEAR')) {
|
||||||
define('YEAR', '2025/26');
|
$val = getenv('YEAR');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('YEAR', $val);
|
||||||
|
} else {
|
||||||
|
define('YEAR', '2025/26');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!defined('API_URL')) {
|
||||||
|
$val = getenv('API_URL');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('API_URL', $val);
|
||||||
|
} else {
|
||||||
|
define('API_URL', '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!defined('DEV_MODE')) {
|
if (!defined('DEV_MODE')) {
|
||||||
define('DEV_MODE', false); // Modalita' di sviluppo
|
$val = getenv('DEV_MODE');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('DEV_MODE', $val);
|
||||||
|
} else {
|
||||||
|
define('DEV_MODE', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Impostazioni autenticazione dashboard amministrativa
|
// Impostazioni autenticazione dashboard amministrativa
|
||||||
if (!defined('AUTH_TYPE')) {
|
if (!defined('AUTH_TYPE')) {
|
||||||
define('AUTH_TYPE','local'); // Può essere local (integrata), keycloak, google
|
$val = getenv('AUTH_TYPE');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('AUTH_TYPE', $val);
|
||||||
|
} else {
|
||||||
|
define('AUTH_TYPE','local');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!defined('APP_DOMAIN')) {
|
if (!defined('APP_DOMAIN')) {
|
||||||
define('APP_DOMAIN',''); // Dominio del sito (ad esempio orario.yourdomain.com), richiesto per autenticazioni non local
|
$val = getenv('APP_DOMAIN');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('APP_DOMAIN', $val);
|
||||||
|
} else {
|
||||||
|
define('APP_DOMAIN','');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Impostazioni autenticazione via Keycloak (richiesto solo se AUTH_TYPE sta impostato su keycloak)
|
// Impostazioni autenticazione via Keycloak (richiesto solo se AUTH_TYPE sta impostato su keycloak)
|
||||||
if (AUTH_TYPE === 'keycloak') {
|
if (AUTH_TYPE === 'keycloak') {
|
||||||
if (!defined('KEYCLOAK_DOMAIN')) {
|
if (!defined('KEYCLOAK_DOMAIN')) {
|
||||||
define('KEYCLOAK_DOMAIN',''); // Dominio di Keycloak (ad esempio auth.yourdomain.com)
|
$val = getenv('KEYCLOAK_DOMAIN');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('KEYCLOAK_DOMAIN', $val);
|
||||||
|
} else {
|
||||||
|
define('KEYCLOAK_DOMAIN','');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!defined('KEYCLOAK_REALM')) {
|
if (!defined('KEYCLOAK_REALM')) {
|
||||||
define('KEYCLOAK_REALM',''); // Realm di Keycloak (ad esempio master)
|
$val = getenv('KEYCLOAK_REALM');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('KEYCLOAK_REALM', $val);
|
||||||
|
} else {
|
||||||
|
define('KEYCLOAK_REALM','');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!defined('KEYCLOAK_CLIENT_ID')) {
|
if (!defined('KEYCLOAK_CLIENT_ID')) {
|
||||||
define('KEYCLOAK_CLIENT_ID',''); // Client ID per Keycloak (ad esempio orario)
|
$val = getenv('KEYCLOAK_CLIENT_ID');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('DB_USER', $val);
|
||||||
|
} else {
|
||||||
|
define('KEYCLOAK_CLIENT_ID','');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!defined('KEYCLOAK_CLIENT_SECRET')) {
|
if (!defined('KEYCLOAK_CLIENT_SECRET')) {
|
||||||
define('KEYCLOAK_CLIENT_SECRET',''); // Client Secret per Keycloak (ad esempio abcdefghijklm)
|
$val = getenv('KEYCLOAK_CLIENT_SECRET');
|
||||||
|
if ($val !== false && $val !== '') {
|
||||||
|
define('KEYCLOAK_CLIENT_SECRET', $val);
|
||||||
|
} else {
|
||||||
|
define('KEYCLOAK_CLIENT_SECRET','');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!defined('KEYCLOAK_ALLOWED_USERS')) {
|
||||||
|
$json = getenv('USERS');
|
||||||
|
if ($json === false || trim($json) === '') {
|
||||||
|
define('KEYCLOAK_ALLOWED_USERS',[]);
|
||||||
|
}
|
||||||
|
$users = json_decode($json, true);
|
||||||
|
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||||
|
define('KEYCLOAK_ALLOWED_USERS',[]);
|
||||||
|
}
|
||||||
|
define('KEYCLOAK_ALLOWED_USERS',$users);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
session_start();
|
session_start();
|
||||||
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
||||||
include("../lib/db.php");
|
include("../lib/db.php");
|
||||||
|
|||||||
@@ -1,8 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
session_start();
|
session_start();
|
||||||
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
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");
|
include("../lib/db.php");
|
||||||
|
|
||||||
$message = "";
|
$message = "";
|
||||||
$messageType = "";
|
$messageType = "";
|
||||||
|
|
||||||
@@ -10,7 +26,6 @@ $messageType = "";
|
|||||||
if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST['import'])) {
|
if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST['import'])) {
|
||||||
$classe_codice = trim($_POST['classe_codice']);
|
$classe_codice = trim($_POST['classe_codice']);
|
||||||
$classe_id = intval($_POST['classe_id']);
|
$classe_id = intval($_POST['classe_id']);
|
||||||
$api_url = trim($_POST['api_url']);
|
|
||||||
|
|
||||||
if (empty($classe_codice) || $classe_id === 0) {
|
if (empty($classe_codice) || $classe_id === 0) {
|
||||||
$message = "Compila tutti i campi obbligatori.";
|
$message = "Compila tutti i campi obbligatori.";
|
||||||
@@ -18,7 +33,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST['import'])) {
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
// Chiama l'API Node.js
|
// Chiama l'API Node.js
|
||||||
$url = $api_url . "?classe=" . urlencode($classe_codice);
|
$url = API_URL . "?classe=" . urlencode($classe_codice);
|
||||||
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
@@ -292,13 +307,6 @@ if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST['import'])) {
|
|||||||
<small>Codice della classe nel sistema esterno</small>
|
<small>Codice della classe nel sistema esterno</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="api_url">URL API Node.js</label>
|
|
||||||
<input type="text" name="api_url" id="api_url"
|
|
||||||
value="http://localhost:3006/classe" required>
|
|
||||||
<small>Endpoint dell'API Node.js per lo scraping</small>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button type="submit" name="import" style="width: 100%; padding: 12px; font-size: 16px;">
|
<button type="submit" name="import" style="width: 100%; padding: 12px; font-size: 16px;">
|
||||||
🔄 Importa Orario
|
🔄 Importa Orario
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
include_once __DIR__ . '/../config/config.php';
|
include_once __DIR__ . '/../config/config.php';
|
||||||
session_start();
|
session_start();
|
||||||
if (!isset($_SESSION['admin'])) {
|
if (!isset($_SESSION['admin'])) {
|
||||||
@@ -30,7 +46,11 @@ if (!isset($_SESSION['admin'])) {
|
|||||||
<a href="classes.php">Gestisci Classi</a>
|
<a href="classes.php">Gestisci Classi</a>
|
||||||
<a href="subjects.php">Gestisci Materie</a>
|
<a href="subjects.php">Gestisci Materie</a>
|
||||||
<a href="timetable.php">Gestisci Orario</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
|
<?php
|
||||||
if ($_SESSION['auth_type'] === 'local') {
|
if ($_SESSION['auth_type'] === 'local') {
|
||||||
echo '<a href="password.php">Cambia Password</a>';
|
echo '<a href="password.php">Cambia Password</a>';
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
use Jumbojett\OpenIDConnectClient;
|
use Jumbojett\OpenIDConnectClient;
|
||||||
require 'vendor/autoload.php';
|
require 'vendor/autoload.php';
|
||||||
session_start();
|
session_start();
|
||||||
@@ -64,18 +80,49 @@ else if (AUTH_TYPE === 'keycloak') {
|
|||||||
try {
|
try {
|
||||||
// Configura il client Keycloak
|
// Configura il client Keycloak
|
||||||
$oidc = new OpenIDConnectClient(
|
$oidc = new OpenIDConnectClient(
|
||||||
'https://' + KEYCLOAK_DOMAIN + '/realms/' + KEYCLOAK_REALM + '/',
|
'https://' . KEYCLOAK_DOMAIN . '/realms/' . KEYCLOAK_REALM . '/',
|
||||||
KEYCLOAK_CLIENT_ID,
|
KEYCLOAK_CLIENT_ID,
|
||||||
KEYCLOAK_CLIENT_SECRET
|
KEYCLOAK_CLIENT_SECRET
|
||||||
);
|
);
|
||||||
// Redirect post-login
|
// Redirect post-login
|
||||||
$oidc->setRedirectURL('https://' + APP_DOMAIN + '/admin/login.php');
|
$oidc->setRedirectURL('https://' . APP_DOMAIN . '/admin/login.php');
|
||||||
$oidc->authenticate();
|
$oidc->authenticate();
|
||||||
$userinfo = $oidc->getVerifiedClaims();
|
$userinfo = $oidc->getVerifiedClaims();
|
||||||
$_SESSION['admin'] = $userinfo->preferred_username;
|
if (in_array($userinfo->preferred_username, KEYCLOAK_ALLOWED_USERS, true) || empty(KEYCLOAK_ALLOWED_USERS)) {
|
||||||
$_SESSION['auth_type'] = 'keycloak';
|
$_SESSION['admin'] = $userinfo->preferred_username;
|
||||||
header("Location: index.php");
|
$_SESSION['auth_type'] = 'keycloak';
|
||||||
exit;
|
header("Location: index.php");
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
http_response_code(403);
|
||||||
|
echo <<<HTML
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Login Admin</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="navbar">
|
||||||
|
<div class="logo">Admin Dashboard</div>
|
||||||
|
<div class="links">
|
||||||
|
<a href="/">Torna al sito</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Container login -->
|
||||||
|
<div class="login-container">
|
||||||
|
<h1>Login Admin</h1>
|
||||||
|
<br><div class='error'>Non sei autorizzato ad accedere a questa parte del sito.</div>
|
||||||
|
</div>
|
||||||
|
<p style="text-align: center;">Copyright (C) 2025 EmmeV. - Released under <a href="https://git.vichingo455.freeddns.org/emmev-code/orario/src/branch/stable/LICENSE.txt" target="_blank">GNU AGPL 3.0 License</a>.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
HTML;
|
||||||
|
exit;
|
||||||
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
echo <<<HTML
|
echo <<<HTML
|
||||||
|
|||||||
@@ -1,9 +1,25 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
include("../config/config.php");
|
include("../config/config.php");
|
||||||
session_start();
|
session_start();
|
||||||
session_destroy();
|
session_destroy();
|
||||||
if (AUTH_TYPE === 'local')
|
if (AUTH_TYPE === 'local')
|
||||||
header("Location: /index.php");
|
header("Location: /index.php");
|
||||||
else if (AUTH_TYPE === 'keycloak')
|
else if (AUTH_TYPE === 'keycloak')
|
||||||
header('Location: https://' + KEYCLOAK_DOMAIN + '/realms/' + KEYCLOAK_REALM + '/protocol/openid-connect/logout?post_logout_redirect_uri=https://' + APP_DOMAIN + '&client_id=' + KEYCLOAK_CLIENT_ID);
|
header('Location: https://' . KEYCLOAK_DOMAIN . '/realms/' . KEYCLOAK_REALM . '/protocol/openid-connect/logout?post_logout_redirect_uri=https://' . APP_DOMAIN + '&client_id=' . KEYCLOAK_CLIENT_ID);
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
session_start();
|
session_start();
|
||||||
include("../lib/db.php");
|
include("../lib/db.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
/* ===== BASE ===== */
|
/* ===== BASE ===== */
|
||||||
body {
|
body {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
session_start();
|
session_start();
|
||||||
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
||||||
include("../lib/db.php");
|
include("../lib/db.php");
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
session_start();
|
session_start();
|
||||||
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
||||||
include("../lib/db.php");
|
include("../lib/db.php");
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
session_start();
|
session_start();
|
||||||
include("../lib/db.php");
|
include("../lib/db.php");
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
// Impostazioni Database
|
// Impostazioni Database
|
||||||
if (!defined('DB_HOST')) {
|
if (!defined('DB_HOST')) {
|
||||||
define('DB_HOST', '<MYSQL_HOST>'); // Host del database (ad esempio localhost)
|
define('DB_HOST', '<MYSQL_HOST>'); // Host del database (ad esempio localhost)
|
||||||
@@ -19,6 +35,9 @@ if (!defined('APP_NAME')) {
|
|||||||
if (!defined('YEAR')) {
|
if (!defined('YEAR')) {
|
||||||
define('YEAR', '2025/26'); // Anno Scolastico Corrente
|
define('YEAR', '2025/26'); // Anno Scolastico Corrente
|
||||||
}
|
}
|
||||||
|
if (!defined('API_URL')) {
|
||||||
|
define('API_URL', ''); // URL API di importazione, lascia vuoto per disabilitare. Esempio: http://localhost:3006/classe
|
||||||
|
}
|
||||||
if (!defined('DEV_MODE')) {
|
if (!defined('DEV_MODE')) {
|
||||||
define('DEV_MODE', false); // Modalita' di sviluppo: abilita messaggi di debug aggiuntivi. Imposta su false se sei in produzione
|
define('DEV_MODE', false); // Modalita' di sviluppo: abilita messaggi di debug aggiuntivi. Imposta su false se sei in produzione
|
||||||
}
|
}
|
||||||
@@ -43,5 +62,8 @@ if (AUTH_TYPE === 'keycloak') {
|
|||||||
if (!defined('KEYCLOAK_CLIENT_SECRET')) {
|
if (!defined('KEYCLOAK_CLIENT_SECRET')) {
|
||||||
define('KEYCLOAK_CLIENT_SECRET',''); // Client Secret per Keycloak (ad esempio abcdefghijklm)
|
define('KEYCLOAK_CLIENT_SECRET',''); // Client Secret per Keycloak (ad esempio abcdefghijklm)
|
||||||
}
|
}
|
||||||
|
if (!defined('KEYCLOAK_ALLOWED_USERS')) {
|
||||||
|
define('KEYCLOAK_ALLOWED_USERS',[]); // Contiene i nomi utente degli utenti autorizzati ad accedere all'amministrazione
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
/* Base styles */
|
/* Base styles */
|
||||||
body {
|
body {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
/* Navbar */
|
/* Navbar */
|
||||||
.navbar {
|
.navbar {
|
||||||
background-color: #2c3e50;
|
background-color: #2c3e50;
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
/* Base styles */
|
/* Base styles */
|
||||||
body {
|
body {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
include("lib/db.php");
|
include("lib/db.php");
|
||||||
$days = ["Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"];
|
$days = ["Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"];
|
||||||
$hours = [
|
$hours = [
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
include("lib/db.php");
|
include("lib/db.php");
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
include("lib/db.php");
|
include("lib/db.php");
|
||||||
$days = ["Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"];
|
$days = ["Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato"];
|
||||||
$hours = [
|
$hours = [
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
include_once __DIR__ . '/../config/config.php';
|
include_once __DIR__ . '/../config/config.php';
|
||||||
$host = DB_HOST;
|
$host = DB_HOST;
|
||||||
$user = DB_USER;
|
$user = DB_USER;
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
include("lib/db.php"); // FIX: Decommentato
|
include("lib/db.php"); // FIX: Decommentato
|
||||||
$class_id = intval($_GET['class_id']);
|
$class_id = intval($_GET['class_id']);
|
||||||
$class = $conn->query("SELECT * FROM classes WHERE id=$class_id")->fetch_assoc();
|
$class = $conn->query("SELECT * FROM classes WHERE id=$class_id")->fetch_assoc();
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
// Hashed Password Generator
|
/*
|
||||||
// Copyright (C) 2025 EmmeV. All rights reserved.
|
Orario Scuola, Copyright (C) 2025 EmmeV.
|
||||||
// Usage: php generate_hash.php password_to_hash
|
|
||||||
// Example: php generate_hash.php admin
|
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see https://www.gnu.org/licenses/.
|
||||||
|
*/
|
||||||
if ($argc > 1) {
|
if ($argc > 1) {
|
||||||
$primoArgomento = $argv[1];
|
$primoArgomento = $argv[1];
|
||||||
$password = password_hash($primoArgomento, PASSWORD_DEFAULT);
|
$password = password_hash($primoArgomento, PASSWORD_DEFAULT);
|
||||||
|
|||||||
Reference in New Issue
Block a user