@@ -36,12 +36,18 @@ if (isset($_POST['user_import'])) {
$from=$_FILES['owncloud_import']['tmp_name'];
$to=get_temp_dir().'/'.$importname.'.zip';
if(!move_uploaded_file($from,$to)){
$errors[]=array('error'=>'Failed to move the uploaded file','hint'=>'Try checking the permissions of the '.get_temp_dir().' dir.');
OC_Log::write('user_migrate',"Failed to copy the uploaded file",OC_Log::ERROR);
exit();
$t=newOC_Template('','error','user');
$t->assign('errors',$errors);
$t->fetchPage();
}
if(!$appsstatus=OC_Migrate::import($to,'user')){
die('failed to to import');
$errors[]=array('error'=>'There was an error while importing the user!','hint'=>'Please check the logs for a more detailed explaination');
$t=newOC_Template('','error','user');
$t->assign('errors',$errors);
$t->fetchPage();
}else{
// Check import status
foreach($appsstatusas$app=>$status){
...
...
@@ -57,10 +63,20 @@ if (isset($_POST['user_import'])) {
// Any problems?
if(isset($notsupported)||isset($failed)){
if(count($failed)>0){
die('Some apps failed to import. View the log please.');
$errors[]=array('error'=>'Some app data failed to import','hint'=>'App data for: '.implode(', ',$failed).' failed to import.');
$t=newOC_Template('','error','user');
$t->assign('errors',$errors);
$t->fetchPage();
}elseif(count($notsupported)>0){
die('Some apps were not found in this owncloud instance and therefore could not be installed');
$errors[]=array('error'=>'Some app data could not be imported, as the apps are not installed on this instance','hint'=>'App data for: '.implode(', ',$notsupported).' failed to import as they were not found. Please install the apps and try again');