<?php
function x_22u($x_22v) { 
$x_22w = kerio('webiface::PhpNonAuth'); 
$x_22w->decodeUrl($x_22v, &$x_z2); 
unset($x_22w); 
return $x_z2; 
} 
function x_22x($x_z2) { 
if ($x_z2) { 
header('HTTP/1.0 302 Found'); 
header('location: '.$x_z2); 
exit('If your browser does not redirect automatically, please click this link: <a href="'.$x_z2.'">'.$x_z2.'</a>'); 
} else return false; 
} 
function x_22y($x_22z = false) { 
$x_z2 = $_SERVER['HTTP_REFERER']; 
if (!$x_z2) { 
$x_z2 = '/admin/login.php'; 
} 
if (false === strpos($x_z2, '?')) { $x_z2 .= '?'; } 
if (false === strpos($x_z2, 'fail')) { 
$x_z2 .= '&fail'; 
} 
if ($x_22z) { 
$x_z2 .= '&NTLM=0'; 
} 
return x_22x($x_z2); 
} 
$x_z3 = kerio('webadmin::Session'); 
if ($x_z3) { 
$x_z3->getCsrf(&$x_1a8); 
$x_230 = ('on' == $_SERVER['HTTPS']); 
setcookie('token', $x_1a8, null, '/admin', null, $x_230); 
$x_z2 = '/admin/index.php'; 
if (isset($_REQUEST['dest'])) { 
$x_z2 = x_22u($_REQUEST['dest']); 
} 
if (!x_22x($x_z2)) { 
header('HTTP/1.0 500 Server error'); 
die('Server error: Invalid URL!'); 
} 
} 
else { 
if (!x_22y($x_231)) { 
header('HTTP/1.0 500 Server error'); 
die('Server error: Invalid URL!'); 
} 
} 
?>
