Compare commits

...

6 Commits
v1.8.8 ... main

Author SHA1 Message Date
slawkens
8b10f85bc1 Start v1.8.9-dev 2026-02-04 18:37:03 +01:00
slawkens
108e83806d Settings: Custom HTML for <head> and <body> 2026-01-31 16:01:34 +01:00
slawkens
9d6287ecbc Settings: Use current year for the footer, instead of predefined one 2026-01-31 15:49:25 +01:00
slawkens
9fa9ec746c Add give:admin Command
Usage: php aac give:admin slawkens@gmail.com
Parameter: account email, name or id
2026-01-31 15:29:48 +01:00
slawkens
3e7ee12676 Update news.html.twig 2026-01-31 15:07:49 +01:00
slawkens
88ea9ceee1 Create AccountBan.php 2026-01-31 12:30:07 +01:00
6 changed files with 101 additions and 4 deletions

View File

@@ -26,7 +26,7 @@
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
const MYAAC = true;
const MYAAC_VERSION = '1.8.8';
const MYAAC_VERSION = '1.8.9-dev';
const DATABASE_VERSION = 46;
const TABLE_PREFIX = 'myaac_';
define('START_TIME', microtime(true));

View File

@@ -515,7 +515,12 @@ function template_place_holder($type): string
$ret .= $debugBarRenderer->renderHead();
}
}
elseif ($type === 'head_end') {
$ret .= setting('core.html_head');
}
elseif ($type === 'body_start') {
$ret .= setting('core.html_body');
$ret .= $twig->render('browsehappy.html.twig');
if (admin()) {
@@ -526,6 +531,8 @@ function template_place_holder($type): string
}
}
elseif($type === 'body_end') {
$ret .= setting('core.html_footer');
$ret .= template_ga_code();
if (isset($debugBar)) {
$ret .= $debugBarRenderer->render();

View File

@@ -156,7 +156,7 @@ return [
'footer' => [
'name' => 'Custom Text',
'type' => 'textarea',
'desc' => 'Text displayed in the footer.<br/>For example: <i>' . escapeHtml('<br/>') . 'Your Server &copy; 2023. All rights reserved.</i>',
'desc' => 'Text displayed in the footer.<br/>For example: <i>' . escapeHtml('<br/>') . 'Your Server &copy; ' . date("Y") . '. All rights reserved.</i>',
'default' => '',
],
'footer_load_time' => [
@@ -251,6 +251,28 @@ return [
'desc' => 'Allow MyAAC to report anonymous usage statistics to developers? The data is sent only once per 30 days and is fully confidential. It won\'t affect the performance of your website',
'default' => true,
],
[
'type' => 'section',
'title' => 'Custom HTML',
],
'html_head' => [
'name' => 'HTML Head',
'type' => 'textarea',
'desc' => escapeHtml('These scripts will be printed in the <head> section. Can be, for example, Google Analytics code.'),
'default' => '',
],
'html_body' => [
'name' => 'HTML Body',
'type' => 'textarea',
'desc' => escapeHtml('These scripts will be printed just below the opening <body> tag.'),
'default' => '',
],
'html_footer' => [
'name' => 'HTML Footer',
'type' => 'textarea',
'desc' => escapeHtml('These scripts will be printed above the closing </body> tag.'),
'default' => '',
],
[
'type' => 'category',
'title' => 'Game',

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

@@ -0,0 +1,18 @@
<?php
namespace MyAAC\Models;
use Illuminate\Database\Eloquent\Model;
class AccountBan extends Model {
protected $table = TABLE_PREFIX . 'account_bans';
public $timestamps = false;
protected $fillable = [
'account_id',
'reason', 'banned_at',
'expires_at', 'banned_by'
];
}

View File

@@ -2,9 +2,9 @@
<div class="NewsHeadline">
<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" />
<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>
{% 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>
{% endif %}
</div>