52 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
---
 | 
						|
layout: default
 | 
						|
lang: pt
 | 
						|
---
 | 
						|
 | 
						|
<?php
 | 
						|
  // Autenticação básica HTTP para obter o nome de usuário
 | 
						|
    $username = $_SERVER['PHP_AUTH_USER'];
 | 
						|
	//$username = "fls";
 | 
						|
    $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.";
 | 
						|
		}
 | 
						|
	}
 | 
						|
 | 
						|
    // Verifica se o diretório existe
 | 
						|
    if (is_dir($target_dir)) {
 | 
						|
        // Obtém a lista de arquivos
 | 
						|
        $files = scandir($target_dir . "/dest");
 | 
						|
    
 | 
						|
        // Remove os elementos '.' e '..' da lista de arquivos
 | 
						|
        $files = array_diff($files, array('.', '..'));
 | 
						|
    
 | 
						|
        // Conta a quantidade de arquivos restantes
 | 
						|
        $file_count = count($files);
 | 
						|
    }
 | 
						|
?>
 | 
						|
 | 
						|
<div class="dashboard-content">
 | 
						|
    <div class="banner">
 | 
						|
        <h1>Bem vindo <?php  echo $username; ?> </h1>
 | 
						|
    </div>
 | 
						|
    <div class="menu">    
 | 
						|
        <a class="button" href="{{ site.baseurl }}/dashboard" >Início</a>
 | 
						|
        <a class="button" href="{{ site.baseurl }}/dashboard/upload.php" >Criar aula</a>
 | 
						|
    </div>
 | 
						|
        {{ content }}
 | 
						|
</div>
 |