2009-02-04 16:18:11 +00:00
|
|
|
<?php
|
|
|
|
|
2009-03-16 15:19:44 +00:00
|
|
|
include("includes/geshi/geshi.php");
|
|
|
|
|
2010-03-17 15:26:54 +00:00
|
|
|
if($_SESSION['userlevel'] >= "7") {
|
2010-02-16 20:45:40 +00:00
|
|
|
|
|
|
|
if(!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
|
|
|
|
|
|
|
|
foreach($config['rancid_configs'] as $configs) {
|
2010-03-06 01:46:36 +00:00
|
|
|
if ($configs[strlen($configs)-1] != '/') { $configs .= '/'; }
|
2010-02-16 20:45:40 +00:00
|
|
|
if(is_file($configs . $device['hostname'])) { $file = $configs . $device['hostname']; }
|
|
|
|
}
|
|
|
|
|
2009-02-04 16:18:11 +00:00
|
|
|
$fh = fopen($file, 'r') or die("Can't open file");
|
2009-03-02 18:12:09 +00:00
|
|
|
$text = fread($fh, filesize($file));
|
2010-01-31 17:30:16 +00:00
|
|
|
fclose($fh);
|
2010-02-16 20:45:40 +00:00
|
|
|
|
2010-01-31 17:03:22 +00:00
|
|
|
if ($config['rancid_ignorecomments'])
|
|
|
|
{
|
|
|
|
$lines = split("\n",$text);
|
|
|
|
for ($i = 0;$i < count($lines);$i++)
|
|
|
|
{
|
|
|
|
if ($lines[$i][0] == "#") { unset($lines[$i]); }
|
|
|
|
}
|
|
|
|
$text = join("\n",$lines);
|
|
|
|
}
|
2009-03-16 15:19:44 +00:00
|
|
|
$language = "ios";
|
|
|
|
$geshi = new GeSHi($text, $language);
|
|
|
|
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
|
|
|
|
$geshi->set_overall_style('color: black;');
|
2010-02-16 20:45:40 +00:00
|
|
|
#$geshi->set_line_style('color: #999999');
|
2010-01-31 17:30:16 +00:00
|
|
|
echo $geshi->parse_code();
|
2010-02-16 20:45:40 +00:00
|
|
|
|
2009-02-04 16:18:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|