mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
file inspector text search enhancements
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/fileinspector.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/fileinspector.php,v $
|
||||||
| $Revision: 1.2 $
|
| $Revision: 1.3 $
|
||||||
| $Date: 2006-12-07 16:18:51 $
|
| $Date: 2006-12-19 01:55:23 $
|
||||||
| $Author: sweetas $
|
| $Author: sweetas $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -53,6 +53,7 @@ class file_inspector {
|
|||||||
var $parent;
|
var $parent;
|
||||||
var $count = array();
|
var $count = array();
|
||||||
var $results = 0;
|
var $results = 0;
|
||||||
|
var $line_results = 0;
|
||||||
|
|
||||||
function file_inspector() {
|
function file_inspector() {
|
||||||
global $e107;
|
global $e107;
|
||||||
@@ -177,6 +178,15 @@ class file_inspector {
|
|||||||
<input type='checkbox' name='line' value='1'".(($_POST['line'] || !isset($_POST['line'])) ? " checked='checked'" : "")." />
|
<input type='checkbox' name='line' value='1'".(($_POST['line'] || !isset($_POST['line'])) ? " checked='checked'" : "")." />
|
||||||
</td>
|
</td>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
|
$text .= "<tr>
|
||||||
|
<td class='forumheader3' style='width: 35%'>
|
||||||
|
".FC_LAN_22.":
|
||||||
|
</td>
|
||||||
|
<td colspan='2' class='forumheader3' style='width: 65%'>
|
||||||
|
<input type='checkbox' name='highlight' value='1'".(($_POST['highlight'] || !isset($_POST['highlight'])) ? " checked='checked'" : "")." />
|
||||||
|
</td>
|
||||||
|
</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "<tr>
|
$text .= "<tr>
|
||||||
@@ -264,6 +274,7 @@ class file_inspector {
|
|||||||
$dir_icon = 'fileinspector.png';
|
$dir_icon = 'fileinspector.png';
|
||||||
$parent_expand = TRUE;
|
$parent_expand = TRUE;
|
||||||
$this -> results++;
|
$this -> results++;
|
||||||
|
$this -> line_results += count($this -> files[$dir_id][$fid]['lines']);
|
||||||
} else {
|
} else {
|
||||||
unset($this -> files[$dir_id][$fid]);
|
unset($this -> files[$dir_id][$fid]);
|
||||||
$known[$dir_id][$fid] = true;
|
$known[$dir_id][$fid] = true;
|
||||||
@@ -421,7 +432,7 @@ class file_inspector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function scan_results() {
|
function scan_results() {
|
||||||
global $ns, $rs, $core_image, $deprecated_image, $imode;
|
global $ns, $rs, $core_image, $deprecated_image, $imode, $tp;
|
||||||
$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') {
|
||||||
@@ -479,6 +490,11 @@ class file_inspector {
|
|||||||
if ($_POST['core'] == 'all') {
|
if ($_POST['core'] == 'all') {
|
||||||
$text .= "<tr><td class='f'><img src='".e_IMAGE."packs/".$imode."/fileinspector/file.png' class='i' alt='' /> ".FR_LAN_6.": ".($this -> count['core']['num'] + $this -> count['unknown']['num'] + $this -> count['deprecated']['num'])." </td><td class='s'>".$this -> parsesize($this -> count['core']['size'] + $this -> count['unknown']['size'] + $this -> count['deprecated']['size'], 2)."</td></tr>";
|
$text .= "<tr><td class='f'><img src='".e_IMAGE."packs/".$imode."/fileinspector/file.png' class='i' alt='' /> ".FR_LAN_6.": ".($this -> count['core']['num'] + $this -> count['unknown']['num'] + $this -> count['deprecated']['num'])." </td><td class='s'>".$this -> parsesize($this -> count['core']['size'] + $this -> count['unknown']['size'] + $this -> count['deprecated']['size'], 2)."</td></tr>";
|
||||||
}
|
}
|
||||||
|
if ($_POST['regex']) {
|
||||||
|
$text .= "<tr><td class='f'><img src='".e_IMAGE."packs/".$imode."/fileinspector/file.png' class='i' alt='' /> ".FR_LAN_29.": ".($this -> results)." </td><td class='s'> </td></tr>";
|
||||||
|
$text .= "<tr><td class='f'><img src='".e_IMAGE."packs/".$imode."/fileinspector/file.png' class='i' alt='' /> ".FR_LAN_30.": ".($this -> line_results)." </td><td class='s'> </td></tr>";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($this -> count['warning']['num']) {
|
if ($this -> count['warning']['num']) {
|
||||||
$text .= "<tr><td colspan='2'> </td></tr>";
|
$text .= "<tr><td colspan='2'> </td></tr>";
|
||||||
@@ -564,9 +580,13 @@ class file_inspector {
|
|||||||
$text .= "[".($rkey + 1)."] ";
|
$text .= "[".($rkey + 1)."] ";
|
||||||
}
|
}
|
||||||
if ($_POST['line']) {
|
if ($_POST['line']) {
|
||||||
|
if ($_POST['highlight']) {
|
||||||
|
$text .= $tp -> e_highlight(htmlspecialchars($rvalue), $_POST['regex'])."<br />";
|
||||||
|
} else {
|
||||||
$text .= htmlspecialchars($rvalue)."<br />";
|
$text .= htmlspecialchars($rvalue)."<br />";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$text .= "<br />";
|
$text .= "<br />";
|
||||||
} else {
|
} else {
|
||||||
$text .= "</td>
|
$text .= "</td>
|
||||||
@@ -613,8 +633,8 @@ class file_inspector {
|
|||||||
$data .= "| GNU General Public License (http://gnu.org).\n";
|
$data .= "| GNU General Public License (http://gnu.org).\n";
|
||||||
$data .= "|\n";
|
$data .= "|\n";
|
||||||
$data .= "| \$Source: /cvs_backup/e107_0.8/e107_admin/fileinspector.php,v $\n";
|
$data .= "| \$Source: /cvs_backup/e107_0.8/e107_admin/fileinspector.php,v $\n";
|
||||||
$data .= "| \$Revision: 1.2 $\n";
|
$data .= "| \$Revision: 1.3 $\n";
|
||||||
$data .= "| \$Date: 2006-12-07 16:18:51 $\n";
|
$data .= "| \$Date: 2006-12-19 01:55:23 $\n";
|
||||||
$data .= "| \$Author: sweetas $\n";
|
$data .= "| \$Author: sweetas $\n";
|
||||||
$data .= "+----------------------------------------------------------------------------+\n";
|
$data .= "+----------------------------------------------------------------------------+\n";
|
||||||
$data .= "*/\n\n";
|
$data .= "*/\n\n";
|
||||||
|
@@ -4,9 +4,9 @@
|
|||||||
| e107 website system - Language File.
|
| e107 website system - Language File.
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_fileinspector.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_fileinspector.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:34:40 $
|
| $Date: 2006-12-19 01:55:23 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: sweetas $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -31,6 +31,7 @@ define("FC_LAN_18", "Regular expression");
|
|||||||
define("FC_LAN_19", "Show line numbers");
|
define("FC_LAN_19", "Show line numbers");
|
||||||
define("FC_LAN_20", "Show matched lines");
|
define("FC_LAN_20", "Show matched lines");
|
||||||
define("FC_LAN_21", "Old Core Files");
|
define("FC_LAN_21", "Old Core Files");
|
||||||
|
define("FC_LAN_22", "Highlight matched text");
|
||||||
|
|
||||||
define("FR_LAN_1", "Scanning");
|
define("FR_LAN_1", "Scanning");
|
||||||
define("FR_LAN_2", "Scan Results");
|
define("FR_LAN_2", "Scan Results");
|
||||||
@@ -70,4 +71,7 @@ define("FR_LAN_26", "Warning! Known Insecurity Detected!");
|
|||||||
define("FR_LAN_27", "There are files on your server that are known to be exploitable and must be removed immediately.");
|
define("FR_LAN_27", "There are files on your server that are known to be exploitable and must be removed immediately.");
|
||||||
define("FR_LAN_28", "Known insecure files");
|
define("FR_LAN_28", "Known insecure files");
|
||||||
|
|
||||||
|
define("FR_LAN_29", "Total files matched");
|
||||||
|
define("FR_LAN_30", "Total lines matched");
|
||||||
|
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user