Connect. Communicate. Collaborate. Securely.

Home » Developer Zone » API/SDK Writers » Multiple Mail Servers
  •  
costis

Messages: 3
Karma: 0
Send a private message to this user
Hello,

I need some information on Kerio Connect. I am trying to create one login page for multiple mail servers. My problem up to now, is that when I run my scripts , I get errors of undefined methods. I believe those methods are imported from the idl files. I looked for them in the "kerio-api-php-1.3.0-62" folder but I didn't find anything.
-Where are those idl files stored?
-How can my scripts use them?

Thanks!
  •  
nhoague

Messages: 852
Karma: 18
Send a private message to this user
I built a single sign on page for my 5 Kerio connect servers. Here is what you have to do ...

1) Build your front end login page, (http://webmail.onepointsync.com)
2) Build a back-end database (MySQL) to hold all of your domains and their respective mail server.
3) Build a nightly API script to keep the database in sync with your servers (domain adds or deletes)
4) Then your page just needs a form to know where to send the login request. I'll paste mine here Smile

if(isset($_POST['submit'])){
$domain = substr($_POST['kerio_username'], strpos($_POST['kerio_username'],"@")+1);
$sqlDomain = "SELECT mailServer FROM connectDomains WHERE domain = '" . $domain . "'";
$queryDomain = dbQuery($sqlDomain, $dbConnConnectData);
$resultDomain = mysql_fetch_array($queryDomain);
switch($_POST['submit']){
case "Login":
if(mysql_num_rows($queryDomain)<1){
$OPSMessage = "Sorry, domain not found.";
}else{
//print $resultDomain['mailServer'];
if(isset($_POST['ssl'])){
print "<form action=\"https://" . $resultDomain['mailServer'] . "/webmail/login/dologin\" id=\"login\" name=\"login\" method=\"post\">";
}else{
print "<form action=\"http://" . $resultDomain['mailServer'] . "/webmail/login/dologin\" id=\"login\" name=\"login\" method=\"post\">";
}

print "<input type=\"hidden\" name=\"kerio_username\" value=\"" . urldecode($_POST['kerio_username']) . "\">";
print "<input type=\"hidden\" name=\"kerio_password\" value=\"" . urldecode($_POST['kerio_password']) . "\">";
//print "<input type=\"submit\" name=\"submit\" value=\"Login\" class=\"input\">";
print "</form>";
print "<script type=\"text/javascript\">document.login.submit();</script >";
}
break;
case "Check Mailserver":
if(mysql_num_rows($queryDomain)<1){
$OPSMessage = "Sorry, domain not found in database.";
}else{
$OPSMessage = $resultDomain['mailServer'];
}
break;
}
}


Good luck!
  •  
costis

Messages: 3
Karma: 0
Send a private message to this user
Sorry for not answering for so long.

Your tips were really helpful , I wouldn't make it without your help.

Thanks ! Very Happy
  •  
nhoague

Messages: 852
Karma: 18
Send a private message to this user
No worries, glad I could help!
Previous Topic: Small project
Next Topic: Control API PHP
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: Mon Feb 20 16:27:35 CET 2017

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