mirror of
https://github.com/owncloud/ocis
synced 2026-04-25 17:25:21 +02:00
removing without skeleton files string from the user creation steps
This commit is contained in:
@@ -181,79 +181,6 @@ class OcisHelper {
|
||||
\closedir($dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for Recursive Upload of file/folder
|
||||
*
|
||||
* @param string|null $baseUrl
|
||||
* @param string|null $source
|
||||
* @param string|null $userId
|
||||
* @param string|null $password
|
||||
* @param string|null $xRequestId
|
||||
* @param string|null $destination
|
||||
*
|
||||
* @return void
|
||||
* @throws Exception|GuzzleException
|
||||
*/
|
||||
public static function recurseUpload(
|
||||
?string $baseUrl,
|
||||
?string $source,
|
||||
?string $userId,
|
||||
?string $password,
|
||||
?string $xRequestId = '',
|
||||
?string $destination = ''
|
||||
):void {
|
||||
if ($destination !== '') {
|
||||
$response = WebDavHelper::makeDavRequest(
|
||||
$baseUrl,
|
||||
$userId,
|
||||
$password,
|
||||
"MKCOL",
|
||||
$destination,
|
||||
[],
|
||||
null,
|
||||
$xRequestId
|
||||
);
|
||||
if ($response->getStatusCode() !== 201) {
|
||||
throw new Exception("Could not create folder destination" . $response->getBody()->getContents());
|
||||
}
|
||||
}
|
||||
|
||||
$dir = \opendir($source);
|
||||
while (($file = \readdir($dir)) !== false) {
|
||||
if (($file != '.') && ($file != '..')) {
|
||||
$sourcePath = $source . '/' . $file;
|
||||
$destinationPath = $destination . '/' . $file;
|
||||
if (\is_dir($sourcePath)) {
|
||||
self::recurseUpload(
|
||||
$baseUrl,
|
||||
$sourcePath,
|
||||
$userId,
|
||||
$password,
|
||||
$xRequestId,
|
||||
$destinationPath
|
||||
);
|
||||
} else {
|
||||
$response = UploadHelper::upload(
|
||||
$baseUrl,
|
||||
$userId,
|
||||
$password,
|
||||
$sourcePath,
|
||||
$destinationPath,
|
||||
$xRequestId
|
||||
);
|
||||
$responseStatus = $response->getStatusCode();
|
||||
if ($responseStatus !== 201) {
|
||||
throw new Exception(
|
||||
"Could not upload skeleton file $sourcePath to $destinationPath for user '$userId' status '$responseStatus' response body: '"
|
||||
. $response->getBody()->getContents() . "'"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
\closedir($dir);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user