Aurora Files documentation

Enabling demo mode

If you have Aurora Files installation, you may wish to allow users take a look at how the product works, with no need to setup a user account for them. Note that you need Aurora Files 9.7.1 or newer for this to work.

This is achieved by installing the following modules:

You'll need to add these two items to "require" section in composer.json file of your Aurora Files installation:

"afterlogic/aurora-module-demo-mode-plugin": "~0.10.0",
"afterlogic/aurora-module-demo-mode-files-initializer-plugin": "~0.10.0",

And then proceed with adding the modules.

Once the modules are installed, press "Update configuration" button in Database Settings screen of admin interface, that will ensure configuration files for the modules are initialized. In DemoModePlugin.config.json and DemoModeFilesInitializerPlugin.config.json files found under data/settings/modules directory, make sure "Disabled" is set to false. Then edit the following section of DemoModePlugin.config.json file:

"DemoUserType": [
    "Db",
    "spec",
    "Aurora\\Modules\\DemoModePlugin\\Enums\\DemoUserType",
    ""
],
"DemoLogin": [
    "user@domain.com",
    "string",
    null,
    ""
],
"DemoRealPass": [
    "SomePassWord123",
    "string",
    null,
    ""
],

It's important to set "DemoUserType" to "Db", "DemoLogin" value will be used as a base for account login - in this case, actual login will look like user-NNNNN@domain.com with a randomly generated part there. Note that "DemoRealPass" will be the real password, so make sure it's complex enough.

You'll also need to supply demo login and password in StandardLoginFormWebclient.config.json file:

"DemoLogin": [
    "user@domain.com",
    "string",
    null,
    "If set, denotes email address of predefined demo account"
],
"DemoPassword": [
    "nothing123",
    "string",
    null,
    "If set, denotes password of predefined demo account"
],

"DemoLogin" should be set to the same value as the one supplied in DemoModePlugin.config.json file.

"DemoPassword", however, should NOT have the same value as "DemoRealPass", supply an arbitrary text here used in login form as a placeholder.

Assuming everything is configured correctly, users can navigate to your Aurora Files installation and they'll only need to press "Sign In" button, a demo account will be created for them automatically, and several default files will be placed in their Files storage.

Deleting old demo accounts

To avoid accumulating old demo accounts taking space on filesystem and in the database, you can run the following script as a cronjob, say, every 30 days.

Note that the script should be placed in main Aurora Files directory, and it removes the outdated accounts with specific user-NNNNN@domain.com login template, so make sure you don't have any actual accounts matching that template.

<?php
require_once __DIR__ . "/system/autoload.php";
\Aurora\System\Api::Init(true);
$bResult = false;
try
{
    $oCoreDecorator = \Aurora\Modules\Core\Module::Decorator();
    if ($oCoreDecorator)
    {
        $aFilters = \Aurora\Modules\Core\Models\User::where('CreatedAt', '<', date('Y-m-d H:i:s', strtotime('-30 days')));
        $aUsers = \Aurora\Modules\Core\Module::Decorator()->GetUsers(0, 0, 100, 'PublicId', \Aurora\System\Enums\SortOrder::ASC, '@domain.com', $aFilters);
        foreach ($aUsers["Items"] as $aUser) {
            $oUser=$oCoreDecorator->getUserByPublicId($aUser["PublicId"]);
            if (preg_match('/^user-[\dA-z]+@domain.com$/', $aUser["PublicId"]))
            {
                $bResult = $oCoreDecorator->DeleteUser($oUser->EntityId);
            }
        }
    }
}
catch (\Exception $oException)
{
}