Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite

 AfterLogic Forum : AfterLogic WebMail Lite
Subject Topic: Uncaught Error: Class "Aurora\System\Api Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
gallazoltan
Newbie
Newbie


Joined: 14 March 2025
Location: Hungary
Online Status: Offline
Posts: 1
Posted: 14 March 2025 at 2:07am | IP Logged Quote gallazoltan

Hi, I'm using the 9.8.1 build, and trying to use the autologin feature. When I try the example code from the documentation,

Fatal error: Uncaught Error: Class "Aurora\System\Api" not found in /web/www/webmail/autologin.php:6 Stack trace: #0 {main} thrown in /web/www/webmail/autologin.php on line 6


My code:
Code:

<?php
$sUserLogin = "my@email.com";
$sUserPassword = "mypassword";
include __DIR__.'./system/autoload.php';
\Aurora\System\Api::Init();
$aData = \Aurora\System\Api::GetModuleDecorator('Core')->Login($sUserLogin, $sUserPassword);
if (isset($aData['AuthToken']))
{
    $sAuthToken = $aData['AuthToken'];
    setcookie('AuthToken', $sAuthToken, time()+3600, "/webmail/");
    \Aurora\System\Api::Location('../');
}
exit();
?>


Do you have any ideas about this?
Thanks in advance!
Back to Top View gallazoltan's Profile Search for other posts by gallazoltan
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6133
Posted: 14 March 2025 at 2:48am | IP Logged Quote Igor

Is the code located in the same directory where WebMail Lite resides? Most likely, you need to adjust the path here:

Code:
include __DIR__.'./system/autoload.php';


The most straightforward option would be to supply the absolute path to system/autoload.php file, for example:

Code:
include '/var/www/webmail/system/autoload.php';


--
Regards,
Igor, Afterlogic
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