Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Fixes LDAP Fileset browsing in restore filetree
Browse files Browse the repository at this point in the history
This is a workaround which should fix the following bug reported.

bvfs_lsdirs should deliver @LDAP/ if path argument is left empty like it's
giving a / for *nix and all drives for windows clients on top level.

It currently only works if path argument get's an @, like:

*.bvfs_lsdirs jobid=684,691 path=@
282 0 0 0 A A A A A A A A A A A A A A .
282 0 0 0 A A A A A A A A A A A A A A ..
281 0 0 0 A A A A A A A A A A A A A A @LDAP/
282 0 0 0 A A A A A A A A A A A A A A @

Fixes #597: Python LDAP Plugin Fileset not visible in restore
  • Loading branch information
fbergkemper committed Jun 7, 2016
1 parent f88262c commit 6c1429d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions module/Restore/src/Restore/Model/RestoreModel.php
Expand Up @@ -59,7 +59,15 @@ public function getDirectories($jobid=null, $pathid=null) {
$result = $this->director->send_command($cmd, 2, $jobid);
$directories = \Zend\Json\Json::decode($result, \Zend\Json\Json::TYPE_ARRAY);
if(empty($directories['result']['directories'])) {
return null;
$cmd = '.bvfs_lsdirs jobid='.$jobid.' path=@';
$result = $this->director->send_command($cmd, 2, $jobid);
$directories = \Zend\Json\Json::decode($result, \Zend\Json\Json::TYPE_ARRAY);
if(empty($directories['result']['directories'])) {
return null;
}
else {
return $directories['result']['directories'];
}
}
else {
return $directories['result']['directories'];
Expand All @@ -82,7 +90,15 @@ public function getFiles($jobid=null, $pathid=null) {
$result = $this->director->send_command($cmd, 2, $jobid);
$files = \Zend\Json\Json::decode($result, \Zend\Json\Json::TYPE_ARRAY);
if(empty($files['result']['files'])) {
return null;
$cmd = '.bvfs_lsfiles jobid='.$jobid.' path=@';
$result = $this->director->send_command($cmd, 2, $jobid);
$files = \Zend\Json\Json::decode($result, \Zend\Json\Json::TYPE_ARRAY);
if(empty($files['result']['files'])) {
return null;
}
else {
return $files['result']['files'];
}
}
else {
return $files['result']['files'];
Expand Down

0 comments on commit 6c1429d

Please sign in to comment.