Merge branch 'main' into develop

This commit is contained in:
slawkens
2026-01-31 15:36:45 +01:00
2 changed files with 52 additions and 2 deletions

View File

@@ -0,0 +1,50 @@
<?php
namespace MyAAC\Commands;
use MyAAC\Plugins;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
class GiveAdminCommand extends Command
{
protected function configure(): void
{
$this->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;
}
}

View File

@@ -2,9 +2,9 @@
<div class="NewsHeadline"> <div class="NewsHeadline">
<div class="NewsHeadlineBackground" style="background-image:url({{template_path }}/images/news/newsheadline_background.gif)"> <div class="NewsHeadlineBackground" style="background-image:url({{template_path }}/images/news/newsheadline_background.gif)">
<img src="{{ constant('BASE_URL') }}images/news/icon_{{ icon }}.gif" class="NewsHeadlineIcon" /> <img src="{{ constant('BASE_URL') }}images/news/icon_{{ icon }}.gif" class="NewsHeadlineIcon" />
<div class="NewsHeadlineDate">{{ date|date(config.news_date_format) }} - </div> <div class="NewsHeadlineDate">{{ date|date(setting('core.news_date_format')) }} - </div>
<div class="NewsHeadlineText">{{ title }}</div> <div class="NewsHeadlineText">{{ title }}</div>
{% if author is not empty %} {% if setting('core.news_author') and author is not empty %}
<div class="NewsHeadlineAuthor"><b>Author: </b><i>{{ author }}</i></div> <div class="NewsHeadlineAuthor"><b>Author: </b><i>{{ author }}</i></div>
{% endif %} {% endif %}
</div> </div>