<?php
function x_25($kp_parameters = Array()) { 
$fail = 0; 
$internal = 0; 
$dest = ''; 
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' => $html->kp_getInput('text', 'kerio_username', '', 'size="15" class="textInput"', 'kerio_username')), 
), 
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')), 
) 
); 
$buttonsData = Array( 
Array( 
Array('data' => $html->kp_getInput('submit', '', '<kerio:text id="lang_login"/>', 'class="button"')) 
) 
); 
$pageData = Array( 
Array( 
Array( 'properties' => 'align="center"', 
'data' => $html->kp_table($loginData) . $html->kp_table($buttonsData, 'style="padding: 10px 0 10px 0;"')) 
) 
); 
$x_ou = Array(); 
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, '') . 
'</form>'; 
return $html->kp_getDialogPageContent('login', '<kerio:text id="lang_login_page"/>', 
'<kerio:text id="login-enter-username-and-password"/>', 
$loginPage, 'loginCommon'); 
} 
?>
