diff --git a/appinfo/info.xml b/appinfo/info.xml
index ea0d47b..586b932 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -4,7 +4,7 @@
Minimal Profile
Hides profile fields to create a minimal user profile
Allows administrators to hide profile fields like pronouns, social links, etc.
- 1.0.24
+ 1.0.25
AGPL
Your Name
MinimalProfile
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index 3045175..d9ca128 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -13,43 +13,23 @@ use OCP\Util;
class Application extends App implements IBootstrap {
- public const APP_ID = 'minimalprofile';
-
public function __construct(array $urlParams = []) {
- parent::__construct(self::APP_ID, $urlParams);
+ parent::__construct('minimalprofile', $urlParams);
}
public function register(IRegistrationContext $context): void {
}
public function boot(IBootContext $context): void {
- $container = $context->getAppContainer();
- $config = $container->query(IConfig::class);
+ // Write to Nextcloud data directory
+ $dataDir = \OCP\Server::get(\OCP\IConfig::class)->getSystemValue('datadirectory');
+ $testFile = $dataDir . '/minimalprofile_test.log';
+ $result = @file_put_contents($testFile, date('Y-m-d H:i:s') . ' boot ran, config: ' . \OCP\Server::get(IConfig::class)->getAppValue('minimalprofile', 'hidden_fields', 'none') . "\n");
- $value = $config->getAppValue('minimalprofile', 'hidden_fields', '');
- $hidden = ($value !== '') ? json_decode($value, true) ?? [] : [];
+ // Load CSS
+ Util::addStyle('minimalprofile', 'minimalprofile');
- $css = '';
- if (!empty($hidden)) {
- $selectors = [
- 'pronouns' => '#account-property-pronouns',
- 'role' => '#account-property-role',
- 'headline' => '#account-property-headline',
- ];
- foreach ($hidden as $field) {
- if (isset($selectors[$field])) {
- $css .= $selectors[$field] . ' { display: none !important; }' . "\n";
- }
- }
- } else {
- // Debug
- $css = 'body { border: 30px solid green !important; }';
- }
-
- if ($css) {
- Util::addInlineStyle($css);
- }
-
- file_put_contents('/tmp/mp_boot.log', date('Y-m-d H:i:s') . ' boot ran, hidden: ' . print_r($hidden, true) . ", css: $css\n", FILE_APPEND);
+ // Store result
+ @file_put_contents($dataDir . '/mp_result.log', date('Y-m-d H:i:s') . ' result: ' . ($result ?: 'failed') . "\n", FILE_APPEND);
}
}
\ No newline at end of file