Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite 7

 AfterLogic Forum : AfterLogic WebMail Lite 7
Subject Topic: Login user using curl. Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
rsantellan
Newbie
Newbie


Joined: 14 October 2015
Online Status: Offline
Posts: 11
Posted: 30 October 2015 at 1:31pm | IP Logged Quote rsantellan

Hi it is possible to use this documentation page using curl.

I try:

something like this:


$ch = curl_init();
    $data = sprintf('&Email=%s&Password=%s', $user->getUsername(), $user->getEmailPassword());
    //
    
    curl_setopt($ch, CURLOPT_URL,$url."/webmail/index.php?postlogin");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

    // in real life you should use something like:
    // curl_setopt($ch, CURLOPT_POSTFIELDS,
    //          http_build_query(array('postvar1' => 'value1')));

    // receive server response ...
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $server_output = curl_exec ($ch);
    //var_dump($server_output);
    curl_close ($ch);

    // further processing ....
    if ($server_output == "OK") { } else { }


My first problem was that the file: libraries/ProjectCore/Service.php on the line 160 $_SERVER['HTTP_USER_AGENT'] was undefined.

adding a isset didn't solve it.

Is there is a way to do it?

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


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 02 November 2015 at 3:19am | IP Logged Quote Igor

How exactly did you add the isset there? This one should do it:

Code:
if (isset($_SERVER['HTTP_USER_AGENT']) && !strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'firefox'))
   {
    @\header('Last-Modified: '.\gmdate('D, d M Y H:i:s').' GMT');
   }


Are you getting any errors with code modified that way?

--
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