Files
ops-Gazelle/sections/user/push_handle.php

24 lines
484 B
PHP

<?php
/** @phpstan-var \Gazelle\User $Viewer */
declare(strict_types=1);
namespace Gazelle;
$user = new Manager\User()->findById((int)$_GET['userid']);
if (is_null($user)) {
Error403::error();
}
if ($user->id !== $Viewer->id && !$Viewer->permitted('users_mod')) {
Error403::error();
}
authorize();
new Manager\Notification()->push(
[$user->id],
'Push!',
"You have been pushed by {$Viewer->username()}",
);
header("Location: {$user->location()}&action=edit");