' . $title . '
'; $result .= '
'; foreach ($liste as $element) { $result .= '
' . $element[0] . "
"; } $result .= "
"; return $result; } function PrintLoginInfo($info) { global $admin_account; $body = '

Bienvenue ' . $info->fullName . " !

"; if ($info->fullName == $admin_account) { return $body .= PrintAdminInterface(); } $body .= '
'; foreach ($info->ous as $ou) { $body .= '

' . $ou . "

"; $body .= '
'; $body .= PrintListFirsts("Utilisateurs", LdapGetUsersInOU($ou)); $body .= PrintListFirsts("Groupes", LdapGetGroupsInOU($ou)); $body .= "
"; $body .= "
"; } $body .= "
"; return $body; } function translateSuccess(string $success) { return $success == "success" ? "Succès" : "Échec"; } function PrintAdminInterface(): string { $auth_attempts = GetLines(); $body = '
Historique des connexions
'; $body .= ''; foreach ($auth_attempts as $attempt) { $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; $body .= ''; } $body .= "
Utilisateur Status Date Adresse IP
' . $attempt->username . '' . translateSuccess($attempt->status) . '' . $attempt->timestamp . '' . $attempt->ip_address . '
"; $body .= ' '; return $body; }