30 lines
834 B
PHP
30 lines
834 B
PHP
<?php
|
|
|
|
function PrintListFirsts(string $title, array $liste): string
|
|
{
|
|
$result = '<div class="list-group-item"><h5>' . $title . '</h5>';
|
|
$result .= '<div class="list-group ">';
|
|
foreach ($liste as $element) {
|
|
$result .= '<div class="list-group-item">' . $element[0] . "</div>";
|
|
}
|
|
$result .= "</div></div>";
|
|
return $result;
|
|
}
|
|
|
|
function PrintLoginInfo($info)
|
|
{
|
|
$body = '<h2 class="text-center pt-3">Bienvenue ' . $info->fullName . " !</h2>";
|
|
$body .= '<div class="list-group ">';
|
|
foreach ($info->ous as $ou) {
|
|
$body .= '<div class="list-group-item"><h3>' . $ou . "</h3>";
|
|
$body .= '<div class="list-group">';
|
|
$body .= PrintListFirsts("Utilisateurs", LdapGetUsersInOU($ou));
|
|
$body .= PrintListFirsts("Groupes", LdapGetGroupsInOU($ou));
|
|
$body .= "</div>";
|
|
$body .= "</div>";
|
|
|
|
}
|
|
$body .= "</div>";
|
|
return $body;
|
|
}
|