troppe modifiche, non so cosa scrivere
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
session_start();
|
||||
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
||||
include("../lib/db.php");
|
||||
include("../config/config.php");
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['name'])) {
|
||||
$name = $_POST['name'];
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
use Jumbojett\OpenIDConnectClient;
|
||||
require 'vendor/autoload.php';
|
||||
session_start();
|
||||
include("../lib/db.php");
|
||||
include("../config/config.php");
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && AUTH_TYPE === 'local') {
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && AUTH_TYPE == 'local') {
|
||||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
$stmt = $conn->prepare("SELECT * FROM admin WHERE username = ?");
|
||||
@@ -20,8 +20,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && AUTH_TYPE === 'local') {
|
||||
}
|
||||
$error = "Credenziali non valide";
|
||||
}
|
||||
if (AUTH_TYPE === 'local') {
|
||||
echo ```<!DOCTYPE html>
|
||||
if (AUTH_TYPE == 'local') {
|
||||
echo <<<HTML
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Login Admin</title>
|
||||
@@ -45,16 +46,16 @@ if (AUTH_TYPE === 'local') {
|
||||
<input type="password" name="password" placeholder="Password" required><br>
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
<?php if(isset($error)) echo "<br><div class='error'>$error</div>"; ?>
|
||||
</div>
|
||||
HTML;
|
||||
if(isset($error)) echo "<br><div class='error'>$error</div>";
|
||||
echo <<<HTML
|
||||
</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>
|
||||
HTML;
|
||||
}
|
||||
else if (AUTH_TYPE === 'keycloak') {
|
||||
require 'vendor/autoload.php';
|
||||
use Jumbojett\OpenIDConnectClient;
|
||||
session_start();
|
||||
// Configura il client Keycloak
|
||||
$oidc = new OpenIDConnectClient(
|
||||
'https://' + KEYCLOAK_DOMAIN + '/realms/' + KEYCLOAK_REALM + '/',
|
||||
|
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
include("../lib/db.php");
|
||||
include("../config/config.php");
|
||||
|
||||
if (!isset($_SESSION['admin']) || $_SESSION['auth_type'] != 'local') {
|
||||
header("Location: login.php");
|
||||
|
@@ -2,7 +2,6 @@
|
||||
session_start();
|
||||
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
||||
include("../lib/db.php");
|
||||
include("../config/config.php");
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['name'])) {
|
||||
$name = $_POST['name'];
|
||||
|
@@ -2,7 +2,6 @@
|
||||
session_start();
|
||||
if (!isset($_SESSION['admin'])) { header("Location: login.php"); exit; }
|
||||
include("../lib/db.php");
|
||||
include("../config/config.php");
|
||||
|
||||
// --- Recupera tutte le materie ---
|
||||
$subjects = [];
|
||||
|
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
session_start();
|
||||
include("../lib/db.php");
|
||||
include("../config/config.php");
|
||||
|
||||
if (!isset($_SESSION['admin']) || $_SESSION['auth_type'] != 'local' || $_SESSION['admin'] != 'admin') {
|
||||
header("Location: login.php");
|
||||
|
Reference in New Issue
Block a user