fixed post_all API to allow export of private data
[scuttle] / api / posts_all.php
index 03026c4234d271ed7e48b997388ba38958260d14..0831d9fa12c55f351d39b70dce1b897ab20b96bf 100644 (file)
@@ -5,11 +5,14 @@
 // - doesn't include the filtered tag as an attribute on the root element (we do)
 
 // Force HTTP authentication first!
-require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once 'httpauth.inc.php';
+require_once '../header.inc.php';
+
+// set user as logged in so private bookmarks are exported
+$loggedon = true;
 
 $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+$userservice     =& ServiceFactory::getServiceInstance('UserService');
 
 // Check to see if a tag was specified.
 if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
@@ -43,8 +46,7 @@ foreach($bookmarks['bookmarks'] as $row) {
         $taglist = 'system:unfiled';
     }
 
-    echo "\t<post href=\"". filter($row['bAddress'], 'xml') .'" description="'. filter($row['bTitle'], 'xml') .'" '. $description .'hash="'. md5($row['bAddress']) .'" tag="'. filter($taglist, 'xml') .'" time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) ."\" />\r\n";
+    echo "\t<post href=\"". filter($row['bAddress'], 'xml') .'" description="'. filter($row['bTitle'], 'xml') .'" '. $description .'hash="'. md5($row['bAddress']) . ($row['bStatus'] ? '" shared="no' : '') .'" tag="'. filter($taglist, 'xml') .'" time="'. gmdate('Y-m-d\TH:i:s\Z', strtotime($row['bDatetime'])) ."\" />\r\n";
 }
 
 echo '</posts>';
-?>
\ No newline at end of file

Benjamin Mako Hill || Want to submit a patch?