API reset ownership on given path

ricardo

New member
Joined
Apr 18, 2012
Messages
5
Hello members,

This is my first post.

As I am more getting into Direct Admin I want to make use of the API's.
In particular I want to know how I can use the API to change the ownership based on a given path.

(frontend:)
I can login not as admin, but the client account. And browse throught the file manager. Options like reset recurvely' or 'reset ownership' is working well.
But now with the API I cannot get this working.


This is my code:

Code:
$path = '/domains/kljfdkdf.nl/public_html/domains/mydomain.nl';
$sock->set_method('GET');   
$sock->query('/CMD_API_FILE_MANAGER' . $path, 
			array( 
			  'action' => 'resetowner', 
			  'method' => 'recursive',
			));  

$result = $sock->fetch_parsed_body();

The answer I get is:
-You cannot execute that command
The request you've made cannot be executed because it does not exist in your authority leve

I have Direct Admin version: DirectAdmin v1.40.1

Does anyone has an idea?

thanx in advance.

ricardo
 
Hello zEitEr,

That does not solve it...
I get the same error and cannot figure out if it is just a wrong path settings or something with authority (permissions).

Do you have an idea?
 
Try then

PHP:
$path = '/domains/kljfdkdf.nl/public_html/domains/mydomain.nl';
$sock->set_method('GET');   
$sock->query('/CMD_API_FILE_MANAGER'
			array( 
			  'action' => 'resetowner', 
			  'method' => 'recursive',
			  'path' => $path
			));  

$result = $sock->fetch_parsed_body();
 
Last edited:
hey zEitEr,


That does the trick!
Thank you very much.
This solves my problem.
I spent almost a day figuring out, thanks to you it stops now.

ricardo
 
Back
Top