fogproject  1.5.9
About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.
  Fossies Dox: fogproject-1.5.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

freespace.php
Go to the documentation of this file.
1 <?php
22 session_write_close();
23 ignore_user_abort(true);
24 set_time_limit(0);
25 header('Content-Type: text/event-stream');
26 $decodePath = base64_decode($_REQUEST['path']);
27 if (!(file_exists($decodePath)
28  && is_readable($decodePath)
29  && is_dir($decodePath))
30 ) {
31  return;
32 }
33 $folder = escapeshellarg(
34  base64_decode($_REQUEST['path'])
35 );
36 $output = `df -PB1 $folder | tail -1`;
37 $test = preg_match(
38  '/\d+\s+(\d+)\s+(\d+)\s+\d+\%.*$/',
39  $output,
40  $match
41 );
42 if (!$test) {
43  return;
44 }
45 $hdfree = $match[2];
46 $hdused = $match[1];
47 $data = array(
48  'free' => $hdfree,
49  'used' => $hdused,
50 );
51 echo json_encode($data);
$decodePath
$decodePath
Definition: freespace.php:26
$test
$test
Definition: freespace.php:37
exit
exit
Definition: freespace.php:51
$folder
if(!(file_exists($decodePath) &&is_readable($decodePath) &&is_dir($decodePath))) $folder
Definition: freespace.php:33
$output
$output
Definition: freespace.php:36
$hdfree
if(! $test) $hdfree
Definition: freespace.php:45
$data
$data
Definition: freespace.php:47
$hdused
$hdused
Definition: freespace.php:46