AliceClass/dashboard.php

32 lines
723 B
PHP
Raw Normal View History

2024-08-04 22:12:33 -03:00
---
layout: default
lang: pt
---
2024-08-04 21:52:05 -03:00
<?php
// Autenticação básica HTTP para obter o nome de usuário
$username = $_SERVER['PHP_AUTH_USER'];
2024-08-04 22:08:03 -03:00
$target_dir = "/var/www/html/aliceclass_videos/" . $username;
2024-08-04 21:52:05 -03:00
2024-08-04 22:08:03 -03:00
# 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.";
}
}
2024-08-04 22:12:33 -03:00
2024-08-04 21:52:05 -03:00
// Exibir o nome de usuário
echo '<div class="username">';
echo 'Usuário: ' . htmlspecialchars($username);
echo '</div>';
?>