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
32 lines
1.0 KiB
PHP
32 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Aowow;
|
|
|
|
if (!defined('AOWOW_REVISION'))
|
|
die('illegal access');
|
|
|
|
|
|
class AdminScreenshotsActionManageResponse extends TextResponse
|
|
{
|
|
protected int $requiredUserGroup = U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_SCREENSHOT;
|
|
|
|
protected array $expectedGET = array(
|
|
'type' => ['filter' => FILTER_VALIDATE_INT ],
|
|
'typeid' => ['filter' => FILTER_VALIDATE_INT ],
|
|
'user' => ['filter' => FILTER_CALLBACK, 'options' => 'urldecode']
|
|
);
|
|
|
|
protected function generate() : void
|
|
{
|
|
$res = [];
|
|
|
|
if ($this->_get['type'] && $this->_get['typeid'])
|
|
$res = ScreenshotMgr::getScreenshots($this->_get['type'], $this->_get['typeid']);
|
|
else if ($this->_get['user'])
|
|
if ($uId = DB::Aowow()->selectCell('SELECT `id` FROM ?_account WHERE LOWER(`username`) = LOWER(?)', $this->_get['user']))
|
|
$res = ScreenshotMgr::getScreenshots(userId: $uId);
|
|
|
|
$this->result = 'ssm_screenshotData = '.Util::toJSON($res);
|
|
}
|
|
}
|