[slbackup-commit] CVS update: slbackup-php/src index.php
finnarne-guest at alioth.debian.org
finnarne-guest at alioth.debian.org
Mon Apr 16 22:47:11 UTC 2007
User: finnarne-guest
Date: 07/04/16 22:47:11
Modified: src index.php
Log:
Try to get better browsing
Revision Changes Path
1.19 +9 -5 slbackup-php/src/index.php
Index: index.php
===================================================================
RCS file: /cvsroot/slbackup/slbackup-php/src/index.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- index.php 16 Apr 2007 22:16:10 -0000 1.18
+++ index.php 16 Apr 2007 22:47:11 -0000 1.19
@@ -24,9 +24,9 @@
global $backuphost, $backupuser, $ssh_options, $ssh_askpass ;
$loc = array() ;
- $cmd = sprintf ("ssh %s %s@%s find %s%s -maxdepth 1 -mindepth 1 -type d ",
+ $cmd = sprintf ("ssh %s %s@%s 'find %s%s -maxdepth 1 -mindepth 1 -type d -printf \"%s\"'",
$ssh_options, $backupuser,
- $backuphost, $clientdir, $location) ;
+ $backuphost, $clientdir, $location, '%P\n') ;
$desc[0] = array ("pipe", "r") ;
$desc[1] = array ("pipe", "w") ;
@@ -39,7 +39,9 @@
fprintf ($pipes[0], "%s\n", $passwd) ;
fclose ($pipes[0]) ;
while ($line = fgets ($pipes[1], 1024))
- $loc["d"][] = trim ($line) ;
+ $loc[] = array ('type' => 'dir',
+ 'name' => basename (trim($line)),
+ 'path' => trim ($line)) ;
fclose ($pipes[1]) ;
proc_close ($proc) ;
}
@@ -51,7 +53,9 @@
fprintf ($pipes[0], "%s\n", $passwd) ;
fclose ($pipes[0]) ;
while ($line = fgets ($pipes[1], 1024))
- $loc["f"][] = trim ($line) ;
+ $loc[] = array ('type' => 'files',
+ 'name' => basename (trim($line)),
+ 'path' => trim ($line)) ;
fclose ($pipes[1]) ;
proc_close ($proc) ;
}
@@ -475,8 +479,8 @@
switch ($submit) {
case "restorelocation":
- debug ($loc) ;
$smarty->assign ('loc', $loc) ;
+ $smarty->assign ('location', $loctions) ;
case "restoreclient":
case "restore":
$clients = array_keys($config["clients"]) ;
More information about the slbackup-commit
mailing list