added cleanUp() method to OC_Migrate
This commit is contained in:
parent
7e3b35a57c
commit
0f3eebbbd9
|
@ -70,8 +70,8 @@ if (isset($_POST['user_export'])) {
|
||||||
readfile($filename);
|
readfile($filename);
|
||||||
// Cleanup
|
// Cleanup
|
||||||
unlink($filename);
|
unlink($filename);
|
||||||
unlink($infofile);
|
|
||||||
rmdir($exportdir);
|
rmdir($exportdir);
|
||||||
|
OC_Migrate::cleanUp();
|
||||||
|
|
||||||
} if( isset( $_POST['user_import'] ) ){
|
} if( isset( $_POST['user_import'] ) ){
|
||||||
// TODO
|
// TODO
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue