isAdmin( $_SESSION['user_id'] );
if($isAdmin)
$home_cfg = $db->getGameHome($home_id);
else
$home_cfg = $db->getUserGameHome($_SESSION['user_id'],$home_id);
if ($home_cfg === FALSE)
{
print_failure(get_lang('no_access_to_home'));
return;
}
if ( preg_match("/f/",$home_cfg['access_rights']) != 1 )
{
print_failure( get_lang("no_rights") );
echo "
";
return;
}
$home_id = $home_cfg['home_id'];
if (litefm_check($home_id) === FALSE)
return;
$show_path = (isset($_SESSION['fm_cwd_'.$home_id])) ? clean_path($_SESSION['fm_cwd_'.$home_id]) : "/";
if($isAdmin)
$show_path = clean_path($home_cfg['home_path'].$show_path);
echo "";
echo "\n";
//Logic to open the file we're editing
$remote = new OGPRemoteLibrary($home_cfg['agent_ip'], $home_cfg['agent_port'], $home_cfg['encryption_key'], $home_cfg['timeout']);
$data = "";
$rel_path = isset($_SESSION['fm_cwd_'.$home_id]) ? $_SESSION['fm_cwd_'.$home_id]:'';
$filepath = clean_path($home_cfg['home_path']."/".$rel_path);
$file_info = $remote->remote_readfile($filepath ,$data);
if ( $file_info === 0 )
{
print_failure(get_lang("not_found"));
return;
}
else if ( $file_info === -1 )
{
print_failure(get_lang("agent_offline"));
return;
}
else if ( $file_info === -2 )
{
print_failure(get_lang("failed_read"));
return;
}
?>