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)  

getfiles.php
Go to the documentation of this file.
1 <?php
24 require '../commons/base.inc.php';
25 if (!is_string($_GET['path'])) {
26  echo json_encode(
27  _('Invalid')
28  );
29  exit;
30 }
31 $path = $_GET['path'];
32 $decodePath = urldecode(
34  $path
35  )
36 );
37 $paths = explode(':', $decodePath);
38 foreach ((array)$paths as &$decodedPath) {
39  if (!(is_dir($decodedPath)
40  && file_exists($decodedPath)
41  && is_readable($decodedPath))
42  ) {
43  $files[] = json_encode(_('Path is unavailable'));
44  continue;
45  }
46  $replaced_dir_sep = str_replace(
47  array('\\', '/'),
48  array(
49  DS,
50  DS
51  ),
52  $decodedPath
53  );
54  $glob_str = sprintf(
55  '%s%s*',
56  $replaced_dir_sep,
57  DS
58  );
59  $files = FOGCore::fastmerge(
60  (array) $files,
61  (array) glob($glob_str)
62  );
63 }
64 echo json_encode(
66  $files
67  )
68 );
FOGBase\fastmerge
static fastmerge($array1)
Definition: fogbase.class.php:2415
$decodePath
$decodePath
Definition: getfiles.php:32
exit
exit
Definition: getfiles.php:69
Initiator\sanitizeItems
static sanitizeItems(&$value='')
Definition: init.php:311
$path
if(!is_string($_GET['path'])) $path
Definition: getfiles.php:31
$paths
$paths
Definition: getfiles.php:37