diff --git a/debug_contactpersoon_data.php b/debug_contactpersoon_data.php new file mode 100644 index 00000000..215a58a5 --- /dev/null +++ b/debug_contactpersoon_data.php @@ -0,0 +1,40 @@ + diff --git a/debug_contactpersoon_database.php b/debug_contactpersoon_database.php new file mode 100644 index 00000000..c0339d64 --- /dev/null +++ b/debug_contactpersoon_database.php @@ -0,0 +1,44 @@ + diff --git a/debug_database_direct.php b/debug_database_direct.php new file mode 100644 index 00000000..aa354554 --- /dev/null +++ b/debug_database_direct.php @@ -0,0 +1,71 @@ +getDatabaseConnection(); + + // Query the openregister_objects table + $query = "SELECT * FROM oc_openregister_objects WHERE id = ?"; + $stmt = $connection->prepare($query); + $result = $stmt->execute([$contactpersoonId]); + $row = $stmt->fetch(); + + if ($row) { + echo "Found contactpersoon in database:\n"; + echo "ID: " . $row['id'] . "\n"; + echo "Name: " . $row['name'] . "\n"; + echo "Object JSON: " . $row['object'] . "\n"; + echo "Created: " . $row['created'] . "\n"; + echo "Updated: " . $row['updated'] . "\n\n"; + + // Decode the JSON object + $objectData = json_decode($row['object'], true); + if ($objectData) { + echo "Decoded object data:\n"; + echo json_encode($objectData, JSON_PRETTY_PRINT) . "\n\n"; + + // Check for username + if (isset($objectData['username'])) { + echo "Username found: " . $objectData['username'] . "\n"; + + // Check if user exists in Nextcloud + $userManager = \OC::$server->getUserManager(); + $user = $userManager->get($objectData['username']); + + if ($user) { + echo "User exists in Nextcloud: " . $user->getUID() . "\n"; + echo "User enabled: " . ($user->isEnabled() ? 'Yes' : 'No') . "\n"; + echo "User disabled: " . ($user->isEnabled() ? 'No' : 'Yes') . "\n"; + } else { + echo "User NOT found in Nextcloud\n"; + } + } else { + echo "No username field in object data\n"; + } + } else { + echo "Failed to decode object JSON\n"; + } + } else { + echo "Contactpersoon NOT found in database\n"; + } + +} catch (Exception $e) { + echo "Error: " . $e->getMessage() . "\n"; + echo "Trace: " . $e->getTraceAsString() . "\n"; +} + +echo "\n=== Debug Complete ===\n"; diff --git a/debug_user_status.php b/debug_user_status.php new file mode 100644 index 00000000..b137063c --- /dev/null +++ b/debug_user_status.php @@ -0,0 +1,46 @@ +getMessage() . "\n"; +} + +echo "=== END DEBUG ===\n"; +?> diff --git a/find_test_object.php b/find_test_object.php deleted file mode 100644 index cdc71c31..00000000 --- a/find_test_object.php +++ /dev/null @@ -1,83 +0,0 @@ -getDatabaseConnection(); - -try { - // Search for our specific test object - $query = $db->getQueryBuilder(); - $query->select('*') - ->from('openregister_objects') - ->where($query->expr()->like('uuid', $query->createNamedParameter('%d4572e2e-aa3e-4cbe-94aa-16f0e2ae9620%'))) - ->setMaxResults(1); - $result = $query->execute(); - $row = $result->fetch(); - - if ($row) { - echo "🎉 Found our test object!" . PHP_EOL; - echo "Database ID: " . $row['id'] . PHP_EOL; - echo "UUID: " . $row['uuid'] . PHP_EOL; - echo "Slug: " . ($row['slug'] ?: '(empty)') . PHP_EOL; - echo "Register: " . $row['register'] . PHP_EOL; - echo "Schema: " . $row['schema'] . PHP_EOL; - echo PHP_EOL; - - // Parse the JSON object - $obj = json_decode($row['object'], true); - if ($obj) { - echo "=== OBJECT STRUCTURE ANALYSIS ===" . PHP_EOL; - - // Check @self structure - if (isset($obj['@self'])) { - echo "✓ @self structure:" . PHP_EOL; - foreach ($obj['@self'] as $key => $value) { - echo " $key: " . $value . PHP_EOL; - } - echo PHP_EOL; - } else { - echo "❌ No @self structure found" . PHP_EOL; - } - - // Check for flattened properties - $expectedProps = ['GEMMA type', 'Object ID', 'GEMMA thema']; - echo "=== FLATTENED PROPERTIES CHECK ===" . PHP_EOL; - $foundProps = []; - foreach ($expectedProps as $prop) { - if (isset($obj[$prop])) { - echo "✓ $prop: " . $obj[$prop] . PHP_EOL; - $foundProps[] = $prop; - } else { - echo "❌ $prop: NOT FOUND" . PHP_EOL; - } - } - echo PHP_EOL; - - // Check if properties are in xml field instead - if (isset($obj['xml']) && is_array($obj['xml'])) { - echo "=== PROPERTIES IN XML FIELD (SHOULD BE EMPTY) ===" . PHP_EOL; - $xmlProps = []; - foreach ($expectedProps as $prop) { - if (isset($obj['xml'][$prop])) { - echo "⚠️ $prop found in xml field: " . $obj['xml'][$prop] . PHP_EOL; - $xmlProps[] = $prop; - } - } - if (empty($xmlProps)) { - echo "✓ No flattened properties found in xml field (good!)" . PHP_EOL; - } - } - - echo PHP_EOL . "=== SUMMARY ===" . PHP_EOL; - echo "Root level properties found: " . count($foundProps) . "/" . count($expectedProps) . PHP_EOL; - echo "Database slug field: " . ($row['slug'] ? "✓ " . $row['slug'] : "❌ EMPTY") . PHP_EOL; - echo "@self.slug: " . (isset($obj['@self']['slug']) ? "✓ " . $obj['@self']['slug'] : "❌ NOT SET") . PHP_EOL; - } else { - echo "❌ Failed to parse object JSON" . PHP_EOL; - } - } else { - echo "❌ Test object not found" . PHP_EOL; - } -} catch (Exception $e) { - echo "Error: " . $e->getMessage() . PHP_EOL; -} - diff --git a/src/components/cards/OrganisatieCard.vue b/src/components/cards/OrganisatieCard.vue index 1cf1080d..9ffe531b 100644 --- a/src/components/cards/OrganisatieCard.vue +++ b/src/components/cards/OrganisatieCard.vue @@ -8,6 +8,7 @@ * @license AGPL-3.0-or-later * @version 1.0.0 * @link https://github.com/opencatalogi/softwarecatalog + * Updated: Fixed AlertTriangle import to use Alert icon */