update_chown()

Update file ownership.

All API functions File Management

Signature

update_chown(array $parameters): mixed

Parameters

Pass these parameters as KasRequestParams. Every request also requires kas_login, kas_auth_type, and kas_auth_data, as shown in SOAP with PHP.

Name Description Requirement
chown_path The path to correct Required
chown_user The target user: phpuser|kas_login (kas_login, e.g. w0123456) Required
recursive Set the ownership recursively: Y|N Required

PHP example

<?php

// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
    'chown_path' => '/forum/',
    'chown_user' => 'w0123456',
    'recursive' => 'Y',
];

try {
    $client = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
    $response = $client->KasApi(json_encode([
        'kas_login' => 'w0123456',
        'kas_auth_type' => 'session',
        'kas_auth_data' => $sessionToken,
        'kas_action' => 'update_chown',
        'KasRequestParams' => $parameters,
    ]));
    print_r($response);
} catch (SoapFault $fault) {
    echo 'Error: ' . $fault->faultstring;
}

Responses and error codes

  • TRUE the action was carried out
  • missing_parameter a required parameter is missing
  • in_progress the KAS object is currently being processed
  • chownuser_syntax_incorrect
  • directory_syntax_incorrect
  • recursive_syntax_incorrect