Merge pull request #7766 from Xenopathic/master

Fix smb4php to work with home shares
This commit is contained in:
Robin McCorkell 2014-03-18 19:42:04 +00:00
commit 340cd2734b
1 changed files with 5 additions and 11 deletions

View File

@ -20,6 +20,7 @@
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# Addition 17/12/2012 Frank Karlitschek (frank@owncloud.org) # Addition 17/12/2012 Frank Karlitschek (frank@owncloud.org)
# Addition 17/03/2014 Robin McCorkell (rmccorkell@karoshi.org.uk)
# On the official website http://www.phpclasses.org/smb4php the # On the official website http://www.phpclasses.org/smb4php the
# license is listed as LGPL so we assume that this is # license is listed as LGPL so we assume that this is
# dual-licensed GPL/LGPL # dual-licensed GPL/LGPL
@ -238,17 +239,10 @@ class smb {
trigger_error ("url_stat(): list failed for host '{$pu['host']}'", E_USER_WARNING); trigger_error ("url_stat(): list failed for host '{$pu['host']}'", E_USER_WARNING);
break; break;
case 'share': case 'share':
if ($o = smb::look ($pu)) { if (smb::execute("ls", $pu))
$found = FALSE; $stat = stat ("/tmp");
$lshare = strtolower ($pu['share']); # fix by Eric Leung else
foreach ($o['disk'] as $s) if ($lshare == strtolower($s)) { trigger_error ("url_stat(): disk resource '{$pu['share']}' not found in '{$pu['host']}'", E_USER_WARNING);
$found = TRUE;
$stat = stat ("/tmp");
break;
}
if (! $found)
trigger_error ("url_stat(): disk resource '{$lshare}' not found in '{$pu['host']}'", E_USER_WARNING);
}
break; break;
case 'path': case 'path':
if ($o = smb::execute ('dir "'.$pu['path'].'"', $pu)) { if ($o = smb::execute ('dir "'.$pu['path'].'"', $pu)) {