mirror of
https://github.com/slawkens/myaac.git
synced 2026-02-06 21:26:22 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b10f85bc1 | ||
|
|
108e83806d | ||
|
|
9d6287ecbc | ||
|
|
9fa9ec746c | ||
|
|
3e7ee12676 | ||
|
|
88ea9ceee1 |
@@ -26,7 +26,7 @@
|
|||||||
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
|
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
|
||||||
|
|
||||||
const MYAAC = true;
|
const MYAAC = true;
|
||||||
const MYAAC_VERSION = '1.8.8';
|
const MYAAC_VERSION = '1.8.9-dev';
|
||||||
const DATABASE_VERSION = 46;
|
const DATABASE_VERSION = 46;
|
||||||
const TABLE_PREFIX = 'myaac_';
|
const TABLE_PREFIX = 'myaac_';
|
||||||
define('START_TIME', microtime(true));
|
define('START_TIME', microtime(true));
|
||||||
|
|||||||
@@ -515,7 +515,12 @@ function template_place_holder($type): string
|
|||||||
$ret .= $debugBarRenderer->renderHead();
|
$ret .= $debugBarRenderer->renderHead();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif ($type === 'head_end') {
|
||||||
|
$ret .= setting('core.html_head');
|
||||||
|
}
|
||||||
elseif ($type === 'body_start') {
|
elseif ($type === 'body_start') {
|
||||||
|
$ret .= setting('core.html_body');
|
||||||
|
|
||||||
$ret .= $twig->render('browsehappy.html.twig');
|
$ret .= $twig->render('browsehappy.html.twig');
|
||||||
|
|
||||||
if (admin()) {
|
if (admin()) {
|
||||||
@@ -526,6 +531,8 @@ function template_place_holder($type): string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif($type === 'body_end') {
|
elseif($type === 'body_end') {
|
||||||
|
$ret .= setting('core.html_footer');
|
||||||
|
|
||||||
$ret .= template_ga_code();
|
$ret .= template_ga_code();
|
||||||
if (isset($debugBar)) {
|
if (isset($debugBar)) {
|
||||||
$ret .= $debugBarRenderer->render();
|
$ret .= $debugBarRenderer->render();
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ return [
|
|||||||
'footer' => [
|
'footer' => [
|
||||||
'name' => 'Custom Text',
|
'name' => 'Custom Text',
|
||||||
'type' => 'textarea',
|
'type' => 'textarea',
|
||||||
'desc' => 'Text displayed in the footer.<br/>For example: <i>' . escapeHtml('<br/>') . 'Your Server © 2023. All rights reserved.</i>',
|
'desc' => 'Text displayed in the footer.<br/>For example: <i>' . escapeHtml('<br/>') . 'Your Server © ' . date("Y") . '. All rights reserved.</i>',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
],
|
],
|
||||||
'footer_load_time' => [
|
'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',
|
'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,
|
'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',
|
'type' => 'category',
|
||||||
'title' => 'Game',
|
'title' => 'Game',
|
||||||
|
|||||||
50
system/src/Commands/GiveAdminCommand.php
Normal file
50
system/src/Commands/GiveAdminCommand.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
18
system/src/Models/AccountBan.php
Normal file
18
system/src/Models/AccountBan.php
Normal 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'
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user