[Pkg-owncloud-commits] [owncloud] 67/394: Migration: Allow for no app data cases; handle file copying better
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:11:29 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.5.10
in repository owncloud.
commit 4619c662cc6f3d63a5acc373b3d4ae3f75f9485a
Author: Tom Needham <needham.thomas at gmail.com>
Date: Tue Nov 6 23:49:25 2012 +0000
Migration: Allow for no app data cases; handle file copying better
---
lib/migrate.php | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/migrate.php b/lib/migrate.php
index 72caf9f..8d3610c 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -238,18 +238,16 @@ class OC_Migrate{
$userfolder = $extractpath . $json->exporteduser;
$newuserfolder = $datadir . '/' . self::$uid;
foreach(scandir($userfolder) as $file){
- $success = true;
if($file !== '.' && $file !== '..' && is_dir($file)){
// Then copy the folder over
- $success = OC_Helper::copyr($userfolder.'/'.$file, $newuserfolder.'/'.$file);
- }
- if(!$success){
- return json_encode( array( 'success' => false ) );
+ OC_Helper::copyr($userfolder.'/'.$file, $newuserfolder.'/'.$file);
}
}
// Import user app data
- if( !$appsimported = self::importAppData( $extractpath . $json->exporteduser . '/migration.db', $json, self::$uid ) ) {
- return json_encode( array( 'success' => false ) );
+ if(file_exists($extractpath . $json->exporteduser . '/migration.db')){
+ if( !$appsimported = self::importAppData( $extractpath . $json->exporteduser . '/migration.db', $json, self::$uid ) ) {
+ return json_encode( array( 'success' => false ) );
+ }
}
// All done!
if( !self::unlink_r( $extractpath ) ) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list