Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic Aurora Files

 AfterLogic Forum : AfterLogic Aurora Files
Subject Topic: PHP API Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Alfa
Newbie
Newbie


Joined: 11 January 2024
Online Status: Offline
Posts: 2
Posted: 12 January 2024 at 12:18am | IP Logged Quote Alfa

Hi,

I want to create and remove standard accounts from another web app and used the PHP API.
I used the PHP Api; backend is IIS

Functionally it works but I get fatal error messages.
'Works' means that accounts are created and working.



Fatal error: Uncaught Error: Class 'Illuminate\Database\Eloquent\Model' not found in xxx\system\Classes\Model.php:15
Stack trace:
#0 xxx\system\autoload.php(37): include_once() #1 [internal function]: {closure}()
#2 xxx\modules\Core\Models\User.php(8): spl_autoload_call()
#3 xxx\system\autoload.php(37): include_once('xxx') #4 [internal function]: {closure}()
#5 xxx\modules\SharedContacts\Module.php(731): spl_autoload_call()
#6 xxx\system\EventEmitter.php(171): Aurora\Modules\SharedContacts\Module->onAfterCreateUser()
#7 xxx\system\Module\Manager.php(779): Aurora\System\EventEmitter->emit()
#8 xxx\system\Module\AbstractModule.php(446): Aurora\System\Module\Manager->broadcastEvent()
#9 xxx in xxx\system\Classes\Model.php on line 15



The main parts of the PHP script

<?php

$sUserLogin      = 'xxx';
$sUserPassword      = 'xxx';


include_once '../system/autoload.php';

Aurora\System\Api::Init();
$coreApi = Aurora\System\Api::GetModuleDecorator('Core');
$authApi = Aurora\System\Api::GetModuleDecorator('StandardAuth');
$userApi = Aurora\System\Api::GetModuleDecorator('User');


//Start App and login as Sys-Admin
$aData   = $coreApi->Login($sUserLogin, $sUserPassword);
if (isset($aData['AuthToken']))
{
    $sAuthToken = $aData['AuthToken'];
    setcookie('AuthToken', $sAuthToken, time()+3600, "/");
    $loginOk = true;
}
else{...}


//Parse post arguments & check user already exist
......


//Add new user
$authApi->CreateAccount(0, 0, $NewUsrName, $NewUsrPass);


//check created
$ul = $coreApi->GetUsers();
$ulItems = $ul["Items"];
foreach ($ulItems as $key=>$item)
...

?>


Any idea why getting the fatal error?
Back to Top View Alfa's Profile Search for other posts by Alfa
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6094
Posted: 12 January 2024 at 5:10am | IP Logged Quote Igor

Hello,

We've just posted a complete sample of creating user accounts in Aurora Files:

Creating user accounts via PHP API

Hope this helps.

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


Joined: 11 January 2024
Online Status: Offline
Posts: 2
Posted: 14 January 2024 at 3:15am | IP Logged Quote Alfa

Many thanks for this sample.
Great support.

May a feature request, why we use an external app.

Implement something like auto-expire of accounts.
When creating add an expire date.
After this date the files and the account automatically deleted. Cleanup procedere is triggered by any request so there is no need for additional cron job.
Back to Top View Alfa's Profile Search for other posts by Alfa
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6094
Posted: 14 January 2024 at 11:01pm | IP Logged Quote Igor

If you believe other users would benefit from these features, please feel free to post a feature request at:

https://afterlogic.uservoice.com/forums/932341-aurora-files

We use that resource when developing product's roadmap, so if the feature gets a good number of votes, there's a better chance of it getting implemented. Thanks.

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