added usermanagement
This commit is contained in:
1 parent
3acce4eaf8
commit
088d763ff6
17 files changed
+1850
-785
No files matched your search
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
if (!getenv('NEXTFLOOR_TEST_STATE')) { echo "Local authentication browser-test fixture; NEXTFLOOR_TEST_STATE required.\n"; exit; }
|
||||
require __DIR__ . '/support/access-runtime.php';
|
||||
$module = new AccessFixtureModule(); initializeAccessFixture($module);
|
||||
$path = parse_url((string) $_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
if ($path === '/__test/console') { header('Content-Type: application/json'); echo json_encode(['url' => substr($module->OpenDesigner(), 5)]); return; }
|
||||
if ($path === '/__test/state') {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['writes' => $fixture['writes'], 'accounts' => array_map(static fn(array $a): array => ['name' => $a['name'], 'enabled' => $a['enabled']], json_decode($fixture['attributes']['Accounts'], true))]); return;
|
||||
}
|
||||
if ($path === '/__test/reset' && $_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$data = json_decode((string) file_get_contents('php://input'), true);
|
||||
$accounts = json_decode($fixture['attributes']['Accounts'], true);
|
||||
foreach ($accounts as $id => $a) if ($a['name'] === ($data['name'] ?? '')) { echo $module->ResetUserPassword($id, (string) ($data['password'] ?? '')); return; }
|
||||
}
|
||||
$module->hook();
|
||||
Reference in new issue
Block a user