mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
a2e4453084
git-svn-id: http://www.observium.org/svn/observer/trunk@1033 61d68cd4-352d-0410-923a-c4978735b2b8
37 lines
981 B
PHP
37 lines
981 B
PHP
<?php
|
|
|
|
include("includes/geshi/geshi.php");
|
|
|
|
if($_SESSION['userlevel'] >= "7") {
|
|
|
|
if(!is_array($config['rancid_configs'])) { $config['rancid_configs'] = array($config['rancid_configs']); }
|
|
|
|
foreach($config['rancid_configs'] as $configs) {
|
|
if ($configs[strlen($configs)-1] != '/') { $configs .= '/'; }
|
|
if(is_file($configs . $device['hostname'])) { $file = $configs . $device['hostname']; }
|
|
}
|
|
|
|
$fh = fopen($file, 'r') or die("Can't open file");
|
|
$text = fread($fh, filesize($file));
|
|
fclose($fh);
|
|
|
|
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);
|
|
}
|
|
$language = "ios";
|
|
$geshi = new GeSHi($text, $language);
|
|
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS);
|
|
$geshi->set_overall_style('color: black;');
|
|
#$geshi->set_line_style('color: #999999');
|
|
echo $geshi->parse_code();
|
|
|
|
}
|
|
|
|
?>
|