$error=array('error'=>'There was an error while importing the user!','hint'=>'Please check the logs for a more detailed explaination');
$tmpl=newOCP\Template('user_migrate','settings');
$tmpl->assign('error',$error);
//return $tmpl->fetchPage();
}else{
// Check import status
foreach($response->dataas$app=>$status){
if($status!='true'){
// It failed for some reason
if($status=='notsupported'){
$notsupported[]=$app;
}elseif(!$status){
$failed[]=$app;
}
}
}
// Any problems?
if(isset($notsupported)||isset($failed)){
if(count($failed)>0){
$error=array('error'=>'Some app data failed to import','hint'=>'App data for: '.implode(', ',$failed).' failed to import.');
$tmpl=newOCP\Template('user_migrate','settings');
$tmpl->assign('error',$error);
//return $tmpl->fetchPage();
}elseif(count($notsupported)>0){
$error=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');