From 3e7ee12676e115865a296b1a41140819f0392c23 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 31 Jan 2026 15:07:49 +0100 Subject: [PATCH 1/2] Update news.html.twig --- templates/kathrine/news.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/kathrine/news.html.twig b/templates/kathrine/news.html.twig index 17b0779e..a3e7a12e 100644 --- a/templates/kathrine/news.html.twig +++ b/templates/kathrine/news.html.twig @@ -2,9 +2,9 @@
-
{{ date|date(config.news_date_format) }} -
+
{{ date|date(setting('core.news_date_format')) }} -
{{ title }}
- {% if author is not empty %} + {% if setting('core.news_author') and author is not empty %}
Author: {{ author }}
{% endif %}
From 9fa9ec746c4b344387a21f21886c2251319806fc Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 31 Jan 2026 15:29:48 +0100 Subject: [PATCH 2/2] Add give:admin Command Usage: php aac give:admin slawkens@gmail.com Parameter: account email, name or id --- system/src/Commands/GiveAdminCommand.php | 50 ++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 system/src/Commands/GiveAdminCommand.php diff --git a/system/src/Commands/GiveAdminCommand.php b/system/src/Commands/GiveAdminCommand.php new file mode 100644 index 00000000..d2565783 --- /dev/null +++ b/system/src/Commands/GiveAdminCommand.php @@ -0,0 +1,50 @@ +setName('give:admin') + ->setDescription('This command adds super admin privileges to selected user') + ->addArgument('account', InputArgument::REQUIRED, 'Account E-Mail, name or id'); + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + require SYSTEM . 'init.php'; + + $io = new SymfonyStyle($input, $output); + + $account = new \OTS_Account(); + + $accountParam = $input->getArgument('account'); + if (str_contains($accountParam, '@')) { + $account->findByEMail($accountParam); + } + else { + if (USE_ACCOUNT_NAME || USE_ACCOUNT_NUMBER) { + $account->find($accountParam); + } + else { + $account->load($accountParam); + } + } + + if (!$account->isLoaded()) { + $io->error('Cannot find account mit supplied parameter: ' . $accountParam); + return self::FAILURE; + } + + $account->setCustomField('web_flags', 3); + $io->success('Successfully added admin privileges to ' . $accountParam . ' (E-Mail: ' . $account->getEMail() . ')'); + return self::SUCCESS; + } +}