You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
986 B
43 lines
986 B
4 years ago
|
<?php
|
||
|
|
||
3 years ago
|
/**
|
||
|
* Page de fonctions concernant la gestion des domaines.
|
||
|
*/
|
||
|
|
||
3 years ago
|
require_once ($_SERVER["DOCUMENT_ROOT"]."/services/fonctions/bdd/connexion.php");
|
||
4 years ago
|
|
||
3 years ago
|
/**
|
||
|
* Fonction listant les domaines.
|
||
|
*/
|
||
4 years ago
|
function listeDomainesPostfix($pdo) {
|
||
|
try {
|
||
3 years ago
|
$req = 'SELECT domaine FROM postfix_domaines ORDER BY defaut DESC';
|
||
|
$sql=$pdo->prepare($req);
|
||
|
$sql->execute();
|
||
|
|
||
|
$liste_domaines = $sql->fetchAll();
|
||
3 years ago
|
return $liste_domaines;
|
||
4 years ago
|
}
|
||
|
catch (\Exception $e) {
|
||
|
die ("Erreur de requête de selection des domaines pour \"$base\" : ".$e->getMessage());
|
||
|
}
|
||
|
}
|
||
3 years ago
|
|
||
3 years ago
|
/**
|
||
|
* Fonction affichant le domaine par défaut.
|
||
|
*/
|
||
3 years ago
|
function retourneDomaineDefautPostfix($pdo) {
|
||
3 years ago
|
try {
|
||
3 years ago
|
$req = 'SELECT domaine FROM postfix_domaines WHERE defaut=1 LIMIT 1';
|
||
|
$sql=$pdo->prepare($req);
|
||
|
$sql->execute();
|
||
|
|
||
|
$domaine_defaut = $sql->fetchAll();
|
||
|
return $domaine_defaut[0]['domaine'];
|
||
3 years ago
|
}
|
||
|
catch (\Exception $e) {
|
||
|
die ("Erreur de requête de selection des domaines pour \"$base\" : ".$e->getMessage());
|
||
|
}
|
||
|
}
|
||
|
|
||
3 years ago
|
?>
|