Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » Custom login page
  •  
wildje

Messages: 14
Karma: 0
Send a private message to this user
Hi all,

I was wondering if future releases of Kerio will include support for custom login-pages ? It would be great if I just could put a few newslines on the login page, so users know what is updated on the mailserver.

Greetings,

Timon.
  •  
jonbrain

Messages: 305
Karma: 0
Send a private message to this user
I'd also find this very useful.
  •  
seali

Messages: 55
Karma: 0
Send a private message to this user
This is already possible. Just change the template "/usr/local/kerio/mailserver/webmail/default/login.php". I have a PHP include in mine that shows the local weather and some company news items.
  •  
wildje

Messages: 14
Karma: 0
Send a private message to this user
Hey thanks for the tip! I'll have a look into it
  •  
wildje

Messages: 14
Karma: 0
Send a private message to this user
oh-ooh probably need Zend-studio to edit the .PHP file.. not going to spend money on that package ;)
  •  
seali

Messages: 55
Karma: 0
Send a private message to this user
You don't need Zend to edit the file. Just a text editor or PICO for the brave;)

If you need help, contact me off list and I will see what I can do. Basically you just need to add
<?PHP include('TheFileThatHasMystuff.php') ?>
to where ever you want your stuff displayed in the file.

[Updated on: Thu, 27 January 2005 21:26]

  •  
wildje

Messages: 14
Karma: 0
Send a private message to this user
Im not really an PHP expert.. too bad :(

The login.php is partly text (zend studio (c) messages etc) and binary data. Can I just insert the php tag somewere ? Maybe it's possible to include a html instead of php ?

Maybe it's about time to spend some sparetime on php though :)
  •  
seali

Messages: 55
Karma: 0
Send a private message to this user
Look for the text
<div class="contentDiv" >
and type what you would like just after it. This will place it just below the logo on the screen. Don't forget to include a break after it, so the rest of the text will flow properly.
  •  
hinnerup

Messages: 10

Karma: 0
Send a private message to this user
Is it possible, that you are referring to an older version of the KMS? The current version has run the PHP through the Zend Optimizer, and your suggestions are really not applicable to the file as it is.

Regards,
Tobias
  •  
seali

Messages: 55
Karma: 0
Send a private message to this user
We are using version 6.0.6 for Mac OS X.
  •  
wildje

Messages: 14
Karma: 0
Send a private message to this user
I think there are some differences in the login.php between KMS6 for Win and KMS6 for Mac OS. I can't edit the login.php as you suggested, because it's binary data only (optimized by Zend Optimizer). I might pull the .php from the mac installation and overwrite my own though :)

[Updated on: Mon, 31 January 2005 09:15]

  •  
wildje

Messages: 14
Karma: 0
Send a private message to this user
Can someone please post the login.php from the mac installation, which should be in clear text ? I want to try to implement it in the w32, so I can use the include.
  •  
seali

Messages: 55
Karma: 0
Send a private message to this user
Here ya go:


<?php
session_start();
// redirect to main page if user is already logged in
$sessionMan = kerio("KMS::SessionManager");
$session = $sessionMan->getSession(session_id(), false);
if (!is_null($session)) {
$userInfo = $session->getMyUserInfo();
$userName = $userInfo->getUserName();
$message = "<kerio:text id='login-retype-password'/>";
//	header("Location: index.php");
//	exit;
}
if (!$message) $message = "<kerio:text id='login-enter'/>";
$userLangs   = explode(",", $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
$contentLang = strtolower(substr(trim($userLangs[0]), 0, 2));
if (!$contentLang) $contentLang = "en";
define("SERVER_VERSION", str_replace(" ","",str_replace("Kerio MailServer", "", $_SERVER["SERVER_SOFTWARE"])));
header("Content-Type: text/html; charset=utf-8");
header("Content-Language: $contentLang");
header("X-Kerio-Filter: translate=$contentLang");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Webmail | Kerio MailServer</title>
<link rel="shortcut icon" type="text/x-icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="main.css?v=<?=SERVER_VERSION?>">
<link rel="stylesheet" type="text/css" href="login.css?v=<?=SERVER_VERSION?>">
<script type="text/javascript" src="mainconsts.js.php"></script>
<script type="text/javascript" src="common.js?v=<?=SERVER_VERSION?>" defer="defer"></script>
<script type="text/javascript" src="main.js?v=<?=SERVER_VERSION?>" defer="defer"></script>
<script language="javascript">
function kkda0()
{
var kkdqk = new Image();
kkdqk.src = "gfx/wait.gif";
}
</script>
</head>
<body onload="kkda0()" bgcolor="#003473">
<table height="100%" width="100%" bgcolor="#003473"><tr><td align="center" valign="middle">
<div class="logoDiv"></div>
<div class="contentDiv" >
<span class="caption"><kerio:text id='login-page'/></span><br><br>
<?php 
if (!is_null($_GET['reason'])) {
switch ($_GET['reason']) {
case "failure":
$reason = "<kerio:text id='login-err-failure'/>";
break;
case "expired":
$reason = "<kerio:text id='login-err-expired'/>";
break;
case "logout":
$reason = "<kerio:text id='login-err-logout'/>";
break;
default:
$reason = "";
break;
}
}
if (strlen($reason) > 0) {
echo "<span class=\"error\">" . $reason . "<br><br></span>";
}
?>
<?=$message?><br>&nbsp;
<form name="kkeda" action="dologin.php" method=post>
<table>
<tr><td nowrap><span class="caption"><kerio:text id='login-username'/></span></td><td width="100%">
<?php if ($userName):?>
<?=$userName?><input name="kgpgk" type="hidden" value="<?=$userName?>">
<?php else: ?>
<input name="kgpgk" class="input_text" type="text" size="15">
<?php endif ?>
</td></tr>
<tr><td nowrap><span class="caption"><kerio:text id='login-password'/></span></td><td width="100%">
<input name="kgq3a" type="password" size="15" class="input_text"></td></tr>
<tr><td></td><td width="100%"><input type="submit" class="input_button" value="OK"></td></tr>
</table>
</form>
<?php if ($userName):?>
<a href='logout.php'><kerio:text id='login-other-user'/></a>
<?php endif ?>
</div>
Copyright 2005 Company Name

</td></tr></table>
<script language="javascript">
if (top.location!=document.location) top.location = document.location;
<?php if ($userName):?>
document.kkeda.kgq3a.focus();
<?php else: ?>
document.kkeda.kgpgk.focus();
<?php endif ?>
</script>
</body>
</html>

[Updated on: Thu, 03 February 2005 11:08]

  •  
wildje

Messages: 14
Karma: 0
Send a private message to this user
Thanks ! That IS a quick reply ! :P

BTW i just had a solution thought up for myself(just naming it here for everyone's help):

1. Bring up the kerio loginpage in your browser.
2. Save the source(which is an generated html)
3. This html can be edited at will, save it in your
webmail/default folder as login.php overwriting the
default one. Works like a charm.

BUT you will lose multilanguage support this way on your login page.

Seali your default login.php is completely different from the windows login.php (which is binary only). I will try to use your one, as it will be easy to use the include there. many thanks !

Timon.

[Updated on: Thu, 03 February 2005 12:11]

Previous Topic: Security Log viewer
Next Topic: WebMail is not working pls help
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Wed Nov 22 16:00:28 CET 2017

Total time taken to generate the page: 0.00495 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.