Gymnopedia — errore';
echo '
Gymnopedia — configurazione
' . htmlspecialchars($msg, ENT_QUOTES, 'UTF-8') . '
';
echo '
Carica tutti i file nella stessa cartella di gymnopedia.php (FTP / file manager, non solo incolla HTML).
';
exit;
}
foreach (['gymnopedia-auth.inc.php', 'gymnopedia_registry.inc.php'] as $dep) {
if (!is_file(__DIR__ . '/' . $dep)) {
gymnopedia_die_setup('File mancante: ' . $dep);
}
}
if (!is_file(__DIR__ . '/gymnopedia-auth.config.php')) {
gymnopedia_die_setup('File mancante: gymnopedia-auth.config.php (copia da gymnopedia-auth.config.sample.php e imposta area_password).');
}
require_once __DIR__ . '/gymnopedia-auth.inc.php';
require_once __DIR__ . '/gymnopedia_registry.inc.php';
/* ── Login password area (primo cancello) ── */
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['gymnopedia_login'])) {
gymnopedia_sessione_attiva();
$pwdArea = (string) ($_POST['password'] ?? '');
if (gymnopedia_verifica_password_area($pwdArea)) {
gymnopedia_segna_login_ok();
header('Location: ' . (string) ($_SERVER['PHP_SELF'] ?? 'Gymnopedia.php'));
exit;
}
gymnopedia_render_login_form('Password area non corretta.');
exit;
}
if (isset($_GET['logout']) && (string) $_GET['logout'] === '1') {
gymnopedia_logout();
header('Location: ' . (string) ($_SERVER['PHP_SELF'] ?? 'Gymnopedia.php'));
exit;
}
if (!gymnopedia_utente_autenticato()) {
gymnopedia_render_login_form();
exit;
}
$utenteId = gymnopedia_utente_corrente();
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['gymno_id'])) {
$postedId = trim((string) $_POST['gymno_id']);
if ($postedId !== '') {
$utenteId = gymnopedia_normalizza_id($postedId);
}
}
$postEsito = gymnopedia_gestisci_post();
$registry = gymnopedia_carica_registry();
$inElenco = $utenteId !== '' ? gymnopedia_trova_utente($registry, $utenteId) : null;
$primaVolta = $inElenco === null;
$flagAttivo = !empty($_COOKIE['clintel_gymnopedia_ok']) || !empty($_SESSION['clintel_gymnopedia_ok']);
$cfgAuth = gymnopedia_auth_config();
$urlRicerche = trim((string) ($cfgAuth['url_ricerche'] ?? ''));
$urlGrafo = trim((string) ($cfgAuth['url_grafo'] ?? ''));
if ($urlRicerche === '' || $urlGrafo === '') {
$cfgPortale = gymnopedia_portale_config();
if ($urlRicerche === '') {
$urlRicerche = trim((string) ($cfgPortale['url_ricerche'] ?? ''));
}
if ($urlGrafo === '') {
$urlGrafo = trim((string) ($cfgPortale['url_grafo'] ?? ''));
}
}
$errore = '';
$successo = '';
if (is_array($postEsito)) {
if (!empty($postEsito['ok'])) {
$flagAttivo = true;
$utenteId = gymnopedia_utente_corrente();
if (!empty($postEsito['nuovo'])) {
$successo = 'Credenziali registrate. Salvataggio sul server CLINTEL abilitato in questo browser.';
} else {
$successo = 'Accesso al server confermato. Puoi usare Ricerche e Grafo con salvataggio sul NAS.';
}
$inElenco = gymnopedia_trova_utente(gymnopedia_carica_registry(), $utenteId);
$primaVolta = false;
} else {
$errore = (string) ($postEsito['errore'] ?? 'Operazione non riuscita.');
}
}
function gymnopedia_h(string $s): string
{
return htmlspecialchars($s, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
}
?>
Gymnopedia — accesso server
Area riservata (password). Qui registri l'ID utente e la password per il salvataggio ricerche e grafi sul server CLINTEL (NAS).
Salvataggio sul server attivo in questo browser.
Utenti autorizzati al salvataggio server
Nessuno ancora.
| ID utente | Registrato | Stato |
|
|
attivo— |