Init Git Prod Mars 2026
This commit is contained in:
commit
d81efe93b1
362 files changed
+86627
No files matched your search
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* /nom_afficher.php
|
||||
* Affiche le nom et prenom de la personne connecté lors de visio en Jitsi
|
||||
*/
|
||||
$displayName = 'Invité';
|
||||
|
||||
try {
|
||||
if ($refId > 0 && in_array($role, ['praticien','client'], true)) {
|
||||
// Adapte les noms de tables/colonnes si besoin
|
||||
if ($role === 'praticien') {
|
||||
$sql = "SELECT nom, prenom FROM praticien WHERE id = :id LIMIT 1";
|
||||
} else { // client
|
||||
$sql = "SELECT nom, prenom FROM client WHERE id = :id LIMIT 1";
|
||||
}
|
||||
$stmt = $pdo->prepare($sql);
|
||||
$stmt->execute(['id' => $refId]);
|
||||
if ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$pn = trim(($row['prenom'] ?? '') . ' ' . ($row['nom'] ?? ''));
|
||||
if ($pn !== '') {
|
||||
$displayName = $pn;
|
||||
} else {
|
||||
$displayName = ($role === 'praticien') ? 'Praticien' : 'Client';
|
||||
}
|
||||
} else {
|
||||
$displayName = ($role === 'praticien') ? 'Praticien' : 'Client';
|
||||
}
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// En cas d’erreur, on garde un fallback propre
|
||||
$displayName = ($role === 'praticien') ? 'Praticien' : 'Client';
|
||||
}
|
||||
|
||||
// Optionnel: mémoriser pour d'autres pages
|
||||
$_SESSION['display_name'] = $displayName;
|
||||
|
||||
// Sécuriser pour l'injecter côté JS
|
||||
$displayName = htmlspecialchars($displayName, ENT_QUOTES, 'UTF-8');
|
||||
$jitsiDomain = $config['jitsi_domain'];
|
||||
Reference in new issue
Block a user