Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite 7

 AfterLogic Forum : AfterLogic WebMail Lite 7
Subject Topic: Integration with web application Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
eloyucu
Newbie
Newbie
Avatar

Joined: 28 December 2015
Location: Spain
Online Status: Offline
Posts: 2
Posted: 28 December 2015 at 6:05pm | IP Logged Quote eloyucu

Hello everyone.

I am trying to integrate afterlogic on a codeigniter web app, and I donīt know if I am doing something wrong or what.
I could install it perfect, and I can login (receive and send emails) for different email accounts if I use the webmail url, I mean: www.domain.com/webmail.
The problem is when I try to integrate... I was following these instructions:

http://www.afterlogic.com/products/webmail-pro-php-docs/webmail-integration.htm

But I donīt find the integr.php on the root of my installation.

What I tried to do was to use one of the examples (account-inbox-info.php), thinking that these two lines:

$oApiIntegratorManager = CApi::Manager('integrator');
$oAccount = $oApiIntegratorManager->loginToAccount($sEmail, $sPassword);

Could be a substitute of integr.php, but seems that doesnīt.
The authenticate on the line $oApiIntegratorManager->loginToAccount works fine, because it continues showing the view:

<iframe src="http://domain.com/webmail/" id="webmail_iframe" class="col-xs-12"></iframe>

But it shows the login window.

Thank you very much.
Back to Top View eloyucu's Profile Search for other posts by eloyucu
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 28 December 2015 at 10:58pm | IP Logged Quote Igor

The documentation you're referring to is outdated, not sure how exactly you've found it as I'm positive it's not linked anywhere on our web site. Anyway, please make sure you're checking current documentation available at:

Logging in programmatically (WebMail Lite)

--
Regards,
Igor, AfterLogic Support

Back to Top View Igor's Profile Search for other posts by Igor
 
eloyucu
Newbie
Newbie
Avatar

Joined: 28 December 2015
Location: Spain
Online Status: Offline
Posts: 2
Posted: 29 December 2015 at 8:44am | IP Logged Quote eloyucu

Hi Igor, thanks for reply.
I found this instructions making this search on google: how to integrate afterlogic on my php project

https://www.google.es/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=how%20to%20integrate%20afterlogic%20on%20my%20php%20project

I am testing the example and it works fine. I let how I do it, if it can help someone on futures cases:


private function makeTheINBOX($sEmail, $sPassword)
{
     include_once '/var/www/html/webmail/libraries/afterlogic/api.php';
     if (class_exists('CApi') && CApi::IsValid())
     {
          try
          {
               // Getting required API class
               $oApiIntegratorManager = CApi::Manager('integrator');

               // attempting to obtain object for account we're trying to log into
               $oAccount = $oApiIntegratorManager->loginToAccount($sEmail, $sPassword);
               if ($oAccount)
               {
                    $oApiIntegratorManager->SetAccountAsLoggedIn($oAccount);
                    $template["title"> = ucwords("WEBMAIL");
                    $template["content"> = $this->load->view('components/webmailer/inbox', $this->data, true);
                    $this->load->view('template/backend', $template);
               }
               else
                    // login error
                    echo $oApiIntegratorManager->GetLastErrorMessage();                    
          }
          catch (Exception $oException)
          {
               // login error
               echo $oException->getMessage();
          }
     }
     else
          echo 'AfterLogic API isn\'t available';
}


And the view:

<div class="row">
     <iframe src="http://domain.net/webmail/" id="webmail_iframe" class="col-xs-12"></iframe>
</div>
<script>
     jQuery(document).ready(function()
     {
          h = jQuery('.page-bar').height();
          jQuery('#webmail_iframe').height(jQuery('.page-content').height()-h-33);
     });
</script>


Thank you a lot.

By the by... I didnīt receive any email advising me about your reply... Are not supposed I should have received an email?
Back to Top View eloyucu's Profile Search for other posts by eloyucu
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 30 December 2015 at 1:00am | IP Logged Quote Igor

Thank you for sharing this, I'm sure other users will find it useful.

And yes, I'm quite certain there should be a notification sent out via email.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide