Testando coisas no PHP LDAP

This commit is contained in:
emerson committed 2024-08-04 22:08:03 -03:00
1 parent 72304750b0
commit c1d216bcc6
2 files changed
+23

No files matched your search

+18
View File
@@ -1,7 +1,25 @@
<?php
// Autenticação básica HTTP para obter o nome de usuário
$username = $_SERVER['PHP_AUTH_USER'];
$target_dir = "/var/www/html/aliceclass_videos/" . $username;
# check if user dir exists
if (!file_exists($target_dir)) {
# if not, create it
if (mkdir($target_dir, 0775, true)) {
// echo "Directory created successfully.";
}
if (mkdir($target_dir . "/src", 0775, true)) {
// echo "Directory created successfully.";
}
if (mkdir($target_dir . "/dest", 0775, true)) {
// echo "Directory created successfully.";
}
}
// Exibir o nome de usuário
echo '<div class="username">';
echo 'Usuário: ' . htmlspecialchars($username);