<?php
require_once('config.inc'); 
require_once(CORE_PATH . 'langHeader.inc'); 
require_once('configDashboards.inc'); 
require_once(CORE_PATH . 'common.inc'); 
require_once(CORE_PATH . 'dateTime.inc'); 
require_once(LIB_PATH . 'Page.inc'); 
require_once(LIB_PATH . 'HtmlElements.inc'); 
require_once(LIB_PATH . 'DocumentHeader.inc'); 
require_once(LIB_PATH . 'PeriodDialog.inc'); 
require_once(LIB_PATH . 'Dashboard.inc'); 
require_once(LIB_PATH . 'Queries.inc'); 
$x_1w = ''; 
$x_g = Array(); 
$x_1->getSessionVariable('lastDisplayed', &$x_g); 
$x_g = unserialize($x_g); 
$x_4 = 0; 
$x_1->getStarInfo(&$x_4); 
if (!isset($x_g['userId']) || empty($x_g['userId'])) { 
$x_g['userId'] = -1; 
} 
if (0 == intval($x_g['periodStart']) || 0 == intval($x_g['periodEnd'])) { 
$x_1x = true; 
} else { 
$x_1x = false; 
} 
if ('activity' == $x_g['dbName']) { 
$x_1x = true; 
} 
$x_1y = new x_1z('day'); 
$x_20 = ''; 
if (0 == $x_4['right']) { 
$x_1->getSessionVariable('afs', &$x_21); 
if (1 == $x_21) { 
$x_g['dbName'] = 'error'; 
$x_g['dbLayout'] = 'L6'; 
$x_g['headerType'] = 'stats'; 
$x_g['errorType'] = 2; 
$x_20 = $x_1y->x_22(); 
} else { 
if ( (!empty($x_6[5]) && !empty($x_6[6])) && !empty($x_6[11]) && 
($x_g['dbName'] != $x_6[5] && $x_g['dbName'] != $x_6[6] && $x_g['dbName'] != $x_6[11])) { 
$x_g['dbName'] = $x_6[5]; 
$x_g['headerType'] = 'myAccountOnly'; 
$x_g['errorType'] = 0; 
$x_20 = ''; 
} 
} 
} else { 
if ($x_4['dbStatus'] != 1) { 
$x_g['dbName'] = 'error'; 
$x_g['dbLayout'] = 'L6'; 
$x_g['headerType'] = 'stats'; 
$x_g['errorType'] = 1; 
$x_20 = $x_1y->x_22(); 
} elseif (empty($x_g['dbName']) || !in_array($x_g['dbName'], $x_6)) { 
$x_g['headerType'] = 'stats'; 
$x_g['dbName'] = $x_6[0]; 
$x_20 = $x_1y->x_22(); 
} elseif(in_array($x_g['dbName'], $x_6) && 
($x_g['dbName'] == $x_6[5] || $x_g['dbName'] == $x_6[6])) { 
$x_20 = $x_1y->x_22(); 
$x_g['headerType'] = 'myAccount'; 
} elseif(in_array($x_g['dbName'], $x_6) && 
($x_g['dbName'] != $x_6[5] || $x_g['dbName'] != $x_6[6])) { 
$x_20 = $x_1y->x_22(); 
$x_g['headerType'] = 'stats'; 
} 
} 
$x_11 = x_12($x_g['periodStart'], $x_g['periodEnd']); 
$x_g['x_23'] = $x_11; 
if (true == $x_1x) { 
$x_24 = $x_g; 
$x_24['dbLayout'] = 'L7'; 
if (0 == $x_4['right']) { 
$x_24['headerType'] = 'myAccountOnly';; 
$x_24['dbName'] = 'empty2'; 
} else { 
$x_24['headerType'] = 'stats'; 
$x_24['dbName'] = 'empty1'; 
} 
@require_once(TEMPLATE_PATH . 'page_empty.inc'); 
@$x_1w .= x_25('html', 0, $x_24); 
} else { 
@require_once(TEMPLATE_PATH . 'page_' . $x_g['dbName'] . '.inc'); 
@$x_1w .= x_25('html', 0, $x_g); 
} 
$x_26 = $x_e[$x_g['dbName']]['name']; 
$x_27 = $x_e[$x_g['dbName']]['icon']; 
$x_1->getCsrf(&$x_s); 
$x_1->getUserName(&$x_28, &$x_29); 
$x_2a = new kp_HtmlElements(); 
if ($x_g['dbName'] != 'accStats' && $x_g['dbName'] != 'prefs') { 
$x_2b = 'Kerio StaR'; 
} else { 
$x_2b = 'Web Interface'; 
} 
$x_v = new x_w($x_2b, $x_2c); 
$x_2d = new x_2e($x_26, $x_27, $x_g['headerType'], $x_5); 
$x_v->x_a($x_a); 
$x_v->x_b($x_b); 
$x_v->x_1o($x_2d->x_2f()); 
$x_v->x_1o('<form name="frm" method="POST" target="x_2g" action="contentLoader.php">' 
. $x_2a->kp_getInput('hidden', 'x_h', 
$x_g['dbName'], 
'', 'x_h') 
. $x_2a->kp_getInput('hidden', 'x_i', 
$x_8[$x_g['dbName']], 
'', 'x_i') 
. $x_2a->kp_getInput('hidden', 'x_j', '', '', 'x_j') 
. $x_2a->kp_getInput('hidden', 'x_k', $x_g['periodStart'], '', 'x_k') 
. $x_2a->kp_getInput('hidden', 'x_l', $x_g['periodEnd'], '', 'x_l') 
. $x_2a->kp_getInput('hidden', 'x_m', $x_g['userId'], '', 'x_m') 
. $x_2a->kp_getInput('hidden', 'x_o', $x_g['protoId'], '', 'x_o') 
. $x_2a->kp_getInput('hidden', 'x_n', '', '', 'x_n') 
. $x_2a->kp_getInput('hidden', 'x_u', $x_s, '', '') 
. $x_2a->kp_getInput('hidden', 'x_2h', $x_11['x_1c'], '', 'x_2h') 
. $x_2a->kp_getInput('hidden', 'x_2i', $x_11['x_1e'], '', 'x_2i') 
. $x_2a->kp_getInput('hidden', 'x_p', $x_g['errorType'], '', 'x_p') 
. $x_2a->kp_getInput('hidden', 'x_r', '', '', 'x_r') 
. '</form>'); 
$x_v->x_1o($x_20 
. '<div id="x_2j" class="eventTrap" onClick="x_2k(0)" style="display: ' . (true == $x_1x ? 'block' : 'none') . ';"></div>


									<div id="x_2l" class="eventDialogBody">


										<div id="freeSpace"></div>





										<div id="x_2m" class="eventDialog" style="display: block;">





											<div class="dialogBody">


												<div class="dialogBg">


													<div class="content">


														' .$x_2a->kp_documentTitle('<kerio:text id="pleaseWait" />' , 'load.gif', '', 24) . '<br />


														<kerio:text id="loadingData" />...<br />


														<div id="x_1p" class="steps"></div>


													</div>


													<div class="buttonBar" align="right">' 
. $x_2a->kp_getInput('button', 
'', 
'<kerio:text id="cancel" />', 
'onClick="x_2n();" class="button"') . '


													</div>


												</div>


											</div>


										</div>





										<div id="x_2o" class="connectionLost" style="display: none;">


											<div class="dialogBody">


												<div class="dialogBg">


													<div class="content">


														<span class="bold"><kerio:text id="connection_failed" /></span>


														<div class="steps"></div>


													</div>


													<div class="buttonBar" align="right">' 
. $x_2a->kp_getInput('button', 
'', 
'<kerio:text id="connection_reconnect" />', 
'class="button" style="margin-right: 20px;" onClick="x_2p();" class="button"') 
. $x_2a->kp_getInput('button', 
'', 
'<kerio:text id="cancel" />', 
'onClick="x_2n();" class="button"') . '


													</div>


												</div>


											</div>


										</div>





									</div>' . 
'<div style="width: 100%; border: 0px; margin: 0px; padding: 0px;" align="center">' 
. '<div id="mainBody" class="mainBody" onScroll="x_2q();">' 
. $x_1w 
. '</div>' 
. '</div>' 
. '</div>'); 
$x_v->x_1o('<iframe name="x_2g" id="x_2g" width="1" height="1" frameborder="0" src="nonauth/empty.html"></iframe>'); 
$x_v->x_1o('<iframe width="1" height="1" frameborder="0" src="sessionRefresh.html"></iframe>'); 
$x_v->x_1o($x_2a->kp_getImage(IMAGE_PATH . 'not_loaded.gif', 10, 11, '', 'style="display: none"')); 
$x_v->x_1o($x_2a->kp_getImage(IMAGE_PATH . 'loaded.gif', 10, 11, '', 'style="display: none"')); 
header("content-type: text/html"); 
header("Cache-Control: no-cache, must-revalidate"); 
header("Expires: Mon, 10 Jan 1970 01:00:00 GMT"); 
$x_2r = ''; 
$x_23 = (!empty($x_g['periodStart']) && !empty($x_g['periodEnd']) ? 
', ' . $x_g['periodStart'] . ', ' . $x_g['periodEnd'] : ''); 
if (true == $x_1x) { 
$x_2r= 'x_2s(\'' . $x_g['dbName'] . '\'' . $x_23 . ');'; 
} 
$x_2c = ' onLoad="x_2t(\'' . $x_11['x_1f'] . '\'' 
. $x_23 
. ');' 
. (false == $x_1x && 'accStats' == $x_g['dbName'] ? 'x_2u();' : '') 
. $x_2r 
. '"


								onContextmenu="return false;"


								onDrag="return false;"


								onResize="x_2v();"


								onKeyPress="x_2w(event)"'; 
$x_v->x_1o('<div id="x_2x"></div><div id="x_2y" class="tooltipShadow"></div>'); 
$x_v->x_1o('<script>var x_2z = new x_30();</script>'); 
$x_v->x_31 = $x_2c; 
$x_v->x_y(); 
if ('error' == $x_g['dbName']) { 
$x_g['dbName'] = ''; 
} 
$x_1->setSessionVariable('lastDisplayed', serialize($x_g)); 
?>
