mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 05:07:27 +02:00
Changes to how file inspector reports on some special files - thanks Lawbringer
This commit is contained in:
@@ -102,7 +102,7 @@ Standalone file scan - checks for a valid set of E107 files<br />";
|
|||||||
|
|
||||||
// Strip trailing '/' off each directory name
|
// Strip trailing '/' off each directory name
|
||||||
$maindirs = array('admin' => $ADMIN_DIRECTORY, 'files' => $FILES_DIRECTORY, 'images' => $IMAGES_DIRECTORY, 'themes' => $THEMES_DIRECTORY, 'plugins' => $PLUGINS_DIRECTORY, 'handlers' => $HANDLERS_DIRECTORY, 'languages' => $LANGUAGES_DIRECTORY, 'downloads' => $DOWNLOADS_DIRECTORY, 'docs' => $DOCS_DIRECTORY);
|
$maindirs = array('admin' => $ADMIN_DIRECTORY, 'files' => $FILES_DIRECTORY, 'images' => $IMAGES_DIRECTORY, 'themes' => $THEMES_DIRECTORY, 'plugins' => $PLUGINS_DIRECTORY, 'handlers' => $HANDLERS_DIRECTORY, 'languages' => $LANGUAGES_DIRECTORY, 'downloads' => $DOWNLOADS_DIRECTORY, 'docs' => $DOCS_DIRECTORY);
|
||||||
foreach ($maindirs as $maindirs_key => $maindirs_value)
|
foreach ($maindirs as $maindirs_key => $maindirs_value)
|
||||||
{
|
{
|
||||||
$coredir[$maindirs_key] = substr($maindirs_value, 0, -1);
|
$coredir[$maindirs_key] = substr($maindirs_value, 0, -1);
|
||||||
if (!file_exists(e_BASE.$coredir[$maindirs_key]))
|
if (!file_exists(e_BASE.$coredir[$maindirs_key]))
|
||||||
@@ -141,7 +141,7 @@ if (substr($HELP_DIRECTORY,-5,5) == 'help/')
|
|||||||
$DOCS_DIRECTORY = substr($HELP_DIRECTORY,0,-5); // Whatever $HELP_DIRECTORY is set to, assume docs are in a subdirectory called 'help' off it
|
$DOCS_DIRECTORY = substr($HELP_DIRECTORY,0,-5); // Whatever $HELP_DIRECTORY is set to, assume docs are in a subdirectory called 'help' off it
|
||||||
}
|
}
|
||||||
$maindirs = array('admin' => $ADMIN_DIRECTORY, 'files' => $FILES_DIRECTORY, 'images' => $IMAGES_DIRECTORY, 'themes' => $THEMES_DIRECTORY, 'plugins' => $PLUGINS_DIRECTORY, 'handlers' => $HANDLERS_DIRECTORY, 'languages' => $LANGUAGES_DIRECTORY, 'downloads' => $DOWNLOADS_DIRECTORY, 'docs' => $DOCS_DIRECTORY);
|
$maindirs = array('admin' => $ADMIN_DIRECTORY, 'files' => $FILES_DIRECTORY, 'images' => $IMAGES_DIRECTORY, 'themes' => $THEMES_DIRECTORY, 'plugins' => $PLUGINS_DIRECTORY, 'handlers' => $HANDLERS_DIRECTORY, 'languages' => $LANGUAGES_DIRECTORY, 'downloads' => $DOWNLOADS_DIRECTORY, 'docs' => $DOCS_DIRECTORY);
|
||||||
foreach ($maindirs as $maindirs_key => $maindirs_value)
|
foreach ($maindirs as $maindirs_key => $maindirs_value)
|
||||||
{
|
{
|
||||||
$coredir[$maindirs_key] = substr($maindirs_value, 0, -1);
|
$coredir[$maindirs_key] = substr($maindirs_value, 0, -1);
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ class file_inspector {
|
|||||||
var $alone = FALSE;
|
var $alone = FALSE;
|
||||||
var $dotree = FALSE;
|
var $dotree = FALSE;
|
||||||
|
|
||||||
function file_inspector($standalone = FALSE)
|
function file_inspector($standalone = FALSE)
|
||||||
{
|
{
|
||||||
global $PLUGINS_DIRECTORY, $THEMES_DIRECTORY;
|
global $PLUGINS_DIRECTORY, $THEMES_DIRECTORY;
|
||||||
$this->dotree = ($_POST['type'] == 'tree');
|
$this->dotree = ($_POST['type'] == 'tree');
|
||||||
@@ -218,21 +218,21 @@ class file_inspector {
|
|||||||
|
|
||||||
global $e107;
|
global $e107;
|
||||||
$this -> root_dir = $e107 -> file_path;
|
$this -> root_dir = $e107 -> file_path;
|
||||||
if (substr($this -> root_dir, -1) == '/')
|
if (substr($this -> root_dir, -1) == '/')
|
||||||
{
|
{
|
||||||
$this -> root_dir = substr($this -> root_dir, 0, -1);
|
$this -> root_dir = substr($this -> root_dir, 0, -1);
|
||||||
}
|
}
|
||||||
if ($_POST['core'] == 'fail')
|
if ($_POST['core'] == 'fail')
|
||||||
{
|
{
|
||||||
$_POST['integrity'] = TRUE;
|
$_POST['integrity'] = TRUE;
|
||||||
}
|
}
|
||||||
if (MAGIC_QUOTES_GPC && $_POST['regex'])
|
if (MAGIC_QUOTES_GPC && $_POST['regex'])
|
||||||
{
|
{
|
||||||
$_POST['regex'] = stripslashes($_POST['regex']);
|
$_POST['regex'] = stripslashes($_POST['regex']);
|
||||||
}
|
}
|
||||||
if ($_POST['regex'])
|
if ($_POST['regex'])
|
||||||
{
|
{
|
||||||
if ($_POST['core'] == 'fail')
|
if ($_POST['core'] == 'fail')
|
||||||
{
|
{
|
||||||
$_POST['core'] = 'all';
|
$_POST['core'] = 'all';
|
||||||
}
|
}
|
||||||
@@ -245,7 +245,7 @@ class file_inspector {
|
|||||||
if (substr($this->BASE_THEMES_DIR,-1) == '/') $this->BASE_THEMES_DIR = substr($this->BASE_THEMES_DIR,0,-1);
|
if (substr($this->BASE_THEMES_DIR,-1) == '/') $this->BASE_THEMES_DIR = substr($this->BASE_THEMES_DIR,0,-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
function scan_config()
|
function scan_config()
|
||||||
{
|
{
|
||||||
global $ns, $rs, $pref;
|
global $ns, $rs, $pref;
|
||||||
|
|
||||||
@@ -413,20 +413,23 @@ class file_inspector {
|
|||||||
{
|
{
|
||||||
global $coredir;
|
global $coredir;
|
||||||
|
|
||||||
if ($name == 'e_inspect.php') return 'nocalc'; // Special case for plugin integrity checking
|
if ($name == 'e_inspect.php') { return 'nocalc'; } // Special case for plugin integrity checking
|
||||||
|
|
||||||
$filename = $dir.'/'.$name;
|
$filename = $dir.'/'.$name;
|
||||||
$admin_dir = $this -> root_dir.'/'.$coredir['admin'].'/';
|
$admin_dir = $this->root_dir.'/'.$coredir['admin'].'/';
|
||||||
$test_list = array(
|
|
||||||
$admin_dir.'core_image.php' => 'uncalc',
|
$test_list = array();
|
||||||
$admin_dir.'filetypes.php' => 'uncalc',
|
|
||||||
$admin_dir.'filetypes_.php' => 'ignore',
|
// Files that are unable to be checked
|
||||||
$admin_dir.'admin_filetypes.php' => 'nocalc',
|
$test_list[$admin_dir.'core_image.php'] = 'uncalc';
|
||||||
$this -> root_dir.'/e107_config.php' => 'uncalc',
|
$test_list[$this->root_dir.'/e107_config.php'] = 'uncalc';
|
||||||
$this -> root_dir.'/e107.htaccess' => 'ignore',
|
|
||||||
$this -> root_dir.'/install.php' => 'ignore'
|
// Files that are likely to be renamed by user
|
||||||
);
|
$test_list[$admin_dir.'filetypes_.php'] = 'ignore';
|
||||||
if (isset($test_list[$filename])) return $test_list[$filename];
|
$test_list[$this->root_dir.'/e107.htaccess'] = 'ignore';
|
||||||
|
$test_list[$this->root_dir.'/e107.robots.txt'] = 'ignore';
|
||||||
|
|
||||||
|
if (isset($test_list[$filename])) { return $test_list[$filename]; }
|
||||||
return 'check';
|
return 'check';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -438,14 +441,14 @@ class file_inspector {
|
|||||||
// $dir
|
// $dir
|
||||||
// &$tree_end
|
// &$tree_end
|
||||||
// &$parent_expand
|
// &$parent_expand
|
||||||
function inspect($list, $deprecated, $level, $dir, &$tree_end, &$parent_expand)
|
function inspect($list, $deprecated, $level, $dir, &$tree_end, &$parent_expand)
|
||||||
{
|
{
|
||||||
global $coredir;
|
global $coredir;
|
||||||
|
|
||||||
unset ($childOut);
|
unset ($childOut);
|
||||||
$parent_expand = false;
|
$parent_expand = false;
|
||||||
$sub_text = '';
|
$sub_text = '';
|
||||||
if (substr($dir, -1) == '/')
|
if (substr($dir, -1) == '/')
|
||||||
{
|
{
|
||||||
$dir = substr($dir, 0, -1);
|
$dir = substr($dir, 0, -1);
|
||||||
}
|
}
|
||||||
@@ -456,10 +459,10 @@ class file_inspector {
|
|||||||
$directory = $level ? basename($dir) : SITENAME;
|
$directory = $level ? basename($dir) : SITENAME;
|
||||||
$level++;
|
$level++;
|
||||||
|
|
||||||
foreach ($list as $key => $value)
|
foreach ($list as $key => $value)
|
||||||
{
|
{
|
||||||
$this -> parent = $dir_id;
|
$this -> parent = $dir_id;
|
||||||
if (is_array($value))
|
if (is_array($value))
|
||||||
{ // Entry is a subdirectory - recurse another level
|
{ // Entry is a subdirectory - recurse another level
|
||||||
$path = $dir.'/'.$key;
|
$path = $dir.'/'.$key;
|
||||||
$child_open = false;
|
$child_open = false;
|
||||||
@@ -483,27 +486,27 @@ class file_inspector {
|
|||||||
$sub_text .= $this -> inspect($value, $deprecated[$key], $level, $path, $child_end, $child_expand);
|
$sub_text .= $this -> inspect($value, $deprecated[$key], $level, $path, $child_end, $child_expand);
|
||||||
}
|
}
|
||||||
$tree_end = false;
|
$tree_end = false;
|
||||||
if ($child_expand)
|
if ($child_expand)
|
||||||
{
|
{
|
||||||
$parent_expand = true;
|
$parent_expand = true;
|
||||||
$last_expand = true;
|
$last_expand = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$path = $dir.'/'.$key;
|
$path = $dir.'/'.$key;
|
||||||
$fid = strtolower($key);
|
$fid = strtolower($key);
|
||||||
$this -> files[$dir_id][$fid]['file'] = ($this->dotree) ? $key : $path;
|
$this -> files[$dir_id][$fid]['file'] = ($this->dotree) ? $key : $path;
|
||||||
if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE)
|
if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE)
|
||||||
{ // We're checking a file here
|
{ // We're checking a file here
|
||||||
if ($_POST['core'] != 'none')
|
if ($_POST['core'] != 'none')
|
||||||
{ // Look at core files
|
{ // Look at core files
|
||||||
$this -> count['core']['num']++;
|
$this -> count['core']['num']++;
|
||||||
$this -> count['core']['size'] += $this -> files[$dir_id][$fid]['size'];
|
$this -> count['core']['size'] += $this -> files[$dir_id][$fid]['size'];
|
||||||
if ($_POST['regex'])
|
if ($_POST['regex'])
|
||||||
{ // Developer prefs activated - search file contents according to regex
|
{ // Developer prefs activated - search file contents according to regex
|
||||||
$file_content = file($path); // Get contents of file
|
$file_content = file($path); // Get contents of file
|
||||||
if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE)
|
if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE)
|
||||||
{
|
{
|
||||||
if ($this -> files[$dir_id][$fid]['lines'] = preg_grep("#".$_POST['regex']."#".$_POST['mod'], $file_content))
|
if ($this -> files[$dir_id][$fid]['lines'] = preg_grep("#".$_POST['regex']."#".$_POST['mod'], $file_content))
|
||||||
{ // Search string found - add file to list
|
{ // Search string found - add file to list
|
||||||
@@ -513,41 +516,41 @@ class file_inspector {
|
|||||||
$parent_expand = TRUE;
|
$parent_expand = TRUE;
|
||||||
$this -> results++;
|
$this -> results++;
|
||||||
$this -> line_results += count($this -> files[$dir_id][$fid]['lines']);
|
$this -> line_results += count($this -> files[$dir_id][$fid]['lines']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Search string not found - discard from list
|
{ // Search string not found - discard from list
|
||||||
unset($this -> files[$dir_id][$fid]);
|
unset($this -> files[$dir_id][$fid]);
|
||||||
$known[$dir_id][$fid] = true;
|
$known[$dir_id][$fid] = true;
|
||||||
$dir_icon = ($dir_icon == 'fileinspector.png') ? $dir_icon : 'folder.png';
|
$dir_icon = ($dir_icon == 'fileinspector.png') ? $dir_icon : 'folder.png';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($_POST['integrity'])
|
if ($_POST['integrity'])
|
||||||
{ // Actually check file integrity
|
{ // Actually check file integrity
|
||||||
switch ($this_action = $this->check_action($dir,$key))
|
switch ($this_action = $this->check_action($dir,$key))
|
||||||
{
|
{
|
||||||
case 'ignore' :
|
case 'ignore' :
|
||||||
case 'check' :
|
case 'check' :
|
||||||
if ($this -> checksum($path) != $value)
|
if ($this -> checksum($path) != $value)
|
||||||
{
|
{
|
||||||
$this -> count['fail']['num']++;
|
$this -> count['fail']['num']++;
|
||||||
$this -> count['fail']['size'] += $this -> files[$dir_id][$fid]['size'];
|
$this -> count['fail']['size'] += $this -> files[$dir_id][$fid]['size'];
|
||||||
$this -> files[$dir_id][$fid]['icon'] = 'file_fail.png';
|
$this -> files[$dir_id][$fid]['icon'] = 'file_fail.png';
|
||||||
$dir_icon = 'folder_fail.png';
|
$dir_icon = 'folder_fail.png';
|
||||||
$parent_expand = TRUE;
|
$parent_expand = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this -> count['pass']['num']++;
|
$this -> count['pass']['num']++;
|
||||||
$this -> count['pass']['size'] += $this -> files[$dir_id][$fid]['size'];
|
$this -> count['pass']['size'] += $this -> files[$dir_id][$fid]['size'];
|
||||||
if ($_POST['core'] != 'fail')
|
if ($_POST['core'] != 'fail')
|
||||||
{
|
{
|
||||||
$this -> files[$dir_id][$fid]['icon'] = 'file_check.png';
|
$this -> files[$dir_id][$fid]['icon'] = 'file_check.png';
|
||||||
$dir_icon = ($dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png') ? $dir_icon : 'folder_check.png';
|
$dir_icon = ($dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png') ? $dir_icon : 'folder_check.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unset($this -> files[$dir_id][$fid]);
|
unset($this -> files[$dir_id][$fid]);
|
||||||
$known[$dir_id][$fid] = true;
|
$known[$dir_id][$fid] = true;
|
||||||
@@ -561,28 +564,28 @@ class file_inspector {
|
|||||||
if ($_POST['core'] != 'fail')
|
if ($_POST['core'] != 'fail')
|
||||||
{
|
{
|
||||||
$this -> files[$dir_id][$fid]['icon'] = 'file_uncalc.png';
|
$this -> files[$dir_id][$fid]['icon'] = 'file_uncalc.png';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unset($this -> files[$dir_id][$fid]);
|
unset($this -> files[$dir_id][$fid]);
|
||||||
$known[$dir_id][$fid] = true;
|
$known[$dir_id][$fid] = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Just identify as core file
|
{ // Just identify as core file
|
||||||
$this -> files[$dir_id][$fid]['icon'] = 'file_core.png';
|
$this -> files[$dir_id][$fid]['icon'] = 'file_core.png';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unset ($this -> files[$dir_id][$fid]);
|
unset ($this -> files[$dir_id][$fid]);
|
||||||
$known[$dir_id][$fid] = true;
|
$known[$dir_id][$fid] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($_POST['missing'])
|
elseif ($_POST['missing'])
|
||||||
{
|
{
|
||||||
switch ($this_action = $this->check_action($dir,$key))
|
switch ($this_action = $this->check_action($dir,$key))
|
||||||
{
|
{
|
||||||
@@ -600,8 +603,8 @@ class file_inspector {
|
|||||||
$known[$dir_id][$fid] = true;
|
$known[$dir_id][$fid] = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unset ($this -> files[$dir_id][$fid]);
|
unset ($this -> files[$dir_id][$fid]);
|
||||||
}
|
}
|
||||||
@@ -701,12 +704,12 @@ class file_inspector {
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
function scan_results()
|
function scan_results()
|
||||||
{
|
{
|
||||||
global $ns, $rs, $core_image, $deprecated_image, $tp, $e107;
|
global $ns, $rs, $core_image, $deprecated_image, $tp, $e107;
|
||||||
$scan_text = $this -> inspect($core_image, $deprecated_image, 0, $this -> root_dir);
|
$scan_text = $this -> inspect($core_image, $deprecated_image, 0, $this -> root_dir);
|
||||||
|
|
||||||
// if ($_POST['type'] == 'tree')
|
// if ($_POST['type'] == 'tree')
|
||||||
if ($this->dotree)
|
if ($this->dotree)
|
||||||
{
|
{
|
||||||
$text = "<div style='text-align:center'>
|
$text = "<div style='text-align:center'>
|
||||||
@@ -723,9 +726,9 @@ class file_inspector {
|
|||||||
".$scan_text."
|
".$scan_text."
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class='forumheader3' style='width:50%; vertical-align: top'><div style='height: 400px; overflow: auto'>";
|
<td class='forumheader3' style='width:50%; vertical-align: top'><div style='height: 400px; overflow: auto'>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text = "<div style='text-align:center'>
|
$text = "<div style='text-align:center'>
|
||||||
<table style='".ADMIN_WIDTH."' class='fborder'>
|
<table style='".ADMIN_WIDTH."' class='fborder'>
|
||||||
@@ -739,15 +742,15 @@ class file_inspector {
|
|||||||
|
|
||||||
$text .= "<table class='t' id='initial'>";
|
$text .= "<table class='t' id='initial'>";
|
||||||
|
|
||||||
// if ($_POST['type'] == 'tree')
|
// if ($_POST['type'] == 'tree')
|
||||||
if ($this->dotree)
|
if ($this->dotree)
|
||||||
{
|
{
|
||||||
$text .= "<tr><td class='f' style='padding-left: 4px'>
|
$text .= "<tr><td class='f' style='padding-left: 4px'>
|
||||||
<img src='".e_IMAGE."fileinspector/fileinspector.png' class='i' alt='' /> <b>".FR_LAN_3."</b></td>
|
<img src='".e_IMAGE."fileinspector/fileinspector.png' class='i' alt='' /> <b>".FR_LAN_3."</b></td>
|
||||||
<td class='s' style='text-align: right; padding-right: 4px' onclick=\"sh('f_".dechex(crc32($this -> root_dir))."')\">
|
<td class='s' style='text-align: right; padding-right: 4px' onclick=\"sh('f_".dechex(crc32($this -> root_dir))."')\">
|
||||||
<img src='".e_IMAGE."fileinspector/forward.png' class='i' alt='' /></td></tr>";
|
<img src='".e_IMAGE."fileinspector/forward.png' class='i' alt='' /></td></tr>";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text .= "<tr><td class='f' style='padding-left: 4px' colspan='2'>
|
$text .= "<tr><td class='f' style='padding-left: 4px' colspan='2'>
|
||||||
<img src='".e_IMAGE."fileinspector/fileinspector.png' class='i' alt='' /> <b>".FR_LAN_3."</b></td>
|
<img src='".e_IMAGE."fileinspector/fileinspector.png' class='i' alt='' /> <b>".FR_LAN_3."</b></td>
|
||||||
@@ -817,8 +820,8 @@ class file_inspector {
|
|||||||
</td></tr>";
|
</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// if ($_POST['type'] == 'tree' && !$this -> results && $_POST['regex'])
|
// if ($_POST['type'] == 'tree' && !$this -> results && $_POST['regex'])
|
||||||
if ($this->dotree && !$this -> results && $_POST['regex'])
|
if ($this->dotree && !$this -> results && $_POST['regex'])
|
||||||
{
|
{
|
||||||
$text .= "</td></tr>
|
$text .= "</td></tr>
|
||||||
<tr><td style='padding-right: 4px; text-align: center' colspan='2'><br />".FR_LAN_23."</td></tr>";
|
<tr><td style='padding-right: 4px; text-align: center' colspan='2'><br />".FR_LAN_23."</td></tr>";
|
||||||
@@ -826,13 +829,13 @@ class file_inspector {
|
|||||||
|
|
||||||
$text .= "</table>";
|
$text .= "</table>";
|
||||||
|
|
||||||
// if ($_POST['type'] != 'tree')
|
// if ($_POST['type'] != 'tree')
|
||||||
if (!$this->dotree)
|
if (!$this->dotree)
|
||||||
{
|
{
|
||||||
$text .= "<br /></td></tr><tr>
|
$text .= "<br /></td></tr><tr>
|
||||||
<td class='forumheader3' colspan='2'>
|
<td class='forumheader3' colspan='2'>
|
||||||
<table class='t'>";
|
<table class='t'>";
|
||||||
if (!$this -> results && $_POST['regex'])
|
if (!$this -> results && $_POST['regex'])
|
||||||
{
|
{
|
||||||
$text .= "<tr><td class='f' style='padding-left: 4px; text-align: center' colspan='2'>".FR_LAN_23."</td></tr>";
|
$text .= "<tr><td class='f' style='padding-left: 4px; text-align: center' colspan='2'>".FR_LAN_23."</td></tr>";
|
||||||
}
|
}
|
||||||
@@ -841,35 +844,35 @@ class file_inspector {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($this -> files as $dir_id => $fid)
|
foreach ($this -> files as $dir_id => $fid)
|
||||||
{
|
{
|
||||||
ksort($fid);
|
ksort($fid);
|
||||||
$text .= ($this->dotree) ? "<table class='t' style='display: none' id='f_".$dir_id."'>" : "";
|
$text .= ($this->dotree) ? "<table class='t' style='display: none' id='f_".$dir_id."'>" : "";
|
||||||
$initial = FALSE;
|
$initial = FALSE;
|
||||||
foreach ($fid as $key => $stext)
|
foreach ($fid as $key => $stext)
|
||||||
{
|
{
|
||||||
// if ($_POST['type'] == 'tree')
|
// if ($_POST['type'] == 'tree')
|
||||||
if ($this->dotree)
|
if ($this->dotree)
|
||||||
// if (!$initial)
|
// if (!$initial)
|
||||||
{
|
{
|
||||||
if (!$initial)
|
if (!$initial)
|
||||||
// if ($_POST['type'] == 'tree')
|
// if ($_POST['type'] == 'tree')
|
||||||
{
|
{
|
||||||
$text .= "<tr><td class='f' style='padding-left: 4px' ".($stext['level'] ? "onclick=\"sh('f_".$stext['parent']."')\"" : "").">
|
$text .= "<tr><td class='f' style='padding-left: 4px' ".($stext['level'] ? "onclick=\"sh('f_".$stext['parent']."')\"" : "").">
|
||||||
<img src='".e_IMAGE."fileinspector/".($stext['level'] ? "folder_up.png" : "folder_root.png")."' class='i' alt='' />".($stext['level'] ? " .." : "")."</td>
|
<img src='".e_IMAGE."fileinspector/".($stext['level'] ? "folder_up.png" : "folder_root.png")."' class='i' alt='' />".($stext['level'] ? " .." : "")."</td>
|
||||||
<td class='s' style='text-align: right; padding-right: 4px' onclick=\"sh('initial')\"><img src='".e_IMAGE."fileinspector/close.png' class='i' alt='' /></td></tr>";
|
<td class='s' style='text-align: right; padding-right: 4px' onclick=\"sh('initial')\"><img src='".e_IMAGE."fileinspector/close.png' class='i' alt='' /></td></tr>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if ($_POST['type'] != 'tree')
|
// if ($_POST['type'] != 'tree')
|
||||||
if (!$this->dotree)
|
if (!$this->dotree)
|
||||||
{
|
{
|
||||||
$stext['file'] = str_replace($this -> root_dir."/", "", $stext['file']);
|
$stext['file'] = str_replace($this -> root_dir."/", "", $stext['file']);
|
||||||
}
|
}
|
||||||
$text .= "<tr>
|
$text .= "<tr>
|
||||||
<td class='f'><img src='".e_IMAGE."fileinspector/".$stext['icon']."' class='i' alt='' /> ".$stext['file']." ";
|
<td class='f'><img src='".e_IMAGE."fileinspector/".$stext['icon']."' class='i' alt='' /> ".$stext['file']." ";
|
||||||
if ($_POST['regex'])
|
if ($_POST['regex'])
|
||||||
{
|
{
|
||||||
if ($_POST['num'] || $_POST['line']) {
|
if ($_POST['num'] || $_POST['line']) {
|
||||||
$text .= "<br />";
|
$text .= "<br />";
|
||||||
@@ -887,8 +890,8 @@ class file_inspector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$text .= "<br />";
|
$text .= "<br />";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$text .= "</td>
|
$text .= "</td>
|
||||||
<td class='s'>".$e107->parseMemorySize($stext['size']);
|
<td class='s'>".$e107->parseMemorySize($stext['size']);
|
||||||
@@ -904,7 +907,7 @@ class file_inspector {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if ($_POST['type'] != 'tree')
|
// if ($_POST['type'] != 'tree')
|
||||||
if (!$this->dotree)
|
if (!$this->dotree)
|
||||||
{
|
{
|
||||||
$text .= '</table>';
|
$text .= '</table>';
|
||||||
|
Reference in New Issue
Block a user