<?php
if ( !defined('IN_MFA') )
		die("Hacking attempt");

$user->DieNotValid();
if(! $user->has_right("view"))
 	message_die("No Access",$lang['norights']);
 
$validated = validateObject($user->user_root_dir.$_GET['object']);
if(gettype($validated) != "boolean")
	message_die("Invalid Object",$validated);

$layoutviewargs = array();
 
$layoutviewargs['back_link'] = "index.php?dir=".$_GET['dir'];
$layoutviewargs['lang_back'] = $lang['back'];


$line = 1;
$display = new file($user->user_root_dir.$_GET['object']);

$layoutviewargs['file_path'] = $display->file_path;

$display->open("r");
$source_string = "";
if($display->file_size != 0)
{
	while(! feof($display->file_resource))
	{
		$content = fgets($display->file_resource, 1024);
  	$source_string .= $line.": ".$content;
  	$line++;
	}
}
$layoutviewargs['file_content'] = highlight_string($source_string,true);
$display->close();
$show_after_header .= $template->layoutparser("view",$layoutviewargs);
unset($layoutviewargs);
?>