Amélioration de la prise en charge des images Git et edition de connexion_sql #2
3
.gitattributes
vendored
@@ -16,3 +16,6 @@
|
||||
|
||||
# Forcer WebP en fichier binaire
|
||||
*.webp binary
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.jpeg binary
|
||||
6
.gitignore
vendored
@@ -99,9 +99,9 @@ $RECYCLE.BIN/
|
||||
# ----------------------
|
||||
# Images
|
||||
# ----------------------
|
||||
*.png
|
||||
*.jpg
|
||||
*.jpeg
|
||||
# *.png
|
||||
# *.jpg
|
||||
# *.jpeg
|
||||
*.gif
|
||||
|
||||
# ----------------------
|
||||
|
||||
@@ -1,43 +1,48 @@
|
||||
<?php
|
||||
// Connexion à la base de données
|
||||
try
|
||||
{
|
||||
$bdd = new PDO('mysql:host=localhost:3306;dbname=caria', 'ccbuser', 'HO9A#x@qD6Wl',array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"));
|
||||
$env = parse_ini_file(__DIR__ . '/../.env');
|
||||
if ($env === false) { die('Impossible de charger le fichier .env');}
|
||||
|
||||
try {
|
||||
$bdd = new PDO(
|
||||
sprintf('mysql:host=%s;port=%s;dbname=%s;charset=%s', $env['DB_HOST'], $env['DB_PORT'], $env['DB_NAME'], $env['DB_CHARSET']),
|
||||
$env['DB_USER'], $env['DB_PASS'],
|
||||
[
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::ATTR_EMULATE_PREPARES => false,
|
||||
]
|
||||
);
|
||||
} catch (PDOException $e) {
|
||||
die('Erreur : ' . $e->getMessage());
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
die('Erreur : '.$e->getMessage());
|
||||
}
|
||||
# Constantes
|
||||
|
||||
define('VISITEUR',1);
|
||||
define('INSCRIT',2);
|
||||
define('MODO',3);
|
||||
define('ADMIN',4);
|
||||
|
||||
define('ERR_IS_CO','Vous ne pouvez pas accéder à cette page si vous n\'êtes pas connecté');
|
||||
|
||||
session_start();
|
||||
# Connexion et initialisation des variables
|
||||
|
||||
$lvl_session = isset($_SESSION['privilege_session']) ? (int)$_SESSION['privilege_session'] : 1;
|
||||
$id_session = isset($_SESSION['id_session']) ? (int)$_SESSION['id_session'] : 0;
|
||||
$pseudo_session = isset($_SESSION['pseudo_session']) ? $_SESSION['pseudo_session'] : '';
|
||||
|
||||
function verifierAcces($min_privilege_requis) {
|
||||
// Vérifier si l'utilisateur est connecté
|
||||
function verifierAcces($min_privilege_requis)
|
||||
{
|
||||
if (!isset($_SESSION['id_session'])) {
|
||||
// Afficher la page d'erreur en incluant le fichier de vue
|
||||
$message = "Vous devez être connecté pour accéder à cette page.";
|
||||
include 'erreur.php';
|
||||
exit(); // Arrêter l'exécution du script après affichage de l'erreur
|
||||
exit();
|
||||
}
|
||||
|
||||
// Vérifier le privilège de l'utilisateur
|
||||
$privilege_utilisateur = isset($_SESSION['privilege_session']) ? (int)$_SESSION['privilege_session'] : VISITEUR;
|
||||
|
||||
// Vérifier si le privilège de l'utilisateur est suffisant pour accéder à la page
|
||||
$privilege_utilisateur = isset($_SESSION['privilege_session'])
|
||||
? (int)$_SESSION['privilege_session']
|
||||
: VISITEUR;
|
||||
if ($privilege_utilisateur < $min_privilege_requis) {
|
||||
// Afficher la page d'erreur en incluant le fichier de vue
|
||||
$message = "Vous n'avez pas les droits d'accès nécessaires pour accéder à cette page.";
|
||||
include 'erreur.php';
|
||||
exit(); // Arrêter l'exécution du script après affichage de l'erreur
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 336 KiB |
BIN
config/images/favicon.webp
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 157 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 163 KiB |
BIN
config/images/logo.webp
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
images/avatars/admccb/img_user.jpg
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur1/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur10/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur11/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur12/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur13/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur14/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur15/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur16/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur17/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur18/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur19/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur2/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur20/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur3/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur4/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur5/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur6/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur7/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur8/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/avatars/utilisateur9/img_user.jpg
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
@@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>CARIA Project</title>
|
||||
<link rel="shortcut icon" type="image/png" href="./config/images/favicon.png" />
|
||||
<link rel="shortcut icon" href="./config/images/favicon.webp" />
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="./css/style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="./module/bootstrap@5.3.3/dist/css/bootstrap.min.css" />
|
||||
<!--MAP-->
|
||||
@@ -17,7 +17,7 @@
|
||||
<body class="bg1">
|
||||
<header>
|
||||
<div class="container">
|
||||
<div class="text-center"><a href="index.php"><img src="./config/images/logo.png"></a></div>
|
||||
<div class="text-center"><a href="index.php"><img src="./config/images/logo.webp"></a></div>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-secondary">
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
|
||||