This commit is contained in:
2025-03-26 17:02:40 +01:00
parent 6afa94c84a
commit 5b31afe52e
8 changed files with 248 additions and 0 deletions

48
view/View.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
function brr()
{
echo "<br/>";
}
function brrr()
{
return "<br/>";
}
function PrintList(string $title, array $liste): string
{
$result = "<ul><p>$title</p>";
foreach ($liste as $element) {
$result .= "<li>$element</li>";
}
$result .= "</ul>";
return $result;
}
function PrintListFirsts(string $title, array $liste): string
{
$result = "<li>" . $title . "</li>";
$result .= "<ul>";
foreach ($liste as $element) {
$result .= "<li>" . $element[0] . "</li>";
}
$result .= "</ul>";
return $result;
}
function PrintLoginInfo($info)
{
$body = "Nom complet de l'utilisateur : " . $info->fullName;
$body .= "<ul>";
foreach ($info->ous as $ou) {
$body .= "<li>" . $ou;
$body .= "<ul>";
$body .= PrintListFirsts("Utilisateurs", LdapGetUsersInOU($ou));
$body .= PrintListFirsts("Groupes", LdapGetGroupsInOU($ou));
$body .= "</ul>";
$body .= "</li>";
}
$body .= "</ul>";
return $body;
}