mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
* split Screenshot upload & management into separate endpoints * move shared functions to manager classes * cleanup javascript * move test for config screenshot min size to cfg class
33 lines
824 B
PHP
33 lines
824 B
PHP
<?php
|
|
|
|
namespace Aowow;
|
|
|
|
if (!defined('AOWOW_REVISION'))
|
|
die('illegal access');
|
|
|
|
|
|
class AdminScreenshotsActionEditaltResponse extends TextResponse
|
|
{
|
|
use TrCommunityHelper;
|
|
|
|
protected int $requiredUserGroup = U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_SCREENSHOT;
|
|
|
|
protected array $expectedGET = array(
|
|
'id' => ['filter' => FILTER_VALIDATE_INT]
|
|
);
|
|
protected array $expectedPOST = array(
|
|
'alt' => ['filter' => FILTER_CALLBACK, 'options' => [self::class, 'checkTextLine']]
|
|
);
|
|
|
|
protected function generate() : void
|
|
{
|
|
if (!$this->assertGET('id'))
|
|
return;
|
|
|
|
DB::Aowow()->query('UPDATE ?_screenshots SET `caption` = ? WHERE `id` = ?d',
|
|
$this->handleCaption($this->_post['alt']),
|
|
$this->_get['id']
|
|
);
|
|
}
|
|
}
|