aowow/endpoints/profile/delete.php
Sarjuuk 715c1534eb Core/Endpoints
* don't use raw input to recreate subcategories for filter urls and
   external links
 * if a page does not expect categories it will now error out if it is
   called with parameters
 * fixed infite redirect loop that could occur if the pageName was an
   invalid string
 * added lost filter string for external page call to NPCs Page
2026-01-01 01:26:35 +01:00

47 lines
1.1 KiB
PHP

<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
class ProfileDeleteResponse extends TextResponse
{
protected bool $requiresLogin = true;
protected array $expectedGET = array(
'id' => ['filter' => FILTER_CALLBACK, 'options' => [self::class, 'checkIdList']],
);
public function __construct(string $rawParam)
{
parent::__construct($rawParam);
if (!Cfg::get('PROFILER_ENABLE'))
$this->generate404();
}
/* params
id: <prId1,prId2,..,prIdN>
return
null
*/
protected function generate() : void
{
if (!$this->assertGET('id'))
{
trigger_error('ProfileDeleteResponse - profileId empty', E_USER_WARNING);
return;
}
// only flag as deleted; only custom profiles
DB::Aowow()->query(
'UPDATE ?_profiler_profiles SET `deleted` = 1 WHERE `id` IN (?a) AND `custom` = 1 {AND `user` = ?d}',
$this->_get['id'],
User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU) ? DBSIMPLE_SKIP : User::$id
);
}
}
?>