Creating user accounts via PHP API
Creating user accounts in Aurora Files is a very straightforward task, the following samples demonstrates it.
In the sample, we'll initialize PHP API, supply account credentials, define global tenant and call a method for creating an account.
<?php
include __DIR__.'/system/autoload.php';
\Aurora\System\Api::Init(true);
$sLogin = "user@domain.com";
$sPassword = "12345";
$oTenant = \Aurora\Modules\Core\Module::Decorator()->GetDefaultGlobalTenant();
$iTenantId = $oTenant->Id;
$oAccount = \Aurora\Modules\StandardAuth\Module::Decorator()->CreateAccount($iTenantId, 0, $sLogin, $sPassword);
It is assumed that the code itself is located in main Aurora Files directory. If that's not the case, you'll need to adjust the filesystem path which points to autoload.php
file. Of course, you can supply full filesystem path there.