diff options
Diffstat (limited to 'ajax')
-rw-r--r-- | ajax/createfolder.php | 5 | ||||
-rw-r--r-- | ajax/importopml.php | 18 |
2 files changed, 6 insertions, 17 deletions
diff --git a/ajax/createfolder.php b/ajax/createfolder.php index b5f624604..6d3c62411 100644 --- a/ajax/createfolder.php +++ b/ajax/createfolder.php @@ -22,10 +22,11 @@ $parentid = trim($_POST['parentid']); $foldermapper = new OC_News_FolderMapper($userid); -if($parentid != 0) +if($parentid != 0) { $folder = new OC_News_Folder($name, NULL, $foldermapper->find($parentid)); -else +} else { $folder = new OC_News_Folder($name); +} $folderid = $foldermapper->save($folder); diff --git a/ajax/importopml.php b/ajax/importopml.php index 5a93567f9..89e2a52f0 100644 --- a/ajax/importopml.php +++ b/ajax/importopml.php @@ -27,30 +27,18 @@ function debug($msg) { OCP\Util::writeLog('news','ajax/importopml.php: '.$msg, OCP\Util::DEBUG); } -if(!isset($_GET['path'])) { +if(!isset($_POST['path'])) { bailOut($l->t('No file path was submitted.')); } require_once('news/opmlparser.php'); -$raw = file_get_contents($_GET['path']); +$raw = file_get_contents($_POST['path']); $parser = new OPMLParser($raw); $title = $parser->getTitle(); +$data = $parser->parse(); $count = 0; //number of feeds imported OCP\JSON::success(array('data' => array('title'=>$title, 'count'=>$count))); -/* -$localpath = OC_Filesystem::getLocalFile($_GET['path']); -$tmpfname = tempnam(get_temp_dir(), "occOrig"); - -if(!file_exists($localpath)) { - bailOut($l->t('File doesn\'t exist:').$localpath); -} - -if (file_put_contents($tmpfname, file_get_contents($localpath))) { - OCP\JSON::success(array('data' => array('tmp'=>$tmpfname, 'path'=>$localpath))); -} else { - bailOut(bailOut('Couldn\'t save temporary image: '.$tmpfname)); -}*/ |