<?php
function x_25($kp_parameters = Array()) { 
global $x_33; 
$fail = 0; 
$asocname = ''; 
$dest = ''; 
$internal = ''; 
$x_7x = kerio("webiface::PhpNonAuth"); 
$x_28 = ''; 
$x_en = ''; 
$nonauthToken = ''; 
$sessionToken = ''; 
$x_7x->getAsocUserName($x_en, $x_28); 
if ('' == $x_28) { 
$x_28 = $x_en; 
} 
extract($kp_parameters, EXTR_OVERWRITE); 
$html = new kp_HtmlElements(); 
$loginData = Array( 
Array( 
Array( 'properties' => 'colspan="2" align="left"', 
'data' => '<div id="failure" style="height: 20px; padding: 5px 0 5px 0;">' 
. (1 == $fail ? '<kerio:text id="lang_auth_failed"/>' : ' ') . '</div>'), 
), 
Array( 
Array('properties' => 'class="bold"', 'data' => '<kerio:text id="lang_username"/>:'), 
Array('data' => x_54($asocname, 210)), 
), 
Array( 
Array('properties' => 'class="bold"', 'data' => '<kerio:text id="lang_password"/>:'), 
Array('data' => $html->kp_getInput('password', 'kerio_password', '', 'size="15" class="textInput"', 'kerio_password') 
. $html->kp_getInput('hidden', 'kerio_username', $asocname, '', 'kerio_username')), 
) 
); 
$buttonsData = Array( 
Array( 
Array('data' => $html->kp_getInput('submit', '', 
'<kerio:text id="lang_login"/>', 
'class="button unlock"') . '</form>'), 
Array('properties' => 'width="15"', 'data' => ''), 
Array('data' => '<form action="logout.php" method="POST">' 
. $html->kp_getInput('hidden', 'x_ot', $nonauthToken) 
. $html->kp_getInput('hidden', 'x_or', $sessionToken) 
. $html->kp_getInput('hidden', 'internal', $internal) 
. $html->kp_getInput('hidden', 'dest', urlencode($dest)) 
. $html->kp_getInput('submit', '', '<kerio:text id="login-logout-user"/>', 'class="button unlock"') 
. '</form>'), 
) 
); 
$pageData = Array( 
Array( 
Array( 'properties' => 'align="left"', 
'data' => '<kerio:text id="login-user-logged-on"/>:') 
), 
Array( 
Array( 'properties' => 'align="center" class="bold"', 
'data' => x_54($x_28, 280)) 
), 
Array( 
Array( 'properties' => 'align="left"', 
'data' => '<kerio:text id="login-logout-for-security-reasons"/>') 
), 
Array( 
Array( 'properties' => 'align="center"', 
'data' => $html->kp_table($loginData, 'style="text-align:left;"') 
. $html->kp_table($buttonsData, 
'style="padding: 10px 0 10px 0; _margin: 10px 0px 10px 0px;"')) 
) 
); 
if (trim($dest) != '') { 
$x_ou[] = 'dest=' . urlencode($dest); 
} 
if (1 == $internal) { 
$x_ou[] = 'internal=1'; 
} else { 
$x_ou[] = 'internal=0'; 
} 
$loginPage = '<form method="post" action="/internal/dologin.php' . (!empty($x_ou) ? '?' . implode('&', $x_ou) : '') . '">' . 
$html->kp_table($pageData) . 
$html->kp_getInput('hidden', 'kerio_username', $asocname) . 
$html->kp_getInput('hidden', 'redirectto', '/index.php'); 
$x_4w = $x_33->x_8f(); 
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) { 
switch ($x_4w) { 
case 'cs': 
$x_gb = 476; 
break; 
case 'sk': 
$x_gb = 484; 
break; 
case 'ru': 
$x_gb = 443; 
break; 
case 'hu': 
$x_gb = 472; 
break; 
case 'nl': 
$x_gb = 517; 
break; 
case 'pl': 
$x_gb = 508; 
break; 
case 'pt': 
$x_gb = 451; 
break; 
case 'jp': 
$x_gb = 480; 
break; 
case 'de': 
$x_gb = 463; 
break; 
case 'es': 
$x_gb = 571; 
break; 
case 'it': 
$x_gb = 462; 
break; 
case 'sv': 
$x_gb = 464; 
break; 
case 'ja': 
case 'jp': 
$x_gb = 449; 
break; 
default: 
$x_gb = false; 
} 
} 
return $html->kp_getDialogPageContent('login', '<kerio:text id="lang_login_page"/>', 
'<kerio:text id="lang_login"/>', 
$loginPage, 'loginUnlock', $x_gb); 
} 
?>
