diff --git a/src/FederationCLI/InteractiveMode.php b/src/FederationCLI/InteractiveMode.php index c9b0369..97900ab 100644 --- a/src/FederationCLI/InteractiveMode.php +++ b/src/FederationCLI/InteractiveMode.php @@ -65,7 +65,7 @@ case Methods::GET_CLIENT: self::getClient($input); break; - case Methods::CHANGE_CLIENT_NAME: + case Methods::UPDATE_CLIENT_NAME: self::changeClientName($input); break; @@ -212,7 +212,7 @@ try { - self::$federation_lib->changeClientName(null, $uuid, $name); + self::$federation_lib->updateClientName(null, $uuid, $name); print('OK' . PHP_EOL); } catch(ClientNotFoundException) diff --git a/src/FederationLib/Enums/Standard/Methods.php b/src/FederationLib/Enums/Standard/Methods.php index f49b7bd..c5ddc28 100644 --- a/src/FederationLib/Enums/Standard/Methods.php +++ b/src/FederationLib/Enums/Standard/Methods.php @@ -9,8 +9,8 @@ public const CREATE_CLIENT = 'create_client'; public const GET_CLIENT = 'get_client'; - public const CHANGE_CLIENT_NAME = 'change_client_name'; - public const CHANGE_CLIENT_DESCRIPTION = 'change_client_description'; + public const UPDATE_CLIENT_NAME = 'update_client_name'; + public const UPDATE_CLIENT_DESCRIPTION = 'update_client_description'; public const ALL = [ self::PING, @@ -18,7 +18,7 @@ self::CREATE_CLIENT, self::GET_CLIENT, - self::CHANGE_CLIENT_NAME, - self::CHANGE_CLIENT_DESCRIPTION + self::UPDATE_CLIENT_NAME, + self::UPDATE_CLIENT_DESCRIPTION ]; } \ No newline at end of file diff --git a/src/FederationLib/FederationLib.php b/src/FederationLib/FederationLib.php index 5ef7c99..c02b4f4 100755 --- a/src/FederationLib/FederationLib.php +++ b/src/FederationLib/FederationLib.php @@ -240,9 +240,9 @@ * @throws InternalServerException * @throws InvalidClientNameException */ - public function changeClientName(?ClientIdentity $identity, string $client_uuid, ?string $new_name): bool + public function updateClientName(?ClientIdentity $identity, string $client_uuid, ?string $new_name): bool { - if(!$this->checkPermission(Methods::CHANGE_CLIENT_NAME, $this->resolveIdentity($identity))) + if(!$this->checkPermission(Methods::UPDATE_CLIENT_NAME, $this->resolveIdentity($identity))) { throw new Exceptions\Standard\AccessDeniedException('You do not have sufficient permission to change the name of a client'); } diff --git a/src/FederationLib/Managers/ClientManager.php b/src/FederationLib/Managers/ClientManager.php index 78891a0..d68765a 100644 --- a/src/FederationLib/Managers/ClientManager.php +++ b/src/FederationLib/Managers/ClientManager.php @@ -57,8 +57,8 @@ tm::addFunction('client_registerClient', [$this, 'registerClient']); tm::addFunction('client_getClient', [$this, 'getClient']); tm::addFunction('client_changeClientName', [$this, 'changeClientName']); - tm::addFunction('client_changeClientDescription', [$this, 'changeClientDescription']); - tm::addFunction('client_changeClientPermissionRole', [$this, 'changeClientPermissionRole']); + tm::addFunction('client_changeClientDescription', [$this, 'updateClientDescription']); + tm::addFunction('client_changeClientPermissionRole', [$this, 'updateClientPermissionRole']); tm::addFunction('client_updateLastSeen', [$this, 'updateLastSeen']); tm::addFunction('client_listClients', [$this, 'listClients']); tm::addFunction('client_getTotalClients', [$this, 'getTotalClients']); @@ -298,7 +298,7 @@ * @throws DatabaseException * @throws InvalidClientDescriptionException */ - public function changeClientDescription(string|ClientRecord $client_uuid, ?string $description=null): void + public function updateClientDescription(string|ClientRecord $client_uuid, ?string $description=null): void { if($client_uuid instanceof ClientRecord) { @@ -375,7 +375,7 @@ * @throws DatabaseException * @throws InvalidPermissionRoleException */ - public function changeClientPermissionRole(string|ClientRecord $client_uuid, int $permission_role): void + public function updateClientPermissionRole(string|ClientRecord $client_uuid, int $permission_role): void { if($client_uuid instanceof ClientRecord) {