Hello,
I have a question. How can I get the user of a protected directory? I have the following code. You see 'name' and 'path', but how can I use 'user'?
I have a question. How can I get the user of a protected directory? I have the following code. You see 'name' and 'path', but how can I use 'user'?
PHP:
public function DirectoryInfo($Domain, $dir)
{
global $sock;
$sock->set_method('GET');
$sock->query('/CMD_API_FILE_MANAGER', array('action' => 'protect', 'path' => '/domains/'.$Domain.'/public_html'.$dir));
$result = $sock->fetch_parsed_body();
$name = $result['name'];
switch ($result)
{
case ($result['error'] == 1):
print "The path does not exists.";
break;
case ($result['enabled'] == 'no'):
print "The path is not protected.";
break;
case ($result['enabled'] == 'yes'):
print "<path>$dir</path><name>$name</name>";
exit;
default:
print "Protected services are not used.";
}
}