Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Repositories/Wings/DaemonRevocationRepository.php
10279 views
1
<?php
2
3
namespace Pterodactyl\Repositories\Wings;
4
5
use GuzzleHttp\Exception\TransferException;
6
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
7
8
class DaemonRevocationRepository extends DaemonRepository
9
{
10
/**
11
* Deauthorizes a user (disconnects websockets and SFTP) on the Wings instance for
12
* the provided servers. If no servers are provided, the user is deauthorized on all
13
* servers on the instance.
14
*
15
* @param string[] $servers
16
*/
17
public function deauthorize(string $user, array $servers = []): void
18
{
19
try {
20
$this->getHttpClient()->post('/api/deauthorize-user', [
21
'json' => ['user' => $user, 'servers' => $servers],
22
]);
23
} catch (TransferException $exception) {
24
throw new DaemonConnectionException($exception);
25
}
26
}
27
}
28
29