Kirby user as DB entries

As @bastianallgeier pointed out, there is an alternative way to register users from other sources

  1. Extend the Kirby class in a custom class in which you override the users method
  2. Adapt the index.php to load and render this new class
<?php

use Kirby\Cms\Users;

class CustomKirby extends Kirby
{

  public function users()
  {
    if (is_a($this->users, 'Kirby\Cms\Users') === true) {
      return $this->users;
    }
    $users = Users::Factory([
      [
        'name'      => 'user1',
        'email'     => 'user1@example.com',
        'id'        => 'uiftzhju',
        'password'  => User::hashPassword('12345677'),
        'language'  => 'en',
        'role'      => 'admin'
      ],
      [
        'name'      => 'user2',
        'email'     => 'user2@example.com',
        'id'        => 'uihzzhop',
        'password'  => User::hashPassword('12345678'),
        'language'  => 'en',
        'role'      => 'editor'
      ],
      [
        'name'      => 'user3',
        'email'     => 'user3@example.com',
        'id'        => 'lphzzhop',
        'password'  => User::hashPassword('12345679'),
        'language'  => 'en',
        'role'      => 'editor'
      ]
    ], []);
    return $this->users = $users;
  }
}

index.php

<?php

require __DIR__ . '/kirby/bootstrap.php';
// load the file with the custom class
require __DIR__ . '/site/plugins/users/index.php';

$kirby = new CustomKirby();

echo $kirby->render();