<?php
include('inc/auth.inc'); 
include('inc/common.inc'); 
include('inc/browserFunc.inc'); 
include('inc/bookmarkFunc.inc'); 
include('inc/errorMessages.inc'); 
$x_2v = strtolower($_REQUEST['mode']); 
if (!strpos($_SERVER['REQUEST_URI'], 'browse.php') && $x_2v != 'get') { 
$x_1r = urldecode(str_replace('/browse', '', $_SERVER['REQUEST_URI'])); 
$x_d -> setSessionVariable('currentDir', $x_1r); 
x_2w('/browse.php'); 
exit(); 
} elseif ($x_2v != 'get') { 
$x_d -> getCurrentDir(&$x_1r); 
if (!$x_1r || strlen($x_1r)==0) { 
$x_d -> getSessionVariable('currentDir', &$x_1r); 
} 
if (!$x_1r || strlen($x_1r)==0) { 
$x_1r = 'cont:'; 
} 
} elseif ($x_2v == 'get') { 
$x_d -> getCurrentDir(&$x_1r); 
} 
$x_2x = "placeholder"; 
$x_2y -> getString("InternalDownload", &$x_2x); 
$x_d -> getUserName(&$x_2z); 
$x_d -> getUrlForPath($x_1r, &$x_f); 
switch ($x_2v) { 
case 'get': 
$x_30 = $_REQUEST['sort']; 
if (!isset($x_30) || count($x_30)==0) { 
$x_n = $x_d -> getUserVariable ('browsingOrder', &$x_30); 
if ($x_n==1) { 
$x_30 = Array('type' => sslvpn_ST_Name, 'language' => $x_2h[0], 'descending' => 0); 
} else { 
$x_30 = unserialize($x_30); 
} 
} else { 
$x_d -> setUserVariable ('browsingOrder', serialize($x_30)); 
$x_d->commitUserData(); 
} 
$x_30['language'] = $x_2h[0]; 
$x_n = $x_d -> getFileAttributes($x_1r, &$x_1k, &$x_o); 
$x_31 = 0; 
$x_n = $x_d -> getDirList($x_1r, $x_30, 0, &$x_32); 
if ($x_32['upload'] == 0) 
$x_31 = 1; 
if ($x_n == sslvpn_ERR_Ok) 
$x_33 = x_34($x_1r, $x_30, $x_32, $x_31); 
$x_35 = x_36($x_f, $x_33[1], ($x_32['type'] == sslvpn_DET_Domain ? 1 : 0)); 
$x_2o = x_37($x_31, $x_32['type']); 
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" type="text/x-icon" href="/nonauth/gfx/favicon.ico">
<script src="/script/testFunc.js" type="text/javascript"></script>
<?php include ('inc/initAssist.inc'); ?>
</head>	
<body onLoad="x_2f('<?php echo addslashes(urlencode($x_1r)); ?>');">
<div id="mainWindow">
<?php echo $x_33[0]; ?>
</div>
<div id="navTree" style="display:<?php echo $x_35['display']; ?>">
<?php echo $x_35['content']; ?>
</div>
<div id="toolBar" style="display:<?php echo $x_2o['display']; ?>">
<?php echo $x_2o['content']; ?>
</div>
<input type="hidden" id="dirTmp" value="<?php echo x_38($x_1r); ?>">
<div id="errorMessageReport"><?php echo x_v($x_33[2]); ?></div>
<script>
if (window.top.document.getElementById('firstLoad') && window.top.document.getElementById('page'))
window.top.x_2u('firstLoad', 'page');
<?php
if ($x_33[2] == 0 ) { 
$x_d -> setSessionVariable('currentDir', $x_1r); 
?>
window.top.document.getElementById('mainWindow').innerHTML = document.getElementById('mainWindow').innerHTML;
window.top.document.getElementById('navTree').innerHTML = document.getElementById('navTree').innerHTML;
window.top.document.getElementById('navTree').style.display = document.getElementById('navTree').style.display;
window.top.document.getElementById('navTreeImg').src = '/nonauth/gfx/tt_<?php echo $x_35['imgStatus']; ?>.png';
window.top.document.getElementById('toolBar').innerHTML = document.getElementById('toolBar').innerHTML;
window.top.document.getElementById('toolBar').style.display = document.getElementById('toolBar').style.display
window.top.document.getElementById('toolBarImg').src = '/nonauth/gfx/tt_<?php echo $x_2o['imgStatus']; ?>.png';
window.top.document.getElementById('dirTmp').value = document.getElementById('dirTmp').value;
window.top.document.getElementById('directory').value = document.getElementById('dirTmp').value;
window.top.document.getElementById('refreshPath').value = 'browse' + '<?php echo $x_f; ?>';
window.top.x_2u('dataLoading', 'mainWindow');
window.top.x_2t(0, 0);
window.top.x_2s();
<?php
} else { 
?>
window.top.x_2u('dataLoading', 'mainWindow');
window.top.x_2t(0, 0);
window.top.x_39('browserError', '<?php echo urlencode($x_1r); ?>', '<?php echo $x_33[2]; ?>');
<?php
} 
?>
</script>
</body>
</html>
<?php
break; 
default: 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" type="text/x-icon" href="/nonauth/gfx/favicon.ico">
<title>Kerio Clientless SSL-VPN</title>
<?php include ('inc/initAssist.inc'); ?>
<link href="/nonauth/main.css" rel="stylesheet" type="text/css">
<script src="/script/mainFunc.js" type="text/javascript"></script>
<script src="/script/actionsFunc.js" type="text/javascript"></script>
<script src="/script/dialog.js" type="text/javascript"></script>	 
<script src="/script/prototype.js" type="text/javascript"></script>
<script src="/script/dragDrop.js" type="text/javascript"></script>
<script>
var dialogWindow;
var errorDialogWindow;
</script>
</head>
<body onLoad="x_2s();" onResize="x_2s();" onkeypress="x_3a(event)">
<iframe src="/browse<?php echo $x_f;?>?mode=get" 
id="executeIt" name="executeIt" marginheight="0" marginwidth="0" width="1" height="1" frameborder="0"
style="position: absolute;"></iframe>
<div id="firstLoad" style="display: block;">
<table style="position: absolute; top: 25%; left: 40%; border: 0px solid Gray; padding: 5px; _padding: 10px;" cellpadding="5" cellspacing="0">
<tr>
<td><kerio:text id="wait_while_loading"/></td>
</tr>
<tr>
<td><img src="/nonauth/gfx/loading.gif" width="100%" height="6"></td>
</tr>
</table>
</div>
<div id="page" style="display: none;">
<div id="topBar">
<?php include ('inc/header_main.inc'); ?>
</div>
<div id="pathBar">
<?php
$x_3b = x_3c(); 
echo $x_3b; 
?>
</div>
<div id="x_3d" class="eventTrap" style="display: none;"></div>
<div id="x_3e" class="actionDialog" style="display: none; position: absolute;"><div id="x_3f"></div></div>
<div id="x_3g" class="actionDialog2" style="display: none; position: absolute;"><div id="x_3h"></div></div>
<div id="column">
<div id="leftBar">
<table id="navTreeTable" cellpadding="0" celspacing="0" class="browse" onClick="x_3i('navTree', 'navTreeImg', '/nonauth/gfx/tt_close.png', '/nonauth/gfx/tt_open.png', '/setUserVariable.php?name=navTree&value=')" style="cursor:pointer;">
<tr>
<td><kerio:text id="navigation_tree"/></td>
<td width="16">
<img id="navTreeImg" src="/nonauth/gfx/tt_open.png" width="16" height="16" border="0" title="Click to show/hide Navigation Tree">
</td>
</tr>
</table>
<div id="navTree" style="display:none;"></div>
<table id="toolBarTable" cellpadding="0" celspacing="0" class="browse" onClick="x_3i('toolBar', 'toolBarImg', '/nonauth/gfx/tt_close.png', '/nonauth/gfx/tt_open.png', '/setUserVariable.php?name=toolBar&value=')" style="cursor:pointer;">
<tr>
<td><kerio:text id="tasks"/></td>
<td width="16">
<img id="toolBarImg" src="/nonauth/gfx/tt_open.png" width="16" height="16" border="0" title="Click to show/hide Toolbar">
</td>
</tr>
</table>
<div id="toolBar" style="display:none;"></div>
<?php  
x_2g($x_2h[0]); 
$x_3j = x_2r(); 
?>
<table id="bookmarkWindowTable" cellpadding="0" celspacing="0" class="browse" onClick="x_3i('bookmarkWindow', 'bookmarkWindowImg', '/nonauth/gfx/tt_close.png', '/nonauth/gfx/tt_open.png', '/setUserVariable.php?name=bookmarkWindow&value=')" style="cursor:pointer;">
<tr>
<td><kerio:text id="head_bookmarks"/></td>
<td width="16">
<img id="bookmarkWindowImg" src="/nonauth/gfx/tt_<?php echo $x_3j['imgStatus']; ?>.png" width="16" height="16" border="0" title="Click to show/hide Bookmarks">
</td>
</tr>
</table>			
<div id="bookmarkWindow" style="display:<?php echo $x_3j['display']; ?>">
<?php echo $x_3j['content']; ?>
</div>
</div>
<div id="browserError" style="display: none;">
<table id="dataLoadingTable2" cellpadding="0" cellspacing="0" style="width:100%;">
<tr class="browserHeader">
<td class="upGrey browseHead">
&nbsp;
</td>
</tr>
</table>
<!-- -->				
<?php
$x_3k = '<fieldset class="dialgBodyFieldset" style="height: 158px;">'; 
$x_3l = '</fieldset>'; 
?>
<div class="dialogBodyMain" style="width: 376px; height: 212px; position: absolute; top: 180%; left: 25%;border: 1px solid black;">
<div id="BEstartPhase" style="display: block;">
<?php
echo $x_3k; 
?>			
<table style="width:330px; _width: 350px;">
<tr>
<td>
<img src="/nonauth/gfx/tb_error.gif" width="32" height="32" alt="!">
</td>
<td style="width:295px; _width: 315px;">
<strong><kerio:text id="unable_to_open"/></strong>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
</table>
<kerio:text id="actions_details"/>:
<div class="errorMessage" style="width:345px; height: 70px;">
<span id="errorMessageReport"></span><br><br>
<kerio:text id="requested_path"/>: "<strong><span id="browserErrorPath"></span></strong>"
</div>	
<?php echo $x_3l; ?>
<table style="position: absolute; <?php echo $x_3m; ?> right: 12px; _right: 8px;">
<td>
<input id="okButton" type="submit" value="<kerio:text id="ok"/>" onClick="window.top.x_2u('browserError', 'mainWindow');">
</td>
</tr>
</table>
</div>
</div>				
<!-- -->				
</div>
<div id="dataLoading" style="display: block;">
<table id="dataLoadingTable" cellpadding="0" cellspacing="0" style="width:100%;">
<tr class="browserHeader">
<td class="upGrey browseHead">
&nbsp;
</td>
</tr>
</table>
<table style="position: relative; top: 140px; left: 240px; border: 0px solid Gray; padding: 5px; _padding: 10px;" cellpadding="5" cellspacing="0">
<tr>
<td><kerio:text id="wait_while_loading"/></td>
</tr>
<tr>
<td><img src="/nonauth/gfx/loading.gif" width="100%" height="6" border="0"></td>
</tr>
</table>
</div>
<div id="mainWindow" style="display: none;">
</div>
</div>
</div>
<form id="sortBy" name="sortBy" action="" target="executeIt" method="POST" style="margin:0px; padding:0px;">
<input name="mode" type="hidden" value="get">
<input id="sortType" name="sort[type]" type="hidden" value="">
<input id="sortType" name="sort[language]" type="hidden" value="<?php echo $x_2h[0]; ?>">
<input id="sortDescending" name="sort[descending]" type="hidden" value="">
</form>
<form name="bsFrm" action="/browserSmall.php" target="executeIt" method="POST" style="margin:0px; padding:0px;">
<input id="bsPath" type="hidden" name="path" value="">
<input type="hidden" name="type" value="browserSmall">
<input type="hidden" name="mode" value="data">
</form>
<input id="errorOpened" name="errorOpened" type="hidden" value="">
<iframe id="executeIt2" name="executeIt2" marginheight="0" marginwidth="0" width="1" height="1" frameborder="0" src="/session_refresh.html"></iframe>
<iframe name="sessionRefresh" marginheight="0" marginwidth="0" width="1" height="1" frameborder="0" src="/session_refresh.html"></iframe>
</body>
</html>
<?php
break; 
} 
?>
