diff --git a/apps/user_migrate/settings.php b/apps/user_migrate/settings.php index 00f46660cf..c017ba226c 100644 --- a/apps/user_migrate/settings.php +++ b/apps/user_migrate/settings.php @@ -70,8 +70,8 @@ if (isset($_POST['user_export'])) { readfile($filename); // Cleanup unlink($filename); - unlink($infofile); rmdir($exportdir); + OC_Migrate::cleanUp(); } if( isset( $_POST['user_import'] ) ){ // TODO diff --git a/lib/migrate.php b/lib/migrate.php index 88c0e7cfc2..1be229d8fd 100644 --- a/lib/migrate.php +++ b/lib/migrate.php @@ -438,4 +438,19 @@ class OC_Migrate{ } + /** + * @breif removes migration.db and exportinfo.json from the users data dir + * @return void + */ + static public function cleanUp(){ + if( !self::$uid ){ + OC_Log::write('migration', 'Failed to cleanup after migration', OC_Log::ERROR); + return false; + } + // Remove migration.db + unlink( OC::$SERVERROOT . '/data/' . self::$uid . '/migration.db' ); + // Remove exportinfo.json + unlink( OC::$SERVERROOT . '/data/' . self::$uid . '/exportinfo.json' ); + return true; + } }