read()) {
if ($entry != "." && $entry != "..") {
if (is_dir($dirName."/".$entry)) {
if ($entry == 'CVS') {
// skip
} else {
getDirList($dirName."/".$entry);
}
} else {
if (substr($entry, strrpos($entry, '.')) == $file_extension) {
//echo 'I AM HERE 2 ' . $dirName."/".$entry . '
';
// $directory_array[] .= $dirName."/".$entry;
} else {
//echo 'I AM HERE 3 ' . $dirName."/".$entry . '
';
}
}
}
}
$d->close();
}
return $sub_dir_files;
}
function zen_display_files($include_root = false) {
global $check_directory, $found, $configuration_key_lookup;
global $db;
for ($i = 0, $n = sizeof($check_directory); $i < $n; $i++) {
//echo 'I SEE ' . $check_directory[$i] . '
';
$dir_check = $check_directory[$i];
$file_extension = '.php';
if ($dir = @dir($dir_check)) {
while ($file = $dir->read()) {
if (!is_dir($dir_check . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$directory_array[] = $dir_check . $file;
}
}
}
if (sizeof($directory_array)) {
sort($directory_array);
}
$dir->close();
}
}
if ($include_root == true) {
$original_array = $directory_array;
$root_array = array();
$root_array[] = DIR_FS_CATALOG . 'index.php';
$root_array[] = DIR_FS_CATALOG . 'ipn_main_handler.php';
$root_array[] = DIR_FS_CATALOG . 'ipn_test.php';
$root_array[] = DIR_FS_CATALOG . 'ipn_test_return.php';
$root_array[] = DIR_FS_CATALOG . 'nddbc.html';
$root_array[] = DIR_FS_CATALOG . 'page_not_found.php';
$new_array = array_merge($root_array, $original_array);
$directory_array = $new_array;
}
// show path and filename
if (strtoupper($configuration_key_lookup) == $configuration_key_lookup) {
while (strstr($configuration_key_lookup, '"')) $configuration_key_lookup = str_replace('"', '', $configuration_key_lookup);
while (strstr($configuration_key_lookup, "'")) $configuration_key_lookup = str_replace("'", '', $configuration_key_lookup);
// if appears to be a constant ask about configuration table
$check_database = true;
$check_configure = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key='" . strtoupper($configuration_key_lookup) . "'");
if ($check_configure->RecordCount() < 1) {
$check_configure = $db->Execute("select * from " . TABLE_PRODUCT_TYPE_LAYOUT . " where configuration_key='" . strtoupper($configuration_key_lookup) . "'");
}
if ($check_configure->RecordCount() >= 1) {
$links = '' . TEXT_SEARCH_DATABASE_TABLES . ' ' . '' . $configuration_key_lookup . '
';
} else {
// do nothing
}
} else {
// don't ask about configuration table
}
//die('I SEE ' . $check_configure->RecordCount() . ' vs ' . $check_database);
echo '
' . $links . ' |
' . ' ' . TEXT_INFO_SEARCHING . sizeof($directory_array) . TEXT_INFO_FILES_FOR . $configuration_key_lookup . ' |
' . "\n"; $show_file .= ' |
'; $show_file .= '' . $file . ''; $show_file .= ' |
';
// put file into an array to be scanned
$lines = file($file);
$found_line = 'false';
// loop through the array, show line and line numbers
foreach ($lines as $line_num => $line) {
$cnt_lines++;
if (strstr(strtoupper($line), strtoupper($configuration_key_lookup))) {
$found_line= 'true';
$found = 'true';
$cnt_found++;
$show_file .= " Line #{$line_num} : " ; //prevent db pwd from being displayed, for sake of security $show_file .= (substr_count($line,"'DB_SERVER_PASSWORD'")) ? '***HIDDEN***' : htmlspecialchars($line); $show_file .= " \n"; } else { if ($cnt_lines >= 5) { // $show_file .= ' .'; $cnt_lines=0; } } } } $show_file .= ' |
' . TEXT_INFO_MATCHES_FOUND . $cnt_found . ' |
' . zen_draw_separator('pixel_black.gif', '100%', '2') . ' |
|